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' username: '_json_key'
password: '{escaped contents of the GCR keyfile.json file}' 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 For a sample project using registry secrets with the Google Container Registry,
the balena directory (usually $HOME/.balena), this file will be used instead. 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: Examples:
@ -1598,8 +1602,12 @@ Sample registry-secrets YAML file:
username: '_json_key' username: '_json_key'
password: '{escaped contents of the GCR keyfile.json file}' 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 For a sample project using registry secrets with the Google Container Registry,
the balena directory (usually $HOME/.balena), this file will be used instead. 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: Examples:
@ -1722,8 +1730,12 @@ Sample registry-secrets YAML file:
username: '_json_key' username: '_json_key'
password: '{escaped contents of the GCR keyfile.json file}' 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 For a sample project using registry secrets with the Google Container Registry,
the balena directory (usually $HOME/.balena), this file will be used instead. 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: Examples:

View File

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

View File

@ -186,11 +186,8 @@ module.exports =
Logger = require('../utils/logger') Logger = require('../utils/logger')
logger = new Logger() logger = new Logger()
logger.logDebug('Parsing input...') logger.logDebug('Parsing input...')
appName = undefined
Promise.try ->
# when Capitano converts a positional parameter (but not an option) # when Capitano converts a positional parameter (but not an option)
# to a number, the original value is preserved with the _raw suffix # to a number, the original value is preserved with the _raw suffix
{ appName, appName_raw, image } = params { appName, appName_raw, image } = params
@ -199,8 +196,8 @@ module.exports =
appName = appName_raw || appName || options.application appName = appName_raw || appName || options.application
delete options.application delete options.application
validateComposeOptions(sdk, options) Promise.resolve(validateComposeOptions(sdk, options))
.then ->
if not appName? if not appName?
throw new Error('Please specify the name of the application to deploy') 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' username: '_json_key'
password: '{escaped contents of the GCR keyfile.json file}' 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 For a sample project using registry secrets with the Google Container Registry,
the balena directory (usually $HOME/.balena), this file will be used instead.`; 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.`;