mirror of https://github.com/k3s-io/k3s
allow condition value to specified for kubectl wait
parent
e567c791aa
commit
122529b97d
|
@ -174,10 +174,15 @@ func conditionFuncFor(condition string) (ConditionFunc, error) {
|
|||
}
|
||||
if strings.HasPrefix(condition, "condition=") {
|
||||
conditionName := condition[len("condition="):]
|
||||
conditionValue := "true"
|
||||
if equalsIndex := strings.Index(conditionName, "="); equalsIndex != -1 {
|
||||
conditionValue = conditionName[equalsIndex+1:]
|
||||
conditionName = conditionName[0:equalsIndex]
|
||||
}
|
||||
|
||||
return ConditionalWait{
|
||||
conditionName: conditionName,
|
||||
// TODO allow specifying a false
|
||||
conditionStatus: "true",
|
||||
conditionName: conditionName,
|
||||
conditionStatus: conditionValue,
|
||||
}.IsConditionMet, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue