/// svc has been changed, update spu
svc has been changed, update spu
svc has been changed update spu
async fn sync_from_spu_services(
        &mut self,
        listener: &mut K8ChangeListener<SpuServiceSpec>,
    ) -> Result<(), ClientError> {
        if !listener.has_change() {
            trace!("no service change, skipping");
            return Ok(());
        }
        let changes = listener.sync_changes().await;
        let epoch = changes.epoch;
        let (updates, deletes) = changes.parts();
        debug!(
            "received spu service changes updates: {}, deletes: {}, epoch: {}",
            updates.len(),
            deletes.len(),
            epoch,
        );
        for svc_md in updates.into_iter() {
            let svc_id = svc_md.key();
            let svc_meta = svc_md.ctx().item().inner();
            if let Some(spu_name) = SpuServiceSpec::spu_name(&svc_meta) {
                if let Some(spu) = self.spus.store().value(spu_name).await {
                    self.apply_ingress_from_svc(spu.inner_owned(), svc_md)
                        .await?;
                } else {
                    debug!("no spu exists for svc {}, skipping", svc_id);
                }
            } else {
                error!(
                    svc = %svc_id,
                    "spu service doesnt have spu name",
                );
            }
        }
        Ok(())
    }
async fn sync_from_spu_services ( & mut self , listener : & mut K8ChangeListener < SpuServiceSpec > , ) -> Result < ( ) , ClientError > { if ! listener . has_change ( ) { trace ! ( " " ) ; return Ok ( ( ) ) ; } let changes = listener . sync_changes ( ) . await ; let epoch = changes . epoch ; let ( updates , deletes ) = changes . parts ( ) ; debug ! ( " " updates len ( ) deletes len ( ) epoch ) ; for svc_md in updates . into_iter ( ) { let svc_id = svc_md . key ( ) ; let svc_meta = svc_md . ctx ( ) . item ( ) . inner ( ) ; if let Some ( spu_name ) = SpuServiceSpec :: spu_name ( & svc_meta ) { if let Some ( spu ) = self . spus . store ( ) . value ( spu_name ) . await { self . apply_ingress_from_svc ( spu . inner_owned ( ) , svc_md ) . await ? ; } else { debug ! ( " " svc_id ) ; } } else { error ! ( svc svc_id " " ) ; } } Ok ( ( ) ) }
svc has been changed, update spu
svc has been changed update spu
&mut self
listener
&mut K8ChangeListener<SpuServiceSpec>