mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-01-03 04:26:39 +00:00
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:
commit
4a80beac35
@ -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:
|
||||||
|
|
||||||
|
@ -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?))
|
||||||
|
@ -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')
|
||||||
|
|
||||||
|
@ -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.`;
|
||||||
|
Loading…
Reference in New Issue
Block a user