Skip to content

Commit

Permalink
wait: don't lowercase condition in --for argument
Browse files Browse the repository at this point in the history
Kubernetes-commit: fad6c424ac9b69229e02f9d9058c8131005f86e2
  • Loading branch information
soltysh authored and k8s-publishing-bot committed Aug 12, 2024
1 parent 8fc44bc commit 07d386f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/cmd/wait/wait.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:]
Expand All @@ -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
Expand Down

0 comments on commit 07d386f

Please sign in to comment.