Check and return error while creating kubernetes secret and config maps.

Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
This commit is contained in:
Silvin Lubecki 2018-01-03 15:46:19 +01:00
parent f1b116179f
commit 18c44e0829
2 changed files with 6 additions and 5 deletions

View File

@ -37,7 +37,6 @@ func podToTask(pod apiv1.Pod) swarm.Task {
},
}
pod.GetLabels()
return task
}

View File

@ -94,8 +94,9 @@ func createFileBasedConfigMaps(stackName string, globalConfigs map[string]compos
return err
}
configMap := toConfigMap(stackName, name, fileName, content)
configMaps.Create(configMap)
if _, err := configMaps.Create(toConfigMap(stackName, name, fileName, content)); err != nil {
return err
}
}
return nil
@ -124,8 +125,9 @@ func createFileBasedSecrets(stackName string, globalSecrets map[string]composeTy
return err
}
secret := toSecret(stackName, name, fileName, content)
secrets.Create(secret)
if _, err := secrets.Create(toSecret(stackName, name, fileName, content)); err != nil {
return err
}
}
return nil