Merge pull request #1400 from balena-io/1397-fix-build-registry-secrets

Fix failing registry secrets authentication under certain conditions
This commit is contained in:
Paulo Castro 2019-08-20 02:32:59 +01:00 committed by GitHub
commit 4a80beac35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 38 additions and 27 deletions

View File

@ -1447,8 +1447,12 @@ Sample registry-secrets YAML file:
username: '_json_key'
password: '{escaped contents of the GCR keyfile.json file}'
If an option is not specified, and a secrets.yml or secrets.json file exists in
the balena directory (usually $HOME/.balena), this file will be used instead.
For a sample project using registry secrets with the Google Container Registry,
check: https://github.com/balena-io-playground/sample-gcr-registry-secrets
If the --registry-secrets option is not specified, and a secrets.yml or
secrets.json file exists in the balena directory (usually $HOME/.balena),
this file will be used instead.
Examples:
@ -1598,8 +1602,12 @@ Sample registry-secrets YAML file:
username: '_json_key'
password: '{escaped contents of the GCR keyfile.json file}'
If an option is not specified, and a secrets.yml or secrets.json file exists in
the balena directory (usually $HOME/.balena), this file will be used instead.
For a sample project using registry secrets with the Google Container Registry,
check: https://github.com/balena-io-playground/sample-gcr-registry-secrets
If the --registry-secrets option is not specified, and a secrets.yml or
secrets.json file exists in the balena directory (usually $HOME/.balena),
this file will be used instead.
Examples:
@ -1722,8 +1730,12 @@ Sample registry-secrets YAML file:
username: '_json_key'
password: '{escaped contents of the GCR keyfile.json file}'
If an option is not specified, and a secrets.yml or secrets.json file exists in
the balena directory (usually $HOME/.balena), this file will be used instead.
For a sample project using registry secrets with the Google Container Registry,
check: https://github.com/balena-io-playground/sample-gcr-registry-secrets
If the --registry-secrets option is not specified, and a secrets.yml or
secrets.json file exists in the balena directory (usually $HOME/.balena),
this file will be used instead.
Examples:

View File

@ -109,17 +109,15 @@ module.exports =
Logger = require('../utils/logger')
logger = new Logger()
logger.logDebug('Parsing input...')
Promise.try ->
# `build` accepts `[source]` as a parameter, but compose expects it
# as an option. swap them here
options.source ?= params.source
delete params.source
validateComposeOptions(sdk, options)
# `build` accepts `[source]` as a parameter, but compose expects it
# as an option. swap them here
options.source ?= params.source
delete params.source
Promise.resolve(validateComposeOptions(sdk, options))
.then ->
{ application, arch, deviceType } = options
if (not (arch? and deviceType?) and not application?) or (application? and (arch? or deviceType?))

View File

@ -186,21 +186,18 @@ module.exports =
Logger = require('../utils/logger')
logger = new Logger()
logger.logDebug('Parsing input...')
appName = undefined
Promise.try ->
# when Capitano converts a positional parameter (but not an option)
# to a number, the original value is preserved with the _raw suffix
{ appName, appName_raw, image } = params
# when Capitano converts a positional parameter (but not an option)
# to a number, the original value is preserved with the _raw suffix
{ appName, appName_raw, image } = params
# look into "balena build" options if appName isn't given
appName = appName_raw || appName || options.application
delete options.application
validateComposeOptions(sdk, options)
# look into "balena build" options if appName isn't given
appName = appName_raw || appName || options.application
delete options.application
Promise.resolve(validateComposeOptions(sdk, options))
.then ->
if not appName?
throw new Error('Please specify the name of the application to deploy')

View File

@ -45,5 +45,9 @@ Sample registry-secrets YAML file:
username: '_json_key'
password: '{escaped contents of the GCR keyfile.json file}'
If an option is not specified, and a secrets.yml or secrets.json file exists in
the balena directory (usually $HOME/.balena), this file will be used instead.`;
For a sample project using registry secrets with the Google Container Registry,
check: https://github.com/balena-io-playground/sample-gcr-registry-secrets
If the --registry-secrets option is not specified, and a secrets.yml or
secrets.json file exists in the balena directory (usually $HOME/.balena),
this file will be used instead.`;