2016-10-19 12:22:02 -04:00
|
|
|
package daemon
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/Sirupsen/logrus"
|
|
|
|
containertypes "github.com/docker/docker/api/types/container"
|
|
|
|
)
|
|
|
|
|
2016-10-26 16:30:53 -04:00
|
|
|
// SetContainerSecrets sets the container secrets needed
|
2016-10-19 12:22:02 -04:00
|
|
|
func (daemon *Daemon) SetContainerSecrets(name string, secrets []*containertypes.ContainerSecret) error {
|
2016-10-26 16:30:53 -04:00
|
|
|
if !secretsSupported() && len(secrets) > 0 {
|
2016-10-19 12:22:02 -04:00
|
|
|
logrus.Warn("secrets are not supported on this platform")
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
c, err := daemon.GetContainer(name)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
c.Secrets = secrets
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|