func (j *TestJig) newPDBTemplate(rc *v1.ReplicationController) *policyv1beta1.PodDisruptionBudget {
	minAvailable := intstr.FromInt(int(*rc.Spec.Replicas) - 1)

	pdb := &policyv1beta1.PodDisruptionBudget{
		ObjectMeta: metav1.ObjectMeta{
			Namespace: j.Namespace,
			Name:      j.Name,
			Labels:    j.Labels,
		},
		Spec: policyv1beta1.PodDisruptionBudgetSpec{
			MinAvailable: &minAvailable,
			Selector:     &metav1.LabelSelector{MatchLabels: j.Labels},
		},
	}

	return pdb
}
// newPDBTemplate returns the default policyv1beta1.PodDisruptionBudget object for
// this j, but does not actually create the PDB.  The default PDB specifies a
// MinAvailable of N-1 and matches the pods created by the RC.
newPDBTemplate returns the default policyv1beta1.PodDisruptionBudget object for
this j, but does not actually create the PDB.  The default PDB specifies a
MinAvailable of N-1 and matches the pods created by the RC.
// newPDBTemplate returns the default policyv1beta1 . PodDisruptionBudget object for // this j but does not actually create the PDB . The default PDB specifies a // MinAvailable of N - 1 and matches the pods created by the RC .
func (j *TestJig) newPDBTemplate(rc *v1.ReplicationController) *policyv1beta1.PodDisruptionBudget {
	minAvailable := intstr.FromInt(int(*rc.Spec.Replicas) - 1)
	pdb := &policyv1beta1.PodDisruptionBudget{
		ObjectMeta: metav1.ObjectMeta{
			Namespace: j.Namespace,
			Name:      j.Name,
			Labels:    j.Labels,
		},
		Spec: policyv1beta1.PodDisruptionBudgetSpec{
			MinAvailable: &minAvailable,
			Selector:     &metav1.LabelSelector{MatchLabels: j.Labels},
		},
	}
	return pdb
}
func ( j * TestJig ) newPDBTemplate ( rc * v1 . ReplicationController ) * policyv1beta1 . PodDisruptionBudget { minAvailable := intstr . FromInt ( int ( * rc . Spec . Replicas ) - 1 ) pdb := & policyv1beta1 . PodDisruptionBudget { ObjectMeta : metav1 . ObjectMeta { Namespace : j . Namespace , Name : j . Name , Labels : j . Labels , } , Spec : policyv1beta1 . PodDisruptionBudgetSpec { MinAvailable : & minAvailable , Selector : & metav1 . LabelSelector { MatchLabels : j . Labels } , } , } return pdb }
newPDBTemplate returns the default policyv1beta1.PodDisruptionBudget object for
this j, but does not actually create the PDB.
newPDBTemplate returns the default policyv1beta1 . PodDisruptionBudget object for this j but does not actually create the PDB .