Skip to content
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

Registry tool: registry config configurations is hard to use in scripts that repeatedly recreate a configuration #1106

Open
timburks opened this issue Mar 17, 2023 · 1 comment

Comments

@timburks
Copy link
Contributor

I have a script that builds a registry instance. At the end of the script, I would like to create a configuration for the registry tool to use it.

registry config configurations create works the first time I run the script, but if I run it again, I get an error:

$ registry config configurations create minikube
Error: cannot create config "minikube", it already exists

If I try to activate a configuration that doesn't exist, I also get an error:

$ registry config configurations activate foo
Error: cannot read config "foo": open /home/tim/.config/registry/foo: no such file or directory

If I try to delete a configuration in a script (before recreating it), I get an interactive prompt that I can't disable:

$ registry config configurations delete minikube
The following configs will be deleted:
 - minikube
Do you want to continue (Y/n)? ^C
$ registry config configurations delete minikube --help
Deletes a named configuration

Usage:
  registry config configurations delete CONFIGURATION_1 ... CONFIGURATION_N [flags]

Flags:
  -h, --help   help for delete

Global Flags:
      --address string             the server and port of the Registry API (eg. localhost:8080)
  -c, --config string              name of a configuration profile or path to config file
      --registry.address string    the server and port of the Registry API (eg. localhost:8080)
      --registry.insecure          if specified, client connects via http (not https)
      --registry.location string   the API Registry location
      --registry.project string    the API Registry project
      --registry.token string      the token to use for authorization to the API Registry

As a workaround, I can run rm -f ~/.config/registry/minikube before recreating the configuration.

Note that the preexisting configuration can't just be reused because the server is running at a new address each time.

@theganyo
Copy link
Member

We should allow for passing a --force or -y flag for that final one, but I believe the other errors are proper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

2 participants