-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[AKS] Prompt when disabling CSI Drivers #4868
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1717,13 +1717,14 @@ def get_node_vm_size(self) -> str: | |
| return self._get_node_vm_size() | ||
|
|
||
| def get_disk_driver(self) -> Optional[ManagedClusterStorageProfileDiskCSIDriver]: | ||
| """Obtrain the value of storage_profile.disk_csi_driver | ||
| """Obtain the value of storage_profile.disk_csi_driver | ||
|
|
||
| :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 not enable_disk_driver and not disable_disk_driver and not disk_driver_version: | ||
| return None | ||
| profile = self.models.ManagedClusterStorageProfileDiskCSIDriver() | ||
|
|
@@ -1759,17 +1760,21 @@ def get_disk_driver(self) -> Optional[ManagedClusterStorageProfileDiskCSIDriver] | |
| if disk_driver_version: | ||
| profile.version = disk_driver_version | ||
| elif disable_disk_driver: | ||
| 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() | ||
|
Comment on lines
+1763
to
+1765
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes. but |
||
| profile.enabled = False | ||
|
|
||
| return profile | ||
|
|
||
| def get_file_driver(self) -> Optional[ManagedClusterStorageProfileFileCSIDriver]: | ||
| """Obtrain the value of storage_profile.file_csi_driver | ||
| """Obtain the value of storage_profile.file_csi_driver | ||
|
|
||
| :return: Optional[ManagedClusterStorageProfileFileCSIDriver] | ||
| """ | ||
| enable_file_driver = self.raw_param.get("enable_file_driver") | ||
| disable_file_driver = self.raw_param.get("disable_file_driver") | ||
|
|
||
| if not enable_file_driver and not disable_file_driver: | ||
| return None | ||
| profile = self.models.ManagedClusterStorageProfileFileCSIDriver() | ||
|
|
@@ -1790,17 +1795,21 @@ def get_file_driver(self) -> Optional[ManagedClusterStorageProfileFileCSIDriver] | |
| if enable_file_driver: | ||
| profile.enabled = True | ||
| elif disable_file_driver: | ||
| 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() | ||
|
Comment on lines
+1798
to
+1800
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above |
||
| profile.enabled = False | ||
|
|
||
| return profile | ||
|
|
||
| def get_snapshot_controller(self) -> Optional[ManagedClusterStorageProfileSnapshotController]: | ||
| """Obtrain the value of storage_profile.snapshot_controller | ||
| """Obtain the value of storage_profile.snapshot_controller | ||
|
|
||
| :return: Optional[ManagedClusterStorageProfileSnapshotController] | ||
| """ | ||
| enable_snapshot_controller = self.raw_param.get("enable_snapshot_controller") | ||
| disable_snapshot_controller = self.raw_param.get("disable_snapshot_controller") | ||
|
|
||
| if not enable_snapshot_controller and not disable_snapshot_controller: | ||
| return None | ||
|
|
||
|
|
@@ -1822,12 +1831,16 @@ def get_snapshot_controller(self) -> Optional[ManagedClusterStorageProfileSnapsh | |
| if enable_snapshot_controller: | ||
| profile.enabled = True | ||
| elif 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 self.get_yes() and not prompt_y_n(msg, default="n"): | ||
| raise DecoratorEarlyExitException() | ||
|
Comment on lines
+1834
to
+1837
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above |
||
| profile.enabled = False | ||
|
|
||
| return profile | ||
|
|
||
| def get_storage_profile(self) -> Optional[ManagedClusterStorageProfile]: | ||
| """Obtrain the value of storage_profile. | ||
| """Obtain the value of storage_profile. | ||
|
|
||
| :return: Optional[ManagedClusterStorageProfile] | ||
| """ | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.