|
@@ -288,6 +288,23 @@ func (daemon *Daemon) createSpecWindowsFields(c *container.Container, s *specs.S
|
|
|
if cs, err = readCredentialSpecRegistry(c.ID, csValue); err != nil {
|
|
|
return err
|
|
|
}
|
|
|
+ } else if match, csValue = getCredentialSpec("config://", splitsOpt[1]); match {
|
|
|
+ if csValue == "" {
|
|
|
+ return fmt.Errorf("no value supplied for config:// credential spec security option")
|
|
|
+ }
|
|
|
+
|
|
|
+ // if the container does not have a DependencyStore, then we
|
|
|
+ // return an error
|
|
|
+ if c.DependencyStore == nil {
|
|
|
+ return fmt.Errorf("cannot use config:// credential spec security option if not swarmkit managed")
|
|
|
+ }
|
|
|
+ csConfig, err := c.DependencyStore.Configs().Get(csValue)
|
|
|
+ if err != nil {
|
|
|
+ return fmt.Errorf("error getting value from config store: %v", err)
|
|
|
+ }
|
|
|
+ // stuff the resulting secret data into a string to use as the
|
|
|
+ // CredentialSpec
|
|
|
+ cs = string(csConfig.Spec.Data)
|
|
|
} else {
|
|
|
return fmt.Errorf("invalid credential spec security option - value must be prefixed file:// or registry:// followed by a value")
|
|
|
}
|