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:
Evan Hazlett 2016-11-15 10:04:36 -05:00
parent 4488d9f9fb
commit bc542f365c
1 changed files with 5 additions and 5 deletions

View File

@ -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
} }