get_cluster_ref_from_spec

Function get_cluster_ref_from_spec 

Source
pub fn get_cluster_ref_from_spec(
    spec: &DNSZoneSpec,
    namespace: &str,
    name: &str,
) -> Result<String>
Expand description

Helper function to extract and validate cluster reference from DNSZoneSpec.

Returns the cluster name, whether from clusterRef or clusterProviderRef. Validates that exactly one is specified (mutual exclusivity).

This function is public so it can be used by other reconcilers (e.g., records reconciler).

ยงErrors

Returns an error if:

  • Both clusterRef and clusterProviderRef are specified (mutual exclusivity violation)
  • Neither clusterRef nor clusterProviderRef is specified (at least one required)