From 2cb7b93bce48bfe05b60478229a4a155eb7bf642 Mon Sep 17 00:00:00 2001 From: Simon Meng Date: Thu, 4 Mar 2021 21:19:00 +1300 Subject: [PATCH] fix(k8s): CE-471 avoid to remove value path of env when patch k8s deployment, as the value path does not exist if env variable has empty value. --- app/kubernetes/helpers/application/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/kubernetes/helpers/application/index.js b/app/kubernetes/helpers/application/index.js index 07f741f1b..239e5ceee 100644 --- a/app/kubernetes/helpers/application/index.js +++ b/app/kubernetes/helpers/application/index.js @@ -115,7 +115,11 @@ class KubernetesApplicationHelper { const env = _.map(envVariables, (item) => { const res = new KubernetesApplicationEnvPayload(); res.name = item.Name; - res.value = item.Value; + if (item.Value === undefined) { + delete res.value; + } else { + res.value = item.Value; + } return res; }); return env;