fn to_replicas_ceil(&self, replicas: u32) -> u32 {
        match self {
            AvailabilityPolicy::Percentage(percstr) => {
                let digits = percstr.chars().take_while(|ch| *ch != '%').collect::<String>();
                let surgeperc: u32 = digits.parse().unwrap(); // safe due to verify ^
                ((f64::from(replicas) * f64::from(surgeperc)) / 100.0).ceil() as u32
            }
            AvailabilityPolicy::Unsigned(u) => *u,
        }
    }
/// Figure out how many the availability policy refers to
///
/// This multiplies the policy with num replicas and rounds up (for maxSurge)
Figure out how many the availability policy refers to
This multiplies the policy with num replicas and rounds up (for maxSurge)
Figure out how many the availability policy refers to This multiplies the policy with num replicas and rounds up ( for maxSurge )
fn to_replicas_ceil(&self, replicas: u32) -> u32 {
        match self {
            AvailabilityPolicy::Percentage(percstr) => {
                let digits = percstr.chars().take_while(|ch| *ch != '%').collect::<String>();
                let surgeperc: u32 = digits.parse().unwrap(); // safe due to verify ^
                ((f64::from(replicas) * f64::from(surgeperc)) / 100.0).ceil() as u32
            }
            AvailabilityPolicy::Unsigned(u) => *u,
        }
    }
fn to_replicas_ceil ( & self , replicas : u32 ) -> u32 { match self { AvailabilityPolicy :: Percentage ( percstr ) => { let digits = percstr . chars ( ) . take_while ( | ch | * ch != '%' ) . collect :: < String > ( ) ; let surgeperc : u32 = digits . parse ( ) . unwrap ( ) ; // safe due to verify ^ ( ( f64 :: from ( replicas ) * f64 :: from ( surgeperc ) ) / 100.0 ) . ceil ( ) as u32 } AvailabilityPolicy :: Unsigned ( u ) => * u , } }
Figure out how many the availability policy refers to
This multiplies the policy with num replicas and rounds up (for maxSurge)
Figure out how many the availability policy refers to This multiplies the policy with num replicas and rounds up ( for maxSurge )
&self
replicas
u32
&self
replicas
u32