-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
Verify Kubernetes context before install #1739
Conversation
Codecov ReportBase: 52.05% // Head: 52.19% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #1739 +/- ##
==========================================
+ Coverage 52.05% 52.19% +0.14%
==========================================
Files 274 274
Lines 8481 8481
Branches 616 616
==========================================
+ Hits 4415 4427 +12
+ Misses 3574 3562 -12
Partials 492 492
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
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.
Reviewed 4 of 5 files at r1, 5 of 7 files at r2, all commit messages.
Reviewable status: 9 of 11 files reviewed, 2 unresolved discussions (waiting on @jmgrady)
deploy/scripts/aws_env.py
line 66 at r2 (raw file):
os.environ["AWS_SECRET_ACCESS_KEY"] = get_profile_var(aws_profile, "aws_secret_access_key") region = get_profile_var(aws_profile, "region") os.environ["AWS_DEFAULT_REGION"] = region
Looks like defining region
creates an unnecessary extra line.
Code quote:
region = get_profile_var(aws_profile, "region")
os.environ["AWS_DEFAULT_REGION"] = region
deploy/scripts/kube_env.py
line 80 at r2 (raw file):
Add commandline arguments that are shared between scripts calling helm. Sets up '--verbose' as the equivalent of '--debug'.
This vestigial --verbose
reference can be removed.
Code quote:
Sets up '--verbose' as the equivalent of '--debug'.
Make LiftEntry ids unique.
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.
Reviewable status: 8 of 12 files reviewed, all discussions resolved (waiting on @imnasnainaec and @jmgrady)
deploy/scripts/aws_env.py
line 66 at r2 (raw file):
Previously, imnasnainaec (D. Ror.) wrote…
Looks like defining
region
creates an unnecessary extra line.
Done.
deploy/scripts/kube_env.py
line 80 at r2 (raw file):
Previously, imnasnainaec (D. Ror.) wrote…
This vestigial
--verbose
reference can be removed.
Done.
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.
Reviewed 2 of 3 files at r4, all commit messages.
Reviewable status: 10 of 12 files reviewed, 2 unresolved discussions (waiting on @jmgrady)
deploy/scripts/kube_env.py
line 77 at r4 (raw file):
def add_kube_opts(parser: argparse.ArgumentParser) -> None: """Add commandline arguments for KUbernetes tools."""
Capital U in KUbern...
?
deploy/scripts/utils.py
line 70 at r4 (raw file):
or has the curr_selection as its only member. """ if len(options) > 1:
If curr_selection is None
and len(options)=1
, the present algorithm returns None
instead of the single entry in options
. Is that okay?
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.
Reviewable status: 10 of 12 files reviewed, 1 unresolved discussion (waiting on @imnasnainaec and @jmgrady)
deploy/scripts/kube_env.py
line 77 at r4 (raw file):
Previously, imnasnainaec (D. Ror.) wrote…
Capital U in
KUbern...
?
Done.
deploy/scripts/utils.py
line 70 at r4 (raw file):
Previously, imnasnainaec (D. Ror.) wrote…
If
curr_selection is None
andlen(options)=1
, the present algorithm returnsNone
instead of the single entry inoptions
. Is that okay?
No, it is not (and it doesn't match the description!
I have added a test for the case you mentioned at the beginning of the function:
if len(options) == 1 and curr_selection is not None and curr_selection == options[0]:
return curr_selection
If this condition is not met, it will prompt the user if len(options) >= 1
instead of strictly >
so if the curr_selection
is None
the user will be prompted to select the option. I don't want to blindly take the single option because if it is not the correct one, The Combine could be installed on the wrong Kubernetes cluster or with the wrong AWS permissions.
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.
Reviewable status: 10 of 12 files reviewed, all discussions resolved (waiting on @jmgrady)
deploy/scripts/utils.py
line 70 at r4 (raw file):
Previously, jmgrady (Jim Grady) wrote…
No, it is not (and it doesn't match the description!
I have added a test for the case you mentioned at the beginning of the function:
if len(options) == 1 and curr_selection is not None and curr_selection == options[0]: return curr_selection
If this condition is not met, it will prompt the user if
len(options) >= 1
instead of strictly>
so if thecurr_selection
isNone
the user will be prompted to select the option. I don't want to blindly take the single option because if it is not the correct one, The Combine could be installed on the wrong Kubernetes cluster or with the wrong AWS permissions.
Done.
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.
Reviewed 1 of 2 files at r5, all commit messages.
Reviewable status: 11 of 12 files reviewed, 2 unresolved discussions (waiting on @jmgrady)
deploy/scripts/utils.py
line 80 at r5 (raw file):
prompt_str = f"Enter {name}: " else: prompt_str = f"Enter {name}(Default: {curr_selection}): "
A space between {name}
and (Default
might be nice.
deploy/scripts/utils.py
line 101 at r5 (raw file):
curr_selection = None except ValueError: curr_selection = None
It looks like an invalid user selection will cause the initial default to no longer be the default. If that's the case, is that okay?
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.
Reviewable status: 11 of 12 files reviewed, 1 unresolved discussion (waiting on @imnasnainaec and @jmgrady)
deploy/scripts/utils.py
line 80 at r5 (raw file):
Previously, imnasnainaec (D. Ror.) wrote…
A space between
{name}
and(Default
might be nice.
Done.
deploy/scripts/utils.py
line 101 at r5 (raw file):
Previously, imnasnainaec (D. Ror.) wrote…
It looks like an invalid user selection will cause the initial default to no longer be the default. If that's the case, is that okay?
I don't have a problem with that. By entering something the first time it is safe to assume that the user does not want the default so they just need to select a valid option. This also conforms to the usual practice that Ctrl-C will just exit completely in the case that the user does not want any of the suggestions.
I did, however, update it so that it will reprint the list if an invalid option is selected.
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.
Reviewed 1 of 1 files at r6, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @jmgrady)
Update the
setup_cluster.py
andsetup_combine.py
scripts to prompt the user to verify the Kubernetes context before the setup tasks are run.If there is more than one context available, then the script will list the selected context and ask the user to verify the context or select another.
Note that there should be no prompting when run in the CI/CD pipeline.
This change is