-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[AKS] Prompt when disabling CSI Drivers #4868
Conversation
AKS |
Please address those conflicts and the 7 failing checks. |
939ca17
to
911752e
Compare
@@ -907,6 +916,16 @@ def aks_update(cmd, # pylint: disable=too-many-statements,too-many-branches, | |||
enable_apiserver_vnet_integration=False, | |||
apiserver_subnet_id=None, | |||
): | |||
|
|||
if disable_disk_driver or disable_file_driver: | |||
msg = 'Did you check if the related PVs and PVCs were deleted before disabling the CSI Drivers?' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please make sure there are no existing Kubernetes resources that are used by the CSI driver before disabling
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@olsenme are you ok with the above statement in the cli command?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed.
if not yes and not prompt_y_n(msg, default="n"): | ||
return None | ||
if disable_snapshot_controller: | ||
msg = 'Did you check if VolumeSnapshots, VolumeSnapshotClasses and VolumeSnapshotContents CRDs and their resources were deleted before disabling SnapshotController?' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please make sure there are no existing Kubernetes resources that are used by the snapshot controller before disabling
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@olsenme are you ok with the above statement in the cli command?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed.
ce74139
to
0bccf1f
Compare
93ce389
to
1676ce1
Compare
if disable_disk_driver or disable_file_driver: | ||
msg = "Please make sure there are no existing PVs and PVCs that are used by the CSI driver before disabling." | ||
if not yes and not prompt_y_n(msg, default="n"): | ||
return None | ||
if disable_snapshot_controller: | ||
msg = "Please make sure there are no existing VolumeSnapshots, VolumeSnapshotClasses and VolumeSnapshotContents " \ | ||
"that are used by the snapshot controller before disabling." | ||
if not yes and not prompt_y_n(msg, default="n"): | ||
return None | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please put these statements below raw_parameters = locals()
. Also put them into decorator.py
? It's hard to test the entry function (aks_create
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
if disable_disk_driver or disable_file_driver: | ||
msg = "Please make sure there are no existing PVs and PVCs that are used by the CSI driver before disabling." | ||
if not yes and not prompt_y_n(msg, default="n"): | ||
return None | ||
if disable_snapshot_controller: | ||
msg = "Please make sure there are no existing VolumeSnapshots, VolumeSnapshotClasses and VolumeSnapshotContents " \ | ||
"that are used by the snapshot controller before disabling." | ||
if not yes and not prompt_y_n(msg, default="n"): | ||
return None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
1676ce1
to
d534ce0
Compare
|
||
:return: Optional[ManagedClusterStorageProfileDiskCSIDriver] | ||
""" | ||
enable_disk_driver = self.raw_param.get("enable_disk_driver") | ||
disable_disk_driver = self.raw_param.get("disable_disk_driver") | ||
disk_driver_version = self.raw_param.get("disk_driver_version") | ||
|
||
if disable_disk_driver: | ||
msg = "Please make sure there are no existing PVs and PVCs that are used by AzureDisk CSI driver before disabling." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the prompt may happen in az aks create
command? it should only prompt in az aks update
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sense. Let me add it into self.decorator_mode == DecoratorMode.UPDATE
d534ce0
to
de7b30b
Compare
cf76919
to
20ff17e
Compare
Signed-off-by: Ji An Liu <[email protected]>
20ff17e
to
4a5fb99
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
msg = "Please make sure there are no existing PVs and PVCs that are used by AzureDisk CSI driver before disabling." | ||
if not self.get_yes() and not prompt_y_n(msg, default="n"): | ||
raise DecoratorEarlyExitException() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May I ask will the execution of CLI scripts in the automation scenario be blocked by such interactive steps that require input?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes. but -y
can be added into scripts like what we do in test_aks_command.py
msg = "Please make sure there are no existing PVs and PVCs that are used by AzureFile CSI driver before disabling." | ||
if not self.get_yes() and not prompt_y_n(msg, default="n"): | ||
raise DecoratorEarlyExitException() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
msg = "Please make sure there are no existing VolumeSnapshots, VolumeSnapshotClasses and VolumeSnapshotContents " \ | ||
"that are used by the snapshot controller before disabling." | ||
if not self.get_yes() and not prompt_y_n(msg, default="n"): | ||
raise DecoratorEarlyExitException() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
This checklist is used to make sure that common guidelines for a pull request are followed.
Related command
General Guidelines
azdev style <YOUR_EXT>
locally? (pip install azdev
required)python scripts/ci/test_index.py -q
locally?For new extensions:
About Extension Publish
There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update
src/index.json
automatically.The precondition is to put your code inside this repository and upgrade the version in the pull request but do not modify
src/index.json
.