Title: Update script to switch from kubectl to oc if kubectl is not found
Description:
This update enhances the script by adding a fallback mechanism in case the kubectl command is not found. The changes are as follows:
The script now checks if kubectl is available on the system.
If kubectl is not found, it switches the KUBECTL variable to oc (OpenShift CLI) as a fallback.
If neither kubectl nor oc is found, the script will exit with an appropriate error message.
Why this change?
This improvement is aimed at making the script more versatile in environments where oc is used instead of kubectl (e.g., OpenShift). This allows for better compatibility across different Kubernetes and OpenShift clusters, reducing the need for manual intervention when switching between kubectl and oc.
Title: Update script to switch from
kubectl
tooc
ifkubectl
is not foundDescription:
This update enhances the script by adding a fallback mechanism in case the
kubectl
command is not found. The changes are as follows:kubectl
is available on the system.kubectl
is not found, it switches theKUBECTL
variable tooc
(OpenShift CLI) as a fallback.kubectl
noroc
is found, the script will exit with an appropriate error message.Why this change?
This improvement is aimed at making the script more versatile in environments where
oc
is used instead ofkubectl
(e.g., OpenShift). This allows for better compatibility across different Kubernetes and OpenShift clusters, reducing the need for manual intervention when switching betweenkubectl
andoc
.