func ResolveMaxShardReplicasUnavailable(maxShardReplicasUnavailable *intstr.IntOrString, shard string, totalShardReplicas map[string]int, cache map[string]int) (int, error) {
	maxUnavailable, isCached := cache[shard]
	var err error
	if !isCached {
		maxUnavailable, err = intstr.GetValueFromIntOrPercent(intstr.ValueOrDefault(maxShardReplicasUnavailable, intstr.FromInt(DefaultMaxShardReplicasUnavailable)), totalShardReplicas[shard], false)
		if err != nil {
			maxUnavailable = 1
		}
	} else {
		err = nil
	}

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

	return maxUnavailable, nil
}
// ResolveMaxShardReplicasUnavailable resolves the maximum number of replicas that are allowed to be unavailable for a given shard, when choosing pods to update.
ResolveMaxShardReplicasUnavailable resolves the maximum number of replicas that are allowed to be unavailable for a given shard, when choosing pods to update.
// ResolveMaxShardReplicasUnavailable resolves the maximum number of replicas that are allowed to be unavailable for a given shard when choosing pods to update .
func ResolveMaxShardReplicasUnavailable(maxShardReplicasUnavailable *intstr.IntOrString, shard string, totalShardReplicas map[string]int, cache map[string]int) (int, error) {
	maxUnavailable, isCached := cache[shard]
	var err error
	if !isCached {
		maxUnavailable, err = intstr.GetValueFromIntOrPercent(intstr.ValueOrDefault(maxShardReplicasUnavailable, intstr.FromInt(DefaultMaxShardReplicasUnavailable)), totalShardReplicas[shard], false)
		if err != nil {
			maxUnavailable = 1
		}
	} else {
		err = nil
	}
	if maxUnavailable == 0 {
		maxUnavailable = 1
	}
	return maxUnavailable, nil
}
func ResolveMaxShardReplicasUnavailable ( maxShardReplicasUnavailable * intstr . IntOrString , shard string , totalShardReplicas map [ string ] int , cache map [ string ] int ) ( int , error ) { maxUnavailable , isCached := cache [ shard ] var err error if ! isCached { maxUnavailable , err = intstr . GetValueFromIntOrPercent ( intstr . ValueOrDefault ( maxShardReplicasUnavailable , intstr . FromInt ( DefaultMaxShardReplicasUnavailable ) ) , totalShardReplicas [ shard ] , false ) if err != nil { maxUnavailable = 1 } } else { err = nil } if maxUnavailable == 0 { maxUnavailable = 1 } return maxUnavailable , nil }
ResolveMaxShardReplicasUnavailable resolves the maximum number of replicas that are allowed to be unavailable for a given shard, when choosing pods to update.
ResolveMaxShardReplicasUnavailable resolves the maximum number of replicas that are allowed to be unavailable for a given shard when choosing pods to update .
// podsUnavailable can never be 0, otherwise pods would never be able to be upgraded.