mirror of https://github.com/docker/cli.git
do not force target type for secret references
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com> use secret store interface instead of embedded secret data into container Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
This commit is contained in:
parent
4488d9f9fb
commit
bc542f365c
|
@ -17,19 +17,19 @@ func parseSecrets(client client.APIClient, requestedSecrets []*types.SecretReque
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
for _, secret := range requestedSecrets {
|
for _, secret := range requestedSecrets {
|
||||||
|
if _, exists := secretRefs[secret.Target]; exists {
|
||||||
|
return nil, fmt.Errorf("duplicate secret target for %s not allowed", secret.Source)
|
||||||
|
}
|
||||||
secretRef := &swarmtypes.SecretReference{
|
secretRef := &swarmtypes.SecretReference{
|
||||||
SecretName: secret.Source,
|
File: &swarmtypes.SecretReferenceFileTarget{
|
||||||
Target: &swarmtypes.SecretReferenceFileTarget{
|
|
||||||
Name: secret.Target,
|
Name: secret.Target,
|
||||||
UID: secret.UID,
|
UID: secret.UID,
|
||||||
GID: secret.GID,
|
GID: secret.GID,
|
||||||
Mode: secret.Mode,
|
Mode: secret.Mode,
|
||||||
},
|
},
|
||||||
|
SecretName: secret.Source,
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, exists := secretRefs[secret.Target]; exists {
|
|
||||||
return nil, fmt.Errorf("duplicate secret target for %s not allowed", secret.Source)
|
|
||||||
}
|
|
||||||
secretRefs[secret.Target] = secretRef
|
secretRefs[secret.Target] = secretRef
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue