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