mirror of https://github.com/k3s-io/k3s
Merge pull request #69295 from deads2k/kbuectl-13-wait-false
allow condition value to specified for kubectl waitpull/58/head
commit
2d1ef05ad1
|
@ -174,10 +174,15 @@ func conditionFuncFor(condition string) (ConditionFunc, error) {
|
||||||
}
|
}
|
||||||
if strings.HasPrefix(condition, "condition=") {
|
if strings.HasPrefix(condition, "condition=") {
|
||||||
conditionName := condition[len("condition="):]
|
conditionName := condition[len("condition="):]
|
||||||
|
conditionValue := "true"
|
||||||
|
if equalsIndex := strings.Index(conditionName, "="); equalsIndex != -1 {
|
||||||
|
conditionValue = conditionName[equalsIndex+1:]
|
||||||
|
conditionName = conditionName[0:equalsIndex]
|
||||||
|
}
|
||||||
|
|
||||||
return ConditionalWait{
|
return ConditionalWait{
|
||||||
conditionName: conditionName,
|
conditionName: conditionName,
|
||||||
// TODO allow specifying a false
|
conditionStatus: conditionValue,
|
||||||
conditionStatus: "true",
|
|
||||||
}.IsConditionMet, nil
|
}.IsConditionMet, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue