code: func MaxUnavailable(deployment apps.Deployment) int32 {
  	if !IsRollingUpdate(&deployment) || *(deployment.Spec.Replicas) == 0 {
  		return int32(0)
  	}
  	// Error caught by validation
  	_, maxUnavailable, _ := ResolveFenceposts(deployment.Spec.Strategy.RollingUpdate.MaxSurge, deployment.Spec.Strategy.RollingUpdate.MaxUnavailable, *(deployment.Spec.Replicas))
  	if maxUnavailable > *deployment.Spec.Replicas {
  		return *deployment.Spec.Replicas
  	}
  	return maxUnavailable
  }
docs: // MaxUnavailable returns the maximum unavailable pods a rolling deployment can take.