async fn sync_spus(
        &mut self,
        listener: &mut K8ChangeListener<SpuSpec>,
    ) -> Result<(), ClientError> {
        if !listener.has_change() {
            trace!("no spu change, skipping");
            return Ok(());
        }

        // only care about spec changes
        let changes = listener.sync_spec_changes().await;
        let epoch = changes.epoch;
        let (updates, deletes) = changes.parts();

        debug!(
            "received spu changes updates: {}, deletes: {}, epoch: {}",
            updates.len(),
            deletes.len(),
            epoch,
        );

        for spu_md in updates.into_iter() {
            let spu_id = spu_md.key();
            let spu_meta = spu_md.ctx().item().inner();
            let svc_name = SpuServiceSpec::service_name(&spu_meta.name);
            if let Some(svc) = self.services.store().value(&svc_name).await {
                self.apply_ingress_from_svc(spu_md, svc.inner_owned())
                    .await?;
            } else {
                debug!("no svc exists for spu {}, skipping", spu_id);
            }
        }

        Ok(())
    }
/// spu has been changed, update service
spu has been changed, update service
spu has been changed update service
async fn sync_spus(
        &mut self,
        listener: &mut K8ChangeListener<SpuSpec>,
    ) -> Result<(), ClientError> {
        if !listener.has_change() {
            trace!("no spu change, skipping");
            return Ok(());
        }
        // only care about spec changes
        let changes = listener.sync_spec_changes().await;
        let epoch = changes.epoch;
        let (updates, deletes) = changes.parts();
        debug!(
            "received spu changes updates: {}, deletes: {}, epoch: {}",
            updates.len(),
            deletes.len(),
            epoch,
        );
        for spu_md in updates.into_iter() {
            let spu_id = spu_md.key();
            let spu_meta = spu_md.ctx().item().inner();
            let svc_name = SpuServiceSpec::service_name(&spu_meta.name);
            if let Some(svc) = self.services.store().value(&svc_name).await {
                self.apply_ingress_from_svc(spu_md, svc.inner_owned())
                    .await?;
            } else {
                debug!("no svc exists for spu {}, skipping", spu_id);
            }
        }
        Ok(())
    }
async fn sync_spus ( & mut self , listener : & mut K8ChangeListener < SpuSpec > , ) -> Result < ( ) , ClientError > { if ! listener . has_change ( ) { trace ! ( " " ) ; return Ok ( ( ) ) ; } // only care about spec changes let changes = listener . sync_spec_changes ( ) . await ; let epoch = changes . epoch ; let ( updates , deletes ) = changes . parts ( ) ; debug ! ( " " updates len ( ) deletes len ( ) epoch ) ; for spu_md in updates . into_iter ( ) { let spu_id = spu_md . key ( ) ; let spu_meta = spu_md . ctx ( ) . item ( ) . inner ( ) ; let svc_name = SpuServiceSpec :: service_name ( & spu_meta . name ) ; if let Some ( svc ) = self . services . store ( ) . value ( & svc_name ) . await { self . apply_ingress_from_svc ( spu_md , svc . inner_owned ( ) ) . await ? ; } else { debug ! ( " " spu_id ) ; } } Ok ( ( ) ) }
spu has been changed, update service
spu has been changed update service
&mut self
listener
&mut K8ChangeListener<SpuSpec>
&mut self
listener
&mut K8ChangeListener<SpuSpec>