Skip to content

Conversation

@XeniaP
Copy link

@XeniaP XeniaP commented Sep 11, 2024

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.

Update the CURRENT_NS to use the KUBECTL variable instead kubectl in command setup
adding the validation for openshift environment with oc commands instead kubectl
@XeniaP XeniaP changed the title Xenia Collect Logs Updating Collect Logs Updating Sep 11, 2024
@XeniaP XeniaP changed the title Collect Logs Updating Collect Logs Script Updating for Openshift Environments Sep 11, 2024
@zayaanmoez zayaanmoez added the enhancement New feature or request label Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants