github.com/jiasir/docker@v1.3.3-0.20170609024000-252e610103e7/daemon/secrets.go (about) 1 package daemon 2 3 import ( 4 "github.com/Sirupsen/logrus" 5 swarmtypes "github.com/docker/docker/api/types/swarm" 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 }