-
Notifications
You must be signed in to change notification settings - Fork 42
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
Allow operators to override the registry and registry-endpoint for a spaces install #358
Allow operators to override the registry and registry-endpoint for a spaces install #358
Conversation
cmd/up/space/space.go
Outdated
@@ -57,7 +61,18 @@ type Cmd struct { | |||
} | |||
|
|||
type commonParams struct { | |||
Repo *url.URL `hidden:"" env:"UPBOUND_REPO" default:"us-west1-docker.pkg.dev/orchestration-build/upbound-environments" help:"Set repo for Upbound."` | |||
Registry *url.URL `hidden:"" env:"UPBOUND_REPO" default:"us-west1-docker.pkg.dev/orchestration-build/upbound-environments" help:"Set repo for Upbound."` |
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.
The example in your PR has: --registry=upbound/spaces-install
. Is it correct that it's a URL?
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.
The API that takes this property is looking for a url:
func NewManager(config *rest.Config, chartName string, repoURL *url.URL, modifiers ...InstallerModifierFn) (install.Manager, error) {
invoked like:
mgr, err := helm.NewManager(insCtx.Kubeconfig,
spacesChart,
c.Registry,
helm.WithNamespace(ns),
helm.WithBasicAuth(c.id, c.token),
helm.IsOCI(),
helm.WithChart(c.Bundle),
helm.Wait(),
)
if err != nil {
return err
}
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.
I'm fairly confused -- if someone looks at the help (I know it's hidden, but in the source), would they know what to do?
I'll approve, but there may be a more clear description.
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.
Sorry I misunderstood your question before. I've updated the help string. If it's still confusing I'm happy to take another pass at it.
…spaces install - default to json_key auth - if the registry is overridden, prompt for username/password Signed-off-by: Taylor Thornton <thornton.tn@gmail.com>
Signed-off-by: Taylor Thornton <thornton.tn@gmail.com>
7baf329
to
4cd36ca
Compare
Description of your changes
This is specifically useful for operators working in an airgapped environment.
Unfortunately, given we don't really know what the shape of the pull secret should be, we do our best to prompt for username/password and supply the registry-endpoint value.
Fixes #349
I have:
make reviewable
to ensure this PR is ready for review.How has this code been tested
up space init --token-file=key.json version
still works: