Expand description
Port of internal/kubeconfig/file.go: resolves, reads, and atomically
rewrites a kubeconfig file on disk, keeping a rolling backup.
Enums§
- File
Error - Errors from resolving, reading, or writing a kubeconfig file.
Constants§
- BACKUP_
SUFFIX - Port of the
backupSuffix,fileMode,dirModeconstants. - DIR_
MODE - FILE_
MODE
Functions§
- read
- Port of
kubeconfig.Read. ReturnsOk(None)when the file does not exist yet, matching Go’snil, nilreturn. - target_
path - Port of
kubeconfig.TargetPath. The precedence mirrorskubectl config set-*: an explicitoverridewins, otherwise the first entry ofKUBECONFIG(kubectl writes to the first file in the list, not all of them), otherwise~/.kube/config. - write
- Port of
kubeconfig.Write. Returns the backup path, empty when there was nothing to back up.