Crates.io | korrect |
lib.rs | korrect |
version | 0.3.0-rc.0 |
created_at | 2024-11-27 00:06:05.659643+00 |
updated_at | 2025-07-13 16:55:48.283203+00 |
description | A kubectl version managing shim that invokes the correct version of kubectl or helm ☸ |
homepage | |
repository | https://gitlab.com/cromulentbanana/korrect/ |
max_upload_size | |
id | 1462453 |
size | 210,907 |
A CLI tool to manage (and optionally fetch) multiple different versions of kubectl by providing a shim layer on top of kubectl. Based on the current k8s context, the correct kubectl version will automatically be invoked. Correct Kubetctl. Korrect.
Witness the miracle of never again needlessly being admonished: version difference between client (1.31) and server (1.29) exceeds the supported minor version skew of +/-1
k
and kubectl
)korrect uninstall
.git clone https://gitlab.com/cromulentbanana/korrect.git
cd korrect
cargo install --path .
cargo install korrect
korrect setup
Note that various setup options can be used to e.g. choose whether to also manage helm, choose the download mode or version matching strategy. See korrect setup --help
for details.
export PATH="$HOME/.korrect/bin:$PATH"
# Set up korrect
korrect setup
# List installed components
korrect list
# View the configuration
korrect config
# Generate shell completions (replace `zsh` with your shell)
korrect completions zsh
The setup command supports several flags to customize installation:
# Force installation (overwrite existing files)
korrect setup --force
# Uninstall korrect
korrect uninstall
After installation, korrect creates the following directory structure:
~/
├──.cache/korrect/ # The contents of the active kubeconfig are hashed to reference
├ # the version-specific kubectl belonging to it
├──.config/korrect/
├ └── config.toml
├
└──.korrect/bin/
├── k # Symlink to korrect-shim
├── kubectl # Symlink to korrect-shim
├── helm # Symlink to korrect-shim
├── kubectl-vA.B.C # Binary auto-downloaded by kubectl-shim or placed here by you
└── kubectl-vX.Y.Z # Binary auto-downloaded or kubectl-shim or placed here by you
Configuration is written at setup time into ~/.config/korrect/config.toml
.
korrect supports shell completions for various shells. To enable completions:
# For bash
korrect completions bash > ~/.local/share/bash-completion/completions/korrect
# For zsh
korrect completions zsh > ~/.zfunc/_korrect
# For fish
korrect completions fish > ~/.config/fish/completions/korrect.fish
Remember to source your shell's completion file or restart your shell.
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
git checkout -b feature/AmazingFeature
)git commit -m 'Add some AmazingFeature'
)git push origin feature/AmazingFeature
)Inspired by the volta.sh the Hassle-free javascript tool manager
Built with clap-rs for argument parsing, shell completion
==============
resolve_latest_cluster_version -> managed_binary.latest_bin_version_from_cluster_version
get_current_stable_managed_binary_version needs to be replaced