Skip to main content

write_overlay_hostname

Function write_overlay_hostname 

Source
pub fn write_overlay_hostname(
    overlay_dir: &Path,
    hostname: &str,
) -> Result<(), HostnameError>
Expand description

Rewrites the host/wildcardHost literals in the overlay’s kustomization.yaml so the wildcard Certificate covers the cluster hostname rather than the embedded placeholder. An empty hostname returns HostnameError::EmptyHostname rather than silently shipping the placeholder cert.

§Errors

Returns HostnameError if hostname is empty, the overlay’s kustomization.yaml cannot be read, parsed, rewritten, or written back, or the overlay does not carry the expected configMapGenerator.