github.com/rhatdan/docker@v0.7.7-0.20180119204836-47a0dcbcd20a/daemon/secrets.go (about) 1 package daemon 2 3 import ( 4 swarmtypes "github.com/docker/docker/api/types/swarm" 5 "github.com/sirupsen/logrus" 6 ) 7 8 // SetContainerSecretReferences sets the container secret references needed 9 func (daemon *Daemon) SetContainerSecretReferences(name string, refs []*swarmtypes.SecretReference) error { 10 if !secretsSupported() && len(refs) > 0 { 11 logrus.Warn("secrets are not supported on this platform") 12 return nil 13 } 14 15 c, err := daemon.GetContainer(name) 16 if err != nil { 17 return err 18 } 19 20 c.SecretReferences = refs 21 22 return nil 23 }