From 07d386f255dc726e9e9f88fabf138ddc4c34eab1 Mon Sep 17 00:00:00 2001 From: Maciej Szulik Date: Mon, 12 Aug 2024 16:30:20 +0200 Subject: [PATCH] wait: don't lowercase condition in --for argument Kubernetes-commit: fad6c424ac9b69229e02f9d9058c8131005f86e2 --- pkg/cmd/wait/wait.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/cmd/wait/wait.go b/pkg/cmd/wait/wait.go index efbe2957e..a247ebb0e 100644 --- a/pkg/cmd/wait/wait.go +++ b/pkg/cmd/wait/wait.go @@ -195,8 +195,8 @@ func conditionFuncFor(condition string, errOut io.Writer) (ConditionFunc, error) case lowercaseCond == "create": return IsCreated, nil - case strings.HasPrefix(lowercaseCond, "condition="): - conditionName := lowercaseCond[len("condition="):] + case strings.HasPrefix(condition, "condition="): + conditionName := strings.TrimPrefix(condition, "condition=") conditionValue := "true" if equalsIndex := strings.Index(conditionName, "="); equalsIndex != -1 { conditionValue = conditionName[equalsIndex+1:] @@ -209,8 +209,8 @@ func conditionFuncFor(condition string, errOut io.Writer) (ConditionFunc, error) errOut: errOut, }.IsConditionMet, nil - case strings.HasPrefix(lowercaseCond, "jsonpath="): - jsonPathInput := strings.TrimPrefix(lowercaseCond, "jsonpath=") + case strings.HasPrefix(condition, "jsonpath="): + jsonPathInput := strings.TrimPrefix(condition, "jsonpath=") jsonPathExp, jsonPathValue, err := processJSONPathInput(jsonPathInput) if err != nil { return nil, err