balena-io / balena-cli

The official balena CLI tool.
Apache License 2.0
453 stars 139 forks source link

registry-secrets does not accept an auth token #1297

Open Page- opened 5 years ago

Page- commented 5 years ago

When using a registry-secrets file with an auth token instead of hardcoded username/password I get the following error

Error validating registry secrets file "registry.json":
data['auths'] should NOT have additional properties

Additional information may be available by setting a DEBUG=1 environment
variable: "set DEBUG=1" on a Windows command prompt, or "export DEBUG=1"
on Linux or macOS.

If you need help, don't hesitate in contacting our support forums at
https://forums.balena.io

For bug reports or feature requests, have a look at the GitHub issues or
create a new one at: https://github.com/balena-io/balena-cli/issues/

Please keep in mind that we try to use the issue tracker of this repository for specific bug reports & CLI feature requests. General & troubleshooting questions are encouraged to be posted to the balena forums where the community can both contribute and benefit from the answers.

Before submitting this issue please check that this issue is not a duplicate. If there is another issue describing the same problem or feature please add your information to the existing issue's comments.

pdcastro commented 5 years ago

For what it is worth -- probably only loosely related to this issue -- I know that the password field can be used to store the yaml-escaped contents of a Google Container Registry "keyfile.json" file. balena help push prints an outline for it:

$ balena help push
...
Sample registry-secrets YAML file:

    'eu.gcr.io':  # Google Container Registry
        username: '_json_key'
        password: '{escaped contents of the GCR keyfile.json file}'
Page- commented 5 years ago

I actually messed up the file format somewhat because I thought it match the format of .docker/config.json so the correct error for using an auth token instead is actually:

Error validating registry secrets file "registry.json":
data['https://index.docker.io/v1/'] should NOT have additional properties

Additional information may be available by setting a DEBUG=1 environment
variable: "set DEBUG=1" on a Windows command prompt, or "export DEBUG=1"
on Linux or macOS.

If you need help, don't hesitate in contacting our support forums at
https://forums.balena.io

For bug reports or feature requests, have a look at the GitHub issues or
create a new one at: https://github.com/balena-io/balena-cli/issues/