Skip to content
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

[patch] fix skip_pre_check #1272

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions python/src/mas/cli/update/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ def update(self, argv):
"kafka_provider",
"dro_migration",
"dro_storage_class",
"dro_namespace"
"dro_namespace",
"skip_pre_check"
]
for key, value in vars(self.args).items():
# These fields we just pass straight through to the parameters and fail if they are not set
Expand All @@ -67,7 +68,7 @@ def update(self, argv):
self.setParam(key, value)

# Arguments that we don't need to do anything with
elif key in ["skip_pre_check", "no_confirm", "help"]:
elif key in [ "no_confirm", "help"]:
pass

# Fail if there's any arguments we don't know how to handle
Expand Down Expand Up @@ -425,16 +426,17 @@ def detectUDS(self) -> None:
else:
h.stop_and_persist(symbol=self.successIcon, text="IBM User Data Services needs to be migrated to IBM Data Reporter Operator")
self.showUDSUpdateNotice()
if not self.yesOrNo("Confirm migration from UDS to DRO", "dro_migration"):
# If the user did not approve the update, abort
exit(1)
self.printDescription([
"",
"Select the storage class for DRO to use from the list below:"
])
for storageClass in getStorageClasses(self.dynamicClient):
print_formatted_text(HTML(f"<LightSlateGrey> - {storageClass.metadata.name}</LightSlateGrey>"))
self.promptForString("DRO storage class", "dro_storage_class", validator=StorageClassValidator())
if self.getParam("dro_migration") == "true" and self.getParam("dro_storage_class") is None:
if not self.yesOrNo("Confirm migration from UDS to DRO", "dro_migration"):
# If the user did not approve the update, abort
exit(1)
self.printDescription([
"",
"Select the storage class for DRO to use from the list below:"
])
for storageClass in getStorageClasses(self.dynamicClient):
print_formatted_text(HTML(f"<LightSlateGrey> - {storageClass.metadata.name}</LightSlateGrey>"))
self.promptForString("DRO storage class", "dro_storage_class", validator=StorageClassValidator())

except (ResourceNotFoundError, NotFoundError) as e:
# UDS has never been installed on this cluster
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
when:
- input: "$(params.skip_pre_check)"
operator: notin
values: ["true"]
values: ["True"]
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@
when:
- input: "$(params.skip_pre_check)"
operator: notin
values: ["true"]
values: ["True"]