func waitForRollingUpdate(c clientset.Interface, set *appsv1.StatefulSet) (*appsv1.StatefulSet, *v1.PodList) {
	var pods *v1.PodList
	if set.Spec.UpdateStrategy.Type != appsv1.RollingUpdateStatefulSetStrategyType {
		framework.Failf("StatefulSet %s/%s attempt to wait for rolling update with updateStrategy %s",
			set.Namespace,
			set.Name,
			set.Spec.UpdateStrategy.Type)
	}
	e2estatefulset.WaitForState(c, set, func(set2 *appsv1.StatefulSet, pods2 *v1.PodList) (bool, error) {
		set = set2
		pods = pods2
		if len(pods.Items) < int(*set.Spec.Replicas) {
			return false, nil
		}
		if set.Status.UpdateRevision != set.Status.CurrentRevision {
			framework.Logf("Waiting for StatefulSet %s/%s to complete update",
				set.Namespace,
				set.Name,
			)
			e2estatefulset.SortStatefulPods(pods)
			for i := range pods.Items {
				if pods.Items[i].Labels[appsv1.StatefulSetRevisionLabel] != set.Status.UpdateRevision {
					framework.Logf("Waiting for Pod %s/%s to have revision %s update revision %s",
						pods.Items[i].Namespace,
						pods.Items[i].Name,
						set.Status.UpdateRevision,
						pods.Items[i].Labels[appsv1.StatefulSetRevisionLabel])
				}
			}
			return false, nil
		}
		return true, nil
	})
	return set, pods
}
// waitForRollingUpdate waits for all Pods in set to exist and have the correct revision and for the RollingUpdate to
// complete. set must have a RollingUpdateStatefulSetStrategyType.
waitForRollingUpdate waits for all Pods in set to exist and have the correct revision and for the RollingUpdate to
complete. set must have a RollingUpdateStatefulSetStrategyType.
// waitForRollingUpdate waits for all Pods in set to exist and have the correct revision and for the RollingUpdate to // complete . set must have a RollingUpdateStatefulSetStrategyType .
func waitForRollingUpdate(c clientset.Interface, set *appsv1.StatefulSet) (*appsv1.StatefulSet, *v1.PodList) {
	var pods *v1.PodList
	if set.Spec.UpdateStrategy.Type != appsv1.RollingUpdateStatefulSetStrategyType {
		framework.Failf("StatefulSet %s/%s attempt to wait for rolling update with updateStrategy %s",
			set.Namespace,
			set.Name,
			set.Spec.UpdateStrategy.Type)
	}
	e2estatefulset.WaitForState(c, set, func(set2 *appsv1.StatefulSet, pods2 *v1.PodList) (bool, error) {
		set = set2
		pods = pods2
		if len(pods.Items) < int(*set.Spec.Replicas) {
			return false, nil
		}
		if set.Status.UpdateRevision != set.Status.CurrentRevision {
			framework.Logf("Waiting for StatefulSet %s/%s to complete update",
				set.Namespace,
				set.Name,
			)
			e2estatefulset.SortStatefulPods(pods)
			for i := range pods.Items {
				if pods.Items[i].Labels[appsv1.StatefulSetRevisionLabel] != set.Status.UpdateRevision {
					framework.Logf("Waiting for Pod %s/%s to have revision %s update revision %s",
						pods.Items[i].Namespace,
						pods.Items[i].Name,
						set.Status.UpdateRevision,
						pods.Items[i].Labels[appsv1.StatefulSetRevisionLabel])
				}
			}
			return false, nil
		}
		return true, nil
	})
	return set, pods
}
func waitForRollingUpdate ( c clientset . Interface , set * appsv1 . StatefulSet ) ( * appsv1 . StatefulSet , * v1 . PodList ) { var pods * v1 . PodList if set . Spec . UpdateStrategy . Type != appsv1 . RollingUpdateStatefulSetStrategyType { framework . Failf ( " " , set . Namespace , set . Name , set . Spec . UpdateStrategy . Type ) } e2estatefulset . WaitForState ( c , set , func ( set2 * appsv1 . StatefulSet , pods2 * v1 . PodList ) ( bool , error ) { set = set2 pods = pods2 if len ( pods . Items ) < int ( * set . Spec . Replicas ) { return false , nil } if set . Status . UpdateRevision != set . Status . CurrentRevision { framework . Logf ( " " , set . Namespace , set . Name , ) e2estatefulset . SortStatefulPods ( pods ) for i := range pods . Items { if pods . Items [ i ] . Labels [ appsv1 . StatefulSetRevisionLabel ] != set . Status . UpdateRevision { framework . Logf ( " " , pods . Items [ i ] . Namespace , pods . Items [ i ] . Name , set . Status . UpdateRevision , pods . Items [ i ] . Labels [ appsv1 . StatefulSetRevisionLabel ] ) } } return false , nil } return true , nil } ) return set , pods }
waitForRollingUpdate waits for all Pods in set to exist and have the correct revision and for the RollingUpdate to
complete.
waitForRollingUpdate waits for all Pods in set to exist and have the correct revision and for the RollingUpdate to complete .