func ResolveMaxPodsUnavailable(maxPodsUnavailable *intstr.IntOrString, desiredPods int) (int, error) {
	if maxPodsUnavailable != nil && maxPodsUnavailable.Type == intstr.Int && maxPodsUnavailable.IntVal <= int32(0) {
		return desiredPods, nil
	}
	podsUnavailable, err := intstr.GetValueFromIntOrPercent(intstr.ValueOrDefault(maxPodsUnavailable, intstr.FromString(DefaultMaxPodsUnavailable)), desiredPods, false)
	if err != nil {
		return 1, err
	}

	if podsUnavailable == 0 {
		// podsUnavailable can never be 0, otherwise pods would never be able to be upgraded.
		podsUnavailable = 1
	}

	return podsUnavailable, nil
}
// ResolveMaxPodsUnavailable resolves the maximum number of pods that are allowed to be unavailable, when choosing pods to update.
ResolveMaxPodsUnavailable resolves the maximum number of pods that are allowed to be unavailable, when choosing pods to update.
// ResolveMaxPodsUnavailable resolves the maximum number of pods that are allowed to be unavailable when choosing pods to update .
func ResolveMaxPodsUnavailable(maxPodsUnavailable *intstr.IntOrString, desiredPods int) (int, error) {
	if maxPodsUnavailable != nil && maxPodsUnavailable.Type == intstr.Int && maxPodsUnavailable.IntVal <= int32(0) {
		return desiredPods, nil
	}
	podsUnavailable, err := intstr.GetValueFromIntOrPercent(intstr.ValueOrDefault(maxPodsUnavailable, intstr.FromString(DefaultMaxPodsUnavailable)), desiredPods, false)
	if err != nil {
		return 1, err
	}
	if podsUnavailable == 0 {
		podsUnavailable = 1
	}
	return podsUnavailable, nil
}
func ResolveMaxPodsUnavailable ( maxPodsUnavailable * intstr . IntOrString , desiredPods int ) ( int , error ) { if maxPodsUnavailable != nil && maxPodsUnavailable . Type == intstr . Int && maxPodsUnavailable . IntVal <= int32 ( 0 ) { return desiredPods , nil } podsUnavailable , err := intstr . GetValueFromIntOrPercent ( intstr . ValueOrDefault ( maxPodsUnavailable , intstr . FromString ( DefaultMaxPodsUnavailable ) ) , desiredPods , false ) if err != nil { return 1 , err } if podsUnavailable == 0 { podsUnavailable = 1 } return podsUnavailable , nil }
ResolveMaxPodsUnavailable resolves the maximum number of pods that are allowed to be unavailable, when choosing pods to update.
ResolveMaxPodsUnavailable resolves the maximum number of pods that are allowed to be unavailable when choosing pods to update .
// podsUnavailable can never be 0, otherwise pods would never be able to be upgraded.