diff --git a/api/types/swarm/secret.go b/api/types/swarm/secret.go index d82534d0bc..72e93c9d26 100644 --- a/api/types/swarm/secret.go +++ b/api/types/swarm/secret.go @@ -11,11 +11,13 @@ type Secret struct { SecretSize int64 } +// SecretSpec represents a secret specification from a secret in swarm type SecretSpec struct { Annotations Data []byte } +// SecretReferenceFileTarget is a file target in a secret reference type SecretReferenceFileTarget struct { Name string UID string @@ -23,6 +25,7 @@ type SecretReferenceFileTarget struct { Mode os.FileMode } +// SecretReference is a reference to a secret in swarm type SecretReference struct { SecretID string SecretName string diff --git a/daemon/cluster/executor/container/adapter.go b/daemon/cluster/executor/container/adapter.go index 87ddaac455..98ea358100 100644 --- a/daemon/cluster/executor/container/adapter.go +++ b/daemon/cluster/executor/container/adapter.go @@ -223,7 +223,7 @@ func (c *containerAdapter) create(ctx context.Context) error { return fmt.Errorf("unable to get container from task spec") } secrets := make([]*containertypes.ContainerSecret, 0, len(container.Secrets)) - for _, s := range c.container.task.Spec.GetContainer().Secrets { + for _, s := range container.Secrets { sec := c.secrets.Get(s.SecretID) if sec == nil { logrus.Warnf("unable to get secret %s from provider", s.SecretID)