A collection of plugins for the OKD / Kubernetes CLI client.
cleanup: Clean up excessive (stale) resources
oc plugin <plugin-name> --helpCleanup removes stale image stream tags that are tagged with a commit SHA of a specific repository (e.g. when you automatically tag built images with the related Git commit hash). Due to a bug you have to explicitly specify the local Git repository with an absolute path.
oc plugin cleanup my-image -p /path/to/git-repository/Example: (using Docker)
$ docker run --rm -it -v $(pwd):/app appuio/oc:v3.9 oc plugin cleanup --helpClean up excessive (stale) image tags, images and related resources.Usage: oc plugin cleanup [options]Examples: oc plugin cleanup IMAGE --git-repo-path $PWDOptions: -f, --force='n': don't ask for confirmation to delete image tags (use: y) -l, --git-commit-limit='100': only look at the first <n> commits to compare with tags -p, --git-repo-path='': absolute path to Git repository (for current dir use: $PWD) -k, --keep='10': keep most current <n> imagesUse "oc options" for a list of global command-line options (applies to all commands).See Installing Plug-ins in the official documentation.
The image or infrastructure using this plugin collection must meet the following requirements for the commands to work.
- Bash v4+
- Git
- Extending the CLI (official docs)
# configure plugins path for developmentexport KUBECTL_PLUGINS_PATH=$(pwd)# list all plugins, print usage
oc plugin