Merge pull request #69295 from deads2k/kbuectl-13-wait-false

allow condition value to specified for kubectl wait
pull/58/head
k8s-ci-robot 2018-10-03 21:32:12 -07:00 committed by GitHub
commit 2d1ef05ad1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 3 deletions

View File

@ -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
}