Skip to main content

install

Function install 

Source
pub fn install(
    dst: &[u8],
    src: &[u8],
    name: &str,
    set_current: bool,
) -> Result<Vec<u8>, MergeError>
Expand description

Port of kubeconfig.Install. src is a self-contained kubeconfig as returned by a driver’s get_kubeconfig; dst may be empty. The context and the cluster/user it references are all renamed to name before merging, and existing entries of that name are replaced in place, so calling install repeatedly is idempotent and picks up a new server address after the cluster is recreated.

current-context is only written when set_current is true; otherwise whatever the user had selected is preserved. Everything in dst that install does not own is round-tripped untouched, including comments and keys Caproni does not model.