diff --git a/pkg/controller/disruption/disruption.go b/pkg/controller/disruption/disruption.go index 8b80a9bcc69..5d81fbf28ba 100644 --- a/pkg/controller/disruption/disruption.go +++ b/pkg/controller/disruption/disruption.go @@ -462,6 +462,10 @@ func (dc *DisruptionController) trySync(pdb *policy.PodDisruptionBudget) error { func (dc *DisruptionController) getExpectedPodCount(pdb *policy.PodDisruptionBudget, pods []*api.Pod) (expectedCount, desiredHealthy int32, err error) { err = nil + // TODO(davidopp): consider making the way expectedCount and rules about + // permitted controller configurations (specifically, considering it an error + // if a pod covered by a PDB has 0 controllers or > 1 controller) should be + // handled the same way for integer and percentage minAvailable if pdb.Spec.MinAvailable.Type == intstr.Int { desiredHealthy = pdb.Spec.MinAvailable.IntVal expectedCount = int32(len(pods))