github.com/mforkel/docker-ce-i386@v17.12.1-ce-rc2+incompatible/components/engine/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  }