fn build_broker_rolegroup_config_map(
    rolegroup: &RoleGroupRef<KafkaCluster>,
    kafka: &KafkaCluster,
    broker_config: &HashMap<PropertyNameKind, BTreeMap<String, String>>,
) -> Result<ConfigMap> {
    let server_cfg = broker_config
        .get(&PropertyNameKind::File(SERVER_PROPERTIES_FILE.to_string()))
        .cloned()
        .unwrap_or_default();
    let server_cfg = server_cfg
        .into_iter()
        .map(|(k, v)| (k, Some(v)))
        .collect::<Vec<_>>();
    ConfigMapBuilder::new()
        .metadata(
            ObjectMetaBuilder::new()
                .name_and_namespace(kafka)
                .name(rolegroup.object_name())
                .ownerreference_from_resource(kafka, None, Some(true))
                .context(ObjectMissingMetadataForOwnerRefSnafu)?
                .with_recommended_labels(
                    kafka,
                    APP_NAME,
                    kafka_version(kafka)?,
                    &rolegroup.role,
                    &rolegroup.role_group,
                )
                .build(),
        )
        .add_data(
            SERVER_PROPERTIES_FILE,
            to_java_properties_string(server_cfg.iter().map(|(k, v)| (k, v))).with_context(
                |_| SerializeZooCfgSnafu {
                    rolegroup: rolegroup.clone(),
                },
            )?,
        )
        .add_data(
            "log4j.properties",
            kafka.spec.log4j.as_ref().unwrap_or(&"".to_string()),
        )
        .build()
        .with_context(|_| BuildRoleGroupConfigSnafu {
            rolegroup: rolegroup.clone(),
        })
}
/// The rolegroup [`ConfigMap`] configures the rolegroup based on the configuration given by the administrator
The rolegroup [`ConfigMap`] configures the rolegroup based on the configuration given by the administrator
The rolegroup [ ` ConfigMap ` ] configures the rolegroup based on the configuration given by the administrator
fn build_broker_rolegroup_config_map(
    rolegroup: &RoleGroupRef<KafkaCluster>,
    kafka: &KafkaCluster,
    broker_config: &HashMap<PropertyNameKind, BTreeMap<String, String>>,
) -> Result<ConfigMap> {
    let server_cfg = broker_config
        .get(&PropertyNameKind::File(SERVER_PROPERTIES_FILE.to_string()))
        .cloned()
        .unwrap_or_default();
    let server_cfg = server_cfg
        .into_iter()
        .map(|(k, v)| (k, Some(v)))
        .collect::<Vec<_>>();
    ConfigMapBuilder::new()
        .metadata(
            ObjectMetaBuilder::new()
                .name_and_namespace(kafka)
                .name(rolegroup.object_name())
                .ownerreference_from_resource(kafka, None, Some(true))
                .context(ObjectMissingMetadataForOwnerRefSnafu)?
                .with_recommended_labels(
                    kafka,
                    APP_NAME,
                    kafka_version(kafka)?,
                    &rolegroup.role,
                    &rolegroup.role_group,
                )
                .build(),
        )
        .add_data(
            SERVER_PROPERTIES_FILE,
            to_java_properties_string(server_cfg.iter().map(|(k, v)| (k, v))).with_context(
                |_| SerializeZooCfgSnafu {
                    rolegroup: rolegroup.clone(),
                },
            )?,
        )
        .add_data(
            "log4j.properties",
            kafka.spec.log4j.as_ref().unwrap_or(&"".to_string()),
        )
        .build()
        .with_context(|_| BuildRoleGroupConfigSnafu {
            rolegroup: rolegroup.clone(),
        })
}
fn build_broker_rolegroup_config_map ( rolegroup : & RoleGroupRef < KafkaCluster > , kafka : & KafkaCluster , broker_config : & HashMap < PropertyNameKind , BTreeMap < String , String > > , ) -> Result < ConfigMap > { let server_cfg = broker_config . get ( & PropertyNameKind :: File ( SERVER_PROPERTIES_FILE . to_string ( ) ) ) . cloned ( ) . unwrap_or_default ( ) ; let server_cfg = server_cfg . into_iter ( ) . map ( | ( k , v ) | ( k , Some ( v ) ) ) . collect :: < Vec < _ > > ( ) ; ConfigMapBuilder :: new ( ) . metadata ( ObjectMetaBuilder :: new ( ) . name_and_namespace ( kafka ) . name ( rolegroup . object_name ( ) ) . ownerreference_from_resource ( kafka , None , Some ( true ) ) . context ( ObjectMissingMetadataForOwnerRefSnafu ) ? . with_recommended_labels ( kafka , APP_NAME , kafka_version ( kafka ) ? , & rolegroup . role , & rolegroup . role_group , ) . build ( ) , ) . add_data ( SERVER_PROPERTIES_FILE , to_java_properties_string ( server_cfg . iter ( ) . map ( | ( k , v ) | ( k , v ) ) ) . with_context ( | _ | SerializeZooCfgSnafu { rolegroup : rolegroup . clone ( ) , } , ) ? , ) . add_data ( " " , kafka . spec . log4j . as_ref ( ) . unwrap_or ( & " " . to_string ( ) ) , ) . build ( ) . with_context ( | _ | BuildRoleGroupConfigSnafu { rolegroup : rolegroup . clone ( ) , } ) }
The rolegroup [`ConfigMap`] configures the rolegroup based on the configuration given by the administrator
The rolegroup [ ` ConfigMap ` ] configures the rolegroup based on the configuration given by the administrator
rolegroup
&RoleGroupRef<KafkaCluster>
kafka
&KafkaCluster
broker_config
&HashMap<PropertyNameKind, BTreeMap<String, String>>
rolegroup
&RoleGroupRef<KafkaCluster>
kafka
&KafkaCluster
broker_config
&HashMap<PropertyNameKind, BTreeMap<String, String>>