Skip to content

Commit

Permalink
Change the OpenShift detection
Browse files Browse the repository at this point in the history
Signed-off-by: Israel Blancas <iblancasa@gmail.com>
  • Loading branch information
iblancasa committed Feb 1, 2023
1 parent 62b3e79 commit c05a8ec
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion hack/install-metrics-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# you can just add --addons "metrics-server" to the start command.


if [[ "$(kubectl api-resources)" =~ "openshift" ]]; then
if [[ "$(kubectl api-resources --api-group=operator.openshift.io -o name)" ]]; then
echo "Connected to an OpenShift cluster. metrics-server installation is not needed"
elif [[ "$(kubectl get deployment metrics-server -n kube-system 2>&1 )" =~ "NotFound" ]]; then
kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
Expand Down
2 changes: 1 addition & 1 deletion hack/install-openshift-routes.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

if [[ "$(kubectl api-resources)" =~ "openshift" ]]; then
if [[ "$(kubectl api-resources --api-group=operator.openshift.io -o name)" ]]; then
echo "Connected to an OpenShift cluster. OpenShift routes installation is not needed"
else
kubectl apply -f https://raw.githubusercontent.com/openshift/router/release-4.12/deploy/router_rbac.yaml
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/daemonset-features/add-sa-collector.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
if [[ "$(kubectl api-resources)" =~ "operator.openshift.io" ]]; then
if [[ "$(kubectl api-resources --api-group=operator.openshift.io -o name)" ]]; then
echo "Adding service account to the OpenTelemetry Collector"
kubectl patch otelcol daemonset --type=merge -p '{"spec":{"serviceAccount":"otel-collector-daemonset"}}' -n $NAMESPACE
fi
2 changes: 1 addition & 1 deletion tests/e2e/daemonset-features/add-scc-openshift.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
if [[ "$(kubectl api-resources)" =~ "operator.openshift.io" ]]; then
if [[ "$(kubectl api-resources --api-group=operator.openshift.io -o name)" ]]; then
echo "Running the test against an OpenShift Cluster"
echo "Creating an Service Account"
echo "Creating a Security Context Constrain"
Expand Down

0 comments on commit c05a8ec

Please sign in to comment.