The test to detect OpenShift in the setup-vcluster-env.sh script
if kubectl api-resources | grep -q "openshift.io"; then
OPENSHIFT=true
fi
is not working. grep -q will return success as soon as it detects the first match. This will close the pipe between the kubectl command and the grep command. The kubectl command will then try to write its next result to the closed pipe, causing it to error out. Since the script has set set -o pipefail, the entire pipeline will then error out, resulting in the OPENSHIFT variable not being set.
This PR fixes this by forcing the kubectl step to always exit successfully.
The test to detect OpenShift in the
setup-vcluster-env.sh
scriptis not working.
grep -q
will return success as soon as it detects the first match. This will close the pipe between thekubectl
command and thegrep
command. Thekubectl
command will then try to write its next result to the closed pipe, causing it to error out. Since the script has setset -o pipefail
, the entire pipeline will then error out, resulting in theOPENSHIFT
variable not being set.This PR fixes this by forcing the
kubectl
step to always exit successfully.