async fn apply_spus(
        &self,
        spg_obj: &SpuGroupObj,
        spg_spec: &SpuGroupSpec,
        spg_name: &str,
    ) -> Result<(), ClientError> {
        let replicas = spg_spec.replicas;

        for i in 0..replicas {
            let spu_id = match self.compute_spu_id(spg_spec.min_id(), i) {
                Ok(id) => id,
                Err(err) => {
                    error!("{}", err);
                    continue;
                }
            };

            let spu_name = format!("{}-{}", spg_name, i);
            debug!("generating spu with name: {}", spu_name);

            if let Err(err) = self
                .apply_spu_load_balancers(spg_obj, spg_spec, &spu_name)
                .await
            {
                error!("error trying to create load balancer for spu: {}", err);
            }

            self.apply_spu(spg_obj, spg_spec, spg_name, &spu_name, i, spu_id)
                .await;
        }

        Ok(())
    }
/// create SPU crd objects from cluster spec
create SPU crd objects from cluster spec
create SPU crd objects from cluster spec
async fn apply_spus(
        &self,
        spg_obj: &SpuGroupObj,
        spg_spec: &SpuGroupSpec,
        spg_name: &str,
    ) -> Result<(), ClientError> {
        let replicas = spg_spec.replicas;
        for i in 0..replicas {
            let spu_id = match self.compute_spu_id(spg_spec.min_id(), i) {
                Ok(id) => id,
                Err(err) => {
                    error!("{}", err);
                    continue;
                }
            };
            let spu_name = format!("{}-{}", spg_name, i);
            debug!("generating spu with name: {}", spu_name);
            if let Err(err) = self
                .apply_spu_load_balancers(spg_obj, spg_spec, &spu_name)
                .await
            {
                error!("error trying to create load balancer for spu: {}", err);
            }
            self.apply_spu(spg_obj, spg_spec, spg_name, &spu_name, i, spu_id)
                .await;
        }
        Ok(())
    }
async fn apply_spus ( & self , spg_obj : & SpuGroupObj , spg_spec : & SpuGroupSpec , spg_name : & str , ) -> Result < ( ) , ClientError > { let replicas = spg_spec . replicas ; for i in 0 .. replicas { let spu_id = match self . compute_spu_id ( spg_spec . min_id ( ) , i ) { Ok ( id ) => id , Err ( err ) => { error ! ( " " err ) ; continue ; } } ; let spu_name = format ! ( " " spg_name i ) ; debug ! ( " " spu_name ) ; if let Err ( err ) = self . apply_spu_load_balancers ( spg_obj , spg_spec , & spu_name ) . await { error ! ( " " err ) ; } self . apply_spu ( spg_obj , spg_spec , spg_name , & spu_name , i , spu_id ) . await ; } Ok ( ( ) ) }
create SPU crd objects from cluster spec
create SPU crd objects from cluster spec
&self
spg_obj
&SpuGroupObj
spg_spec
&SpuGroupSpec
spg_name
&str
&self
spg_obj
&SpuGroupObj
spg_spec
&SpuGroupSpec
spg_name
&str