/// Apply service for statefulsets/group
/// returns name of the statefulset svc
Apply service for statefulsets/group
returns name of the statefulset svc
Apply service for statefulsets / group returns name of the statefulset svc
async fn apply_statefulset_service(
        &self,
        spg_obj: &SpuGroupObj,
        spg_spec: &SpuGroupSpec,
        spg_name: &str,
    ) -> Result<String, ClientError> {
        let service_name = spg_name.to_owned();
        let service_spec = generate_service(spg_spec, spg_name);
        let metadata = &spg_obj.metadata;
        let owner_ref = metadata.make_owner_reference::<ServiceSpec>();
        let mut labels = HashMap::new();
        labels.insert("app".to_owned(), SPU_DEFAULT_NAME.to_owned());
        labels.insert("group".to_owned(), spg_name.to_owned());
        let svc_name = format!("flv-spg-{}", spg_name);
        let input_service: InputK8Obj<ServiceSpec> = InputK8Obj {
            api_version: ServiceSpec::api_version(),
            kind: ServiceSpec::kind(),
            metadata: InputObjectMeta {
                name: svc_name.clone(),
                namespace: metadata.namespace().to_string(),
                labels,
                owner_references: vec![owner_ref],
                ..Default::default()
            },
            spec: service_spec,
            ..Default::default()
        };
        debug!(
            "spg '{}': apply service '{}' changes",
            spg_name, service_name,
        );
        self.client.apply(input_service).await?;
        Ok(svc_name)
    }
async fn apply_statefulset_service ( & self , spg_obj : & SpuGroupObj , spg_spec : & SpuGroupSpec , spg_name : & str , ) -> Result < String , ClientError > { let service_name = spg_name . to_owned ( ) ; let service_spec = generate_service ( spg_spec , spg_name ) ; let metadata = & spg_obj . metadata ; let owner_ref = metadata . make_owner_reference :: < ServiceSpec > ( ) ; let mut labels = HashMap :: new ( ) ; labels . insert ( " " . to_owned ( ) , SPU_DEFAULT_NAME . to_owned ( ) ) ; labels . insert ( " " . to_owned ( ) , spg_name . to_owned ( ) ) ; let svc_name = format ! ( " " spg_name ) ; let input_service : InputK8Obj < ServiceSpec > = InputK8Obj { api_version : ServiceSpec :: api_version ( ) , kind : ServiceSpec :: kind ( ) , metadata : InputObjectMeta { name : svc_name . clone ( ) , namespace : metadata . namespace ( ) . to_string ( ) , labels , owner_references : vec ! [ owner_ref ] , .. Default :: default ( ) } , spec : service_spec , .. Default :: default ( ) } ; debug ! ( " " spg_name service_name ) ; self . client . apply ( input_service ) . await ? ; Ok ( svc_name ) }
Apply service for statefulsets/group
returns name of the statefulset svc
Apply service for statefulsets / group returns name of the statefulset svc
&self
spg_obj
&SpuGroupObj
spg_spec
&SpuGroupSpec
spg_name
&str