pub fn generate_service(_spg: &SpuGroupSpec, group_name: &str) -> ServiceSpec {
        let mut public_port = ServicePort {
            port: SPU_PUBLIC_PORT,
            ..Default::default()
        };

        public_port.name = Some("public".to_owned());
        let mut private_port = ServicePort {
            port: SPU_PRIVATE_PORT,
            ..Default::default()
        };
        private_port.name = Some("private".to_owned());

        let mut selector = HashMap::new();
        selector.insert("app".to_owned(), SPU_DEFAULT_NAME.to_owned());
        selector.insert("group".to_owned(), group_name.to_owned());

        ServiceSpec {
            cluster_ip: "None".to_owned(),
            ports: vec![public_port, private_port],
            selector: Some(selector),
            ..Default::default()
        }
    }
/// generate headless service from SPG spec
/// for now, we forgo port and env variable because it wasn't mapped from K8
generate headless service from SPG spec
for now, we forgo port and env variable because it wasn't mapped from K8
generate headless service from SPG spec for now we forgo port and env variable because it wasn ' t mapped from K8
pub fn generate_service(_spg: &SpuGroupSpec, group_name: &str) -> ServiceSpec {
        let mut public_port = ServicePort {
            port: SPU_PUBLIC_PORT,
            ..Default::default()
        };
        public_port.name = Some("public".to_owned());
        let mut private_port = ServicePort {
            port: SPU_PRIVATE_PORT,
            ..Default::default()
        };
        private_port.name = Some("private".to_owned());
        let mut selector = HashMap::new();
        selector.insert("app".to_owned(), SPU_DEFAULT_NAME.to_owned());
        selector.insert("group".to_owned(), group_name.to_owned());
        ServiceSpec {
            cluster_ip: "None".to_owned(),
            ports: vec![public_port, private_port],
            selector: Some(selector),
            ..Default::default()
        }
    }
pub fn generate_service ( _spg : & SpuGroupSpec , group_name : & str ) -> ServiceSpec { let mut public_port = ServicePort { port : SPU_PUBLIC_PORT , .. Default :: default ( ) } ; public_port . name = Some ( " " . to_owned ( ) ) ; let mut private_port = ServicePort { port : SPU_PRIVATE_PORT , .. Default :: default ( ) } ; private_port . name = Some ( " " . to_owned ( ) ) ; let mut selector = HashMap :: new ( ) ; selector . insert ( " " . to_owned ( ) , SPU_DEFAULT_NAME . to_owned ( ) ) ; selector . insert ( " " . to_owned ( ) , group_name . to_owned ( ) ) ; ServiceSpec { cluster_ip : " " . to_owned ( ) , ports : vec ! [ public_port private_port ] , selector : Some ( selector ) , .. Default :: default ( ) } }
generate headless service from SPG spec
for now, we forgo port and env variable because it wasn't mapped from K8
generate headless service from SPG spec for now we forgo port and env variable because it wasn ' t mapped from K8
_spg
&SpuGroupSpec
group_name
&str
_spg
&SpuGroupSpec
group_name
&str