From 18c44e082945b17984b49873ac0578c300b54709 Mon Sep 17 00:00:00 2001 From: Silvin Lubecki Date: Wed, 3 Jan 2018 15:46:19 +0100 Subject: [PATCH] Check and return error while creating kubernetes secret and config maps. Signed-off-by: Silvin Lubecki --- cli/command/stack/kubernetes/conversion.go | 1 - cli/command/stack/kubernetes/deploy.go | 10 ++++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/cli/command/stack/kubernetes/conversion.go b/cli/command/stack/kubernetes/conversion.go index a62d28a34c..cd2df51cab 100644 --- a/cli/command/stack/kubernetes/conversion.go +++ b/cli/command/stack/kubernetes/conversion.go @@ -37,7 +37,6 @@ func podToTask(pod apiv1.Pod) swarm.Task { }, } - pod.GetLabels() return task } diff --git a/cli/command/stack/kubernetes/deploy.go b/cli/command/stack/kubernetes/deploy.go index b269445b97..ff9c55ca2b 100644 --- a/cli/command/stack/kubernetes/deploy.go +++ b/cli/command/stack/kubernetes/deploy.go @@ -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