-
Notifications
You must be signed in to change notification settings - Fork 93
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
[ENH] - Include "--attempt-fixes" flag from Nebari upgrade CLI in upgrade steps logic #2839
base: main
Are you sure you want to change the base?
[ENH] - Include "--attempt-fixes" flag from Nebari upgrade CLI in upgrade steps logic #2839
Conversation
2b5260e
to
d053d04
Compare
src/_nebari/upgrade.py
Outdated
@@ -640,11 +685,11 @@ def _version_specific_upgrade( | |||
"" | |||
) | |||
|
|||
continue_ = Prompt.ask( | |||
continue_ = attempt_fixes or Confirm.ask( |
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.
Is there a way to automate the deletion of Argo Workflow CRDs? Otherwise, we are just assuming that the deletion already took place if attempt_fixes == true.
The same type of question applies to more changes below in the upgrade.py
.
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, there is. @marcelovilla did it for the Prometheus operator upgrade. See
Line 1043 in 855aa14
if run_commands == "y": |
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.
@smokestacklightnin did you see the approach I implemented? You'd need to add the logic to automatically delete the relevant CRDs here if the attempt_fixes
is passed. We would need an extra step or we would need to reframe the question, though.
This should probably be a draft PR if you still have questions about the implementation |
d053d04
to
47df80c
Compare
src/_nebari/upgrade.py
Outdated
@@ -640,11 +685,11 @@ def _version_specific_upgrade( | |||
"" | |||
) | |||
|
|||
continue_ = Prompt.ask( | |||
continue_ = attempt_fixes or Confirm.ask( |
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.
@smokestacklightnin did you see the approach I implemented? You'd need to add the logic to automatically delete the relevant CRDs here if the attempt_fixes
is passed. We would need an extra step or we would need to reframe the question, though.
@smokestacklightnin can you also make sure the tests are passing? |
…adeStep._version_specific_upgrade`
…ep.update_image_tag`
4807612
to
239c419
Compare
adade08
to
d7520ed
Compare
for crd in argo_crds: | ||
api_instance = kubernetes.client.ApiextensionsV1Api() | ||
try: | ||
api_instance.delete_custom_resource_definition( | ||
name=crd, | ||
) | ||
except kubernetes.client.exceptions.ApiException as e: | ||
if e.status == 404: | ||
rich.print(f"CRD [yellow]{crd}[/yellow] not found. Ignoring.") | ||
else: | ||
raise e | ||
else: | ||
rich.print(f"Successfully removed CRD [green]{crd}[/green]") | ||
|
||
for sa in argo_sa: | ||
api_instance = kubernetes.client.CoreV1Api() | ||
try: | ||
api_instance.delete_namespaced_service_account( | ||
sa, | ||
namespace, | ||
) | ||
except kubernetes.client.exceptions.ApiException as e: | ||
if e.status == 404: | ||
rich.print( | ||
f"Service account [yellow]{sa}[/yellow] not found. Ignoring." | ||
) | ||
else: | ||
raise e | ||
else: | ||
rich.print( | ||
f"Successfully removed service account [green]{sa}[/green]" | ||
) |
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.
@marcelovilla I was able to adapt what you did
Reference Issues or PRs
This resloves #2761 by passing the
attempt_fixes
variable from the command line option to the upgrade methods.What does this implement/fix?
Put a
x
in the boxes that applyTesting
How to test this PR?
Run
nebari upgrade --attempt-fixes
and verify that the upgrade is successful without prompts from the user.Any other comments?