handle non-generated client removal

This commit is contained in:
deads2k
2016-10-24 10:58:05 -04:00
parent 969e945a9e
commit 81ae13084d
15 changed files with 185 additions and 447 deletions

View File

@@ -77,6 +77,7 @@ func ReplicaSetHasDesiredReplicas(rsClient extensionsclient.ReplicaSetsGetter, r
}
}
// PetSetHasDesiredPets returns a conditon that checks the number of petset replicas
func PetSetHasDesiredPets(psClient appsclient.PetSetsGetter, petset *apps.PetSet) wait.ConditionFunc {
// TODO: Differentiate between 0 pets and a really quick scale down using generation.
return func() (bool, error) {
@@ -104,11 +105,11 @@ func JobHasDesiredParallelism(jobClient batchclient.JobsGetter, job *batch.Job)
if job.Spec.Completions == nil {
// A job without specified completions needs to wait for Active to reach Parallelism.
return false, nil
} else {
// otherwise count successful
progress := *job.Spec.Completions - job.Status.Active - job.Status.Succeeded
return progress == 0, nil
}
// otherwise count successful
progress := *job.Spec.Completions - job.Status.Active - job.Status.Succeeded
return progress == 0, nil
}
}