-
Notifications
You must be signed in to change notification settings - Fork 428
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
Update px cli to make --cloud_addr
a required argument
#1960
Merged
ddelnano
merged 4 commits into
pixie-io:main
from
ddelnano:ddelnano/remove-default-cloud-from-cli-make-reqd-argument
Jul 10, 2024
Merged
Update px cli to make --cloud_addr
a required argument
#1960
ddelnano
merged 4 commits into
pixie-io:main
from
ddelnano:ddelnano/remove-default-cloud-from-cli-make-reqd-argument
Jul 10, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Dom Del Nano <[email protected]>
Signed-off-by: Dom Del Nano <[email protected]>
vihangm
reviewed
Jul 3, 2024
Signed-off-by: Dom Del Nano <[email protected]>
@vihangm this is ready for another round of review when you have the chance. |
vihangm
reviewed
Jul 9, 2024
Signed-off-by: Dom Del Nano <[email protected]>
vihangm
approved these changes
Jul 10, 2024
8 tasks
ddelnano
added a commit
that referenced
this pull request
Jul 16, 2024
…n pixie config file (#1964) Summary: Allow interactive px cli usage to prompt and save preferred cloud in pixie config file This is a continuation of the plan I outlined in #1960 now that cloud addr is required for the `px` cli. Relevant Issues: N/A Type of change: /kind feature Test Plan: Verified the following scenarios. I will make sure to update the PX cli release checklist accordingly if/when approved <details><summary>Default cloud selection testing</summary> - [x] Running `px` command that requires cloud prompts for selection and whether to store it ``` $ ./px auth login Pixie CLI ✔ withpixie.ai:443 ✔ No <------ Cloud selection was opted out of Starting browser... (if browser-based login fails, try running `px auth login --manual` for headless login) Fetching refresh token ... Failed to perform browser based auth. Will try manual auth error=browser failed to open Please Visit: https://work.withpixie.ai:443/login?local_mode=true Copy and paste token here: ^C ``` - [x] Cli commands following storing preferred cloud use the preferred value ``` $ ./px auth login Pixie CLI ✔ withpixie.ai:443 ✔ Yes <------ Cloud selection was opted into saving Starting browser... (if browser-based login fails, try running `px auth login --manual` for headless login) Fetching refresh token ... Failed to perform browser based auth. Will try manual auth error=browser failed to open Please Visit: https://work.withpixie.ai:443/login?local_mode=true Copy and paste token here: ^C $ ./px auth login Pixie CLI Starting browser... (if browser-based login fails, try running `px auth login --manual` for headless login) Fetching refresh token ... Failed to perform browser based auth. Will try manual auth error=browser failed to open Please Visit: https://work.withpixie.ai:443/login?local_mode=true Copy and paste token here: ^C $ cat ~/.pixie/config.json {"uniqueClientID":"XXX","cloudAddr":"withpixie.ai:443"} ``` - [x] Using `--cloud_addr` overrides the value set in config file ``` $ cat ~/.pixie/config.json {"uniqueClientID":"XXX","cloudAddr":"boguscloud.com"} $ ./px --cloud_addr=withpixie.ai auth login Pixie CLI Starting browser... (if browser-based login fails, try running `px auth login --manual` for headless login) Fetching refresh token ... Failed to perform browser based auth. Will try manual auth error=browser failed to open Please Visit: https://work.withpixie.ai:443/login?local_mode=true Copy and paste token here: ``` - [x] Running non-interactively uses cloud stored in config file - [x] Running non-interactively without preferred cloud or `--cloud_addr` results in error </details> <details><summary>`px config` command testing</summary> - [x] `px config list` prints out cloud addr ``` $ ./px config list Pixie CLI CloudAddr: boguscloud.com ``` - [x] `px config set` validates arguments ``` $ ./px config set --key NonExistant --value tesitng Pixie CLI FATA[0000]src/pixie_cli/pkg/cmd/config.go:80 px.dev/pixie/src/pixie_cli/pkg/cmd.glob..func16() Key 'NonExistant' is not settable. Must be one of [CloudAddr] $ ./px config set --key CloudAddr --value withpixie.ai:443 --value testing Pixie CLI FATA[0000]src/pixie_cli/pkg/cmd/config.go:74 px.dev/pixie/src/pixie_cli/pkg/cmd.glob..func16() the number of --key and --value flags must match ``` - [x] `px config set` updates config file ``` $ ./px config set --key CloudAddr --value withpixie.ai:443 Pixie CLI $ ./px config list Pixie CLI CloudAddr: withpixie.ai:443 ``` </details> Changelog Message: Update `px` cli to store preferred cloud in pixie config file Signed-off-by: Dom Del Nano <[email protected]>
ddelnano
added a commit
to ddelnano/pixie
that referenced
this pull request
Sep 23, 2024
GitOrigin-RevId: bbb90a3
ddelnano
added a commit
to ddelnano/pixie
that referenced
this pull request
Sep 23, 2024
…n pixie config file (pixie-io#1964) Summary: Allow interactive px cli usage to prompt and save preferred cloud in pixie config file This is a continuation of the plan I outlined in pixie-io#1960 now that cloud addr is required for the `px` cli. Relevant Issues: N/A Type of change: /kind feature Test Plan: Verified the following scenarios. I will make sure to update the PX cli release checklist accordingly if/when approved <details><summary>Default cloud selection testing</summary> - [x] Running `px` command that requires cloud prompts for selection and whether to store it ``` $ ./px auth login Pixie CLI ✔ withpixie.ai:443 ✔ No <------ Cloud selection was opted out of Starting browser... (if browser-based login fails, try running `px auth login --manual` for headless login) Fetching refresh token ... Failed to perform browser based auth. Will try manual auth error=browser failed to open Please Visit: https://work.withpixie.ai:443/login?local_mode=true Copy and paste token here: ^C ``` - [x] Cli commands following storing preferred cloud use the preferred value ``` $ ./px auth login Pixie CLI ✔ withpixie.ai:443 ✔ Yes <------ Cloud selection was opted into saving Starting browser... (if browser-based login fails, try running `px auth login --manual` for headless login) Fetching refresh token ... Failed to perform browser based auth. Will try manual auth error=browser failed to open Please Visit: https://work.withpixie.ai:443/login?local_mode=true Copy and paste token here: ^C $ ./px auth login Pixie CLI Starting browser... (if browser-based login fails, try running `px auth login --manual` for headless login) Fetching refresh token ... Failed to perform browser based auth. Will try manual auth error=browser failed to open Please Visit: https://work.withpixie.ai:443/login?local_mode=true Copy and paste token here: ^C $ cat ~/.pixie/config.json {"uniqueClientID":"XXX","cloudAddr":"withpixie.ai:443"} ``` - [x] Using `--cloud_addr` overrides the value set in config file ``` $ cat ~/.pixie/config.json {"uniqueClientID":"XXX","cloudAddr":"boguscloud.com"} $ ./px --cloud_addr=withpixie.ai auth login Pixie CLI Starting browser... (if browser-based login fails, try running `px auth login --manual` for headless login) Fetching refresh token ... Failed to perform browser based auth. Will try manual auth error=browser failed to open Please Visit: https://work.withpixie.ai:443/login?local_mode=true Copy and paste token here: ``` - [x] Running non-interactively uses cloud stored in config file - [x] Running non-interactively without preferred cloud or `--cloud_addr` results in error </details> <details><summary>`px config` command testing</summary> - [x] `px config list` prints out cloud addr ``` $ ./px config list Pixie CLI CloudAddr: boguscloud.com ``` - [x] `px config set` validates arguments ``` $ ./px config set --key NonExistant --value tesitng Pixie CLI FATA[0000]src/pixie_cli/pkg/cmd/config.go:80 px.dev/pixie/src/pixie_cli/pkg/cmd.glob..func16() Key 'NonExistant' is not settable. Must be one of [CloudAddr] $ ./px config set --key CloudAddr --value withpixie.ai:443 --value testing Pixie CLI FATA[0000]src/pixie_cli/pkg/cmd/config.go:74 px.dev/pixie/src/pixie_cli/pkg/cmd.glob..func16() the number of --key and --value flags must match ``` - [x] `px config set` updates config file ``` $ ./px config set --key CloudAddr --value withpixie.ai:443 Pixie CLI $ ./px config list Pixie CLI CloudAddr: withpixie.ai:443 ``` </details> Changelog Message: Update `px` cli to store preferred cloud in pixie config file Signed-off-by: Dom Del Nano <[email protected]> GitOrigin-RevId: 1d41f9b
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary: Update px cli to make
--cloud_addr
a required argumentThis removes the CC4P dependency on the Pixie cli so that the project is agnostic to any vendor provided Pixie cloud. While this argument is now required, if the cli is run within an interactive shell, the user will be presented with the available Pixie clouds and have the opportunity to select the one they want to use (see Test Plan below).
My plan is to take this a step further for the interactive case and have the cli populate the
~/.pixie/config.json
(or similar) file if the user wants to save their selected cloud. Future invocations of the cli will use what is stored in~/.pixie
.Relevant Issues: N/A
Type of change: /kind cleanup
Test Plan: Tested the following scenarios
px help
,px --help
,px deploy --help
(command) andpx script help
(command with sub commands) bypass the new required logic. Note:px deploy help
would require the argument since it is an invalid command (deploy
doesn't have a help subcommand)--cloud_addr
has not been providedChangelog Message: Update
px
cli to make--cloud_addr
a required argument if not populated by thePX_CLOUD_ADDR
environment variable