Closed branden closed 9 months ago
We should also choose a new profile name in space init
. Either here or in another PR.
@sttts
We should also choose a new profile name in
space init
. Either here or in another PR.Do we check that it actually is a Spaces installation? We should.
I'd like to keep this PR scoped to addressing #399. Could you file issues for these so we don't lose track of them?
@sttts I pushed some changes to address your comments, lmk what you think. Notably I put things back so that profile set space
only updates the default profile when there are no existing profiles, since like you pointed out we already have profile use
.
Created https://github.com/upbound/up/issues/404 for the space init
part.
@sttts Here's how help text looks after the latest push:
branden@crateria up % ./_output/bin/darwin_arm64/up profile set -h
Usage: up profile set <command>
Set an Upbound Profile for use with a Space.
Flags:
-h, --help Show context-sensitive help.
--format="default" Format for get/list commands. Can be: json, yaml,
default
-v, --version Print version and exit.
-q, --quiet Suppress all output.
--pretty Pretty print output.
--domain=https://upbound.io
Root Upbound domain ($UP_DOMAIN).
--profile=STRING Profile used to execute command ($UP_PROFILE).
-a, --account=STRING Account used to execute command ($UP_ACCOUNT).
--insecure-skip-tls-verify
[INSECURE] Skip verifying TLS certificates
($UP_INSECURE_SKIP_TLS_VERIFY).
-d, --debug=INT [INSECURE] Run with debug logging. Repeat
to increase verbosity. Output might contain
confidential data like tokens ($UP_DEBUG).
Commands:
profile set space Set an Upbound Profile for use with a Space.
branden@crateria up % ./_output/bin/darwin_arm64/up profile set space -h
Usage: up profile set space
Set an Upbound Profile for use with a Space.
By default the default profile is overwritten. Use --profile to create or update
a different profile.
A Space profile communicates with a Space using a Kubernetes context from
a kubeconfig file. The kubeconfig and context may be selected using the
--kubeconfig and --kubecontext flags. If --kubeconfig is not provided, then the
profile will use the default kubeconfig at ~/.kube/config. If --kubecontext is
not provided, then the profile will use the kubeconfig's current default context
at the time this command is run. Changing the kubeconfig's default context
afterward will not change which context the profile uses.
Flags:
-h, --help Show context-sensitive help.
--format="default" Format for get/list commands. Can be: json, yaml,
default
-v, --version Print version and exit.
-q, --quiet Suppress all output.
--pretty Pretty print output.
--domain=https://upbound.io
Root Upbound domain ($UP_DOMAIN).
--profile=STRING Profile used to execute command ($UP_PROFILE).
-a, --account=STRING Account used to execute command ($UP_ACCOUNT).
--insecure-skip-tls-verify
[INSECURE] Skip verifying TLS certificates
($UP_INSECURE_SKIP_TLS_VERIFY).
-d, --debug=INT [INSECURE] Run with debug logging. Repeat
to increase verbosity. Output might contain
confidential data like tokens ($UP_DEBUG).
--kubeconfig=STRING Override default kubeconfig path.
--kubecontext=STRING Override default kubeconfig context.
branden@crateria up %
@branden perfect help text. Thanks!
Only quesiton that is left is about checking that it is a Space kube context. Checking for e.g. the mxe-controller
deployment in upbound-system. Would do.
Then we are ready to go.
The Spaces check is a little beyond scope technically. Approving.
Description of your changes
This makes
up profile set space
accept a nonexistent--profile
. It will create that profile.Fixes #399.
I have:
make reviewable
to ensure this PR is ready for review.backport release-x.y
labels to auto-backport this PR, as appropriate.How has this code been tested
Added unit tests.