pub fn build_configmap(
name: &str,
namespace: &str,
instance: &Bind9Instance,
cluster: Option<&Bind9Cluster>,
role_allow_transfer: Option<&Vec<String>>,
) -> Result<ConfigMap>Expand description
Builds a Kubernetes ConfigMap containing BIND9 configuration files.
Creates a ConfigMap with the files NOT overridden by custom
configMapRefs (instance overrides cluster):
named.conf- Main BIND9 configuration (omitted whennamedConfref is set)named.conf.options- BIND9 options (omitted whennamedConfOptionsref is set)rndc.conf- RNDC client configuration (ALWAYS generated; it is not overridable and is mounted from thisConfigMapunconditionally)
Because rndc.conf is always present, this ConfigMap must always be
created — even when both namedConf and namedConfOptions refs are set —
so the pod’s config volume always has a backing ConfigMap.
§Arguments
name- Name for theConfigMap(typically{instance-name}-config)namespace- Kubernetes namespaceinstance-Bind9Instancespec containing configuration optionscluster- OptionalBind9Clustercontaining shared configurationrole_allow_transfer- Role-specific allow-transfer override from cluster spec
§Returns
A Kubernetes ConfigMap resource ready for creation/update
§Errors
Returns an error if any ACL, forwarder, or listen-address entry in the
instance or cluster spec fails validation — see crate::bind9_acl for
the accepted ACL syntax.