2018-02-05 16:05:59 -05:00
|
|
|
package daemon // import "github.com/docker/docker/daemon"
|
2017-03-16 17:23:33 -04:00
|
|
|
|
|
|
|
import (
|
|
|
|
swarmtypes "github.com/docker/docker/api/types/swarm"
|
2017-07-26 17:42:13 -04:00
|
|
|
"github.com/sirupsen/logrus"
|
2017-03-16 17:23:33 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
// SetContainerConfigReferences sets the container config references needed
|
|
|
|
func (daemon *Daemon) SetContainerConfigReferences(name string, refs []*swarmtypes.ConfigReference) error {
|
|
|
|
if !configsSupported() && len(refs) > 0 {
|
|
|
|
logrus.Warn("configs are not supported on this platform")
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
c, err := daemon.GetContainer(name)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2018-01-17 10:49:58 -05:00
|
|
|
c.ConfigReferences = append(c.ConfigReferences, refs...)
|
2017-03-16 17:23:33 -04:00
|
|
|
return nil
|
|
|
|
}
|