Last active
April 21, 2022 19:44
-
-
Save dudash/f7cef9a30a76f59ca7f9ebfa3d803b0e to your computer and use it in GitHub Desktop.
oc-version+: a Plugin script for oc CLI to print additional cluster version info
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# source: https://gist.github.com/dudash/f7cef9a30a76f59ca7f9ebfa3d803b0e/ | |
# docs: https://docs.openshift.com/container-platform/4.7/cli_reference/openshift_cli/extending-cli-plugins.html | |
# | |
# To use this: | |
# put this script in /usr/local/bin | |
# chmod a+x oc-version+ | |
# oc version+ | |
oc version | |
echo "Cluster ID:" $(oc get clusterversion -o jsonpath='{.items[].spec.clusterID}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You use this, just download and move this file to
/usr/local/bin
and make it executable withchmod a+x oc-version+
.The oc CLI will automatically pick it up, so now you can use it with
oc version+
You can read about CLI extensions here:
https://docs.openshift.com/container-platform/4.7/cli_reference/openshift_cli/extending-cli-plugins.html