@ -37,6 +37,9 @@ type Secret struct {
|
||||
// variable. For Example:
|
||||
// SECRET_FOO=v1 # charset=default,special
|
||||
Charset string
|
||||
// Whether or not to skip generation of the secret or not
|
||||
// For example: SECRET_FOO=v1 # generate=false
|
||||
SkipGenerate bool
|
||||
// RemoteName is the name of the secret on the server. For example:
|
||||
// name: ${STACK_NAME}_test_pass_two_${SECRET_TEST_PASS_TWO_VERSION}
|
||||
// With the following:
|
||||
@ -155,6 +158,13 @@ func ReadSecretsConfig(appEnvPath string, composeFiles []string, stackName strin
|
||||
value.Length = length
|
||||
}
|
||||
|
||||
generateRaw, ok := modifierValues["generate"]
|
||||
if ok {
|
||||
if generateRaw == "true" {
|
||||
value.SkipGenerate = true
|
||||
}
|
||||
}
|
||||
|
||||
value.Charset = resolveCharset(modifierValues["charset"])
|
||||
break
|
||||
}
|
||||
@ -192,6 +202,12 @@ func GenerateSecrets(cl *dockerClient.Client, secrets map[string]Secret, server
|
||||
go func(secretName string, secret Secret) {
|
||||
defer wg.Done()
|
||||
|
||||
if secret.SkipGenerate {
|
||||
log.Debugf("skipping generation of %s (generate=false)", secretName)
|
||||
ch <- nil
|
||||
return
|
||||
}
|
||||
|
||||
log.Debugf("attempting to generate and store %s on %s", secret.RemoteName, server)
|
||||
|
||||
if secret.Length > 0 {
|
||||
|
Reference in New Issue
Block a user