From ed6ea026a8b0cacec366da32909c991fc5df26f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BAlia=20Bir=C3=B3?= Date: Tue, 22 Sep 2020 15:29:29 +0200 Subject: [PATCH] Trim spaces in annotation list (#165) * strip whitespace * only trim spaces --- internal/pkg/handler/upgrade.go | 1 + internal/pkg/testutil/kube.go | 1 + 2 files changed, 2 insertions(+) diff --git a/internal/pkg/handler/upgrade.go b/internal/pkg/handler/upgrade.go index 51e702d8..724568e1 100644 --- a/internal/pkg/handler/upgrade.go +++ b/internal/pkg/handler/upgrade.go @@ -116,6 +116,7 @@ func PerformRollingUpgrade(clients kube.Clients, config util.Config, upgradeFunc if result != constants.Updated && annotationValue != "" { values := strings.Split(annotationValue, ",") for _, value := range values { + value = strings.Trim(value, " ") if value == config.ResourceName { result = updateContainers(upgradeFuncs, i, config, false) if result == constants.Updated { diff --git a/internal/pkg/testutil/kube.go b/internal/pkg/testutil/kube.go index 32100a64..1fb88377 100644 --- a/internal/pkg/testutil/kube.go +++ b/internal/pkg/testutil/kube.go @@ -821,6 +821,7 @@ func VerifyResourceUpdate(clients kube.Clients, config util.Config, envVarPostfi } else if annotationValue != "" { values := strings.Split(annotationValue, ",") for _, value := range values { + value = strings.Trim(value, " ") if value == config.ResourceName { matches = true break