From bc542f365c3534cbf086a55bf65dadcf7f87be91 Mon Sep 17 00:00:00 2001 From: Evan Hazlett Date: Tue, 15 Nov 2016 10:04:36 -0500 Subject: [PATCH] do not force target type for secret references Signed-off-by: Evan Hazlett use secret store interface instead of embedded secret data into container Signed-off-by: Evan Hazlett --- command/service/parse.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/command/service/parse.go b/command/service/parse.go index 368bc6d449..ff3249e581 100644 --- a/command/service/parse.go +++ b/command/service/parse.go @@ -17,19 +17,19 @@ func parseSecrets(client client.APIClient, requestedSecrets []*types.SecretReque ctx := context.Background() 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{ - SecretName: secret.Source, - Target: &swarmtypes.SecretReferenceFileTarget{ + File: &swarmtypes.SecretReferenceFileTarget{ Name: secret.Target, UID: secret.UID, GID: secret.GID, 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 }