Fix references to PetSet

This commit is contained in:
foxish
2017-02-13 11:51:26 -08:00
parent dcbcee8365
commit 205c68351d
3 changed files with 17 additions and 17 deletions

View File

@@ -78,15 +78,15 @@ func ReplicaSetHasDesiredReplicas(rsClient extensionsclient.ReplicaSetsGetter, r
}
}
// StatefulSetHasDesiredPets returns a conditon that checks the number of petset replicas
func StatefulSetHasDesiredPets(psClient appsclient.StatefulSetsGetter, petset *apps.StatefulSet) wait.ConditionFunc {
// TODO: Differentiate between 0 pets and a really quick scale down using generation.
// StatefulSetHasDesiredReplicas returns a conditon that checks the number of statefulset replicas
func StatefulSetHasDesiredReplicas(ssClient appsclient.StatefulSetsGetter, ss *apps.StatefulSet) wait.ConditionFunc {
// TODO: Differentiate between 0 statefulset pods and a really quick scale down using generation.
return func() (bool, error) {
ps, err := psClient.StatefulSets(petset.Namespace).Get(petset.Name, metav1.GetOptions{})
ss, err := ssClient.StatefulSets(ss.Namespace).Get(ss.Name, metav1.GetOptions{})
if err != nil {
return false, err
}
return ps.Status.Replicas == ps.Spec.Replicas, nil
return ss.Status.Replicas == ss.Spec.Replicas, nil
}
}