Don't error if the dockerconfig isn't present

This commit is contained in:
Blake 2017-08-01 16:51:20 -07:00
parent 4f95fe473f
commit e093702fc3
1 changed files with 10 additions and 12 deletions

View File

@ -60,19 +60,17 @@ func (b *SecretBuilder) Build(c *fi.ModelBuilderContext) error {
if b.SecretStore != nil { if b.SecretStore != nil {
key := "dockerconfig" key := "dockerconfig"
dockercfg, err := b.SecretStore.Secret(key) dockercfg, _ := b.SecretStore.Secret(key)
if err != nil { if dockercfg != nil {
return err contents := string(dockercfg.Data)
t := &nodetasks.File{
Path: filepath.Join("root", ".docker", "config.json"),
Contents: fi.NewStringResource(contents),
Type: nodetasks.FileType_File,
Mode: s("0600"),
}
c.AddTask(t)
} }
contents := string(dockercfg.Data)
t := &nodetasks.File{
Path: filepath.Join("root", ".docker", "config.json"),
Contents: fi.NewStringResource(contents),
Type: nodetasks.FileType_File,
Mode: s("0600"),
}
c.AddTask(t)
} }
// if we are not a master we can stop here // if we are not a master we can stop here