Skip to content

Commit 8563d86

Browse files
authored
[CHANGE] All OpenShift-specific scripts fail when not run on OpenShift (#808)
1 parent e69f13b commit 8563d86

File tree

6 files changed

+37
-0
lines changed

6 files changed

+37
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
* [UPGRADE] OpenSearch Data Source Plugin to Grafana upgraded from 2.29.1 to 2.31.1
1414
* **Logging**
1515
* [FIX] Log messages from Alertmanger pod redirected to OpenSearch viya_ops-* (rather than viya_logs-*) index
16+
* [CHANGE] All OpenShift-specific scripts now fail when run on non-OpenShift clusters
17+
1618

1719
## Version 1.2.43 (10OCT2025)
1820
* **Metrics**

logging/bin/deploy_openshift_prereqs.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ if [ "$OPENSHIFT_PREREQS_ENABLE" != "true" ]; then
1818
exit
1919
fi
2020

21+
if [ "$OPENSHIFT_CLUSTER" != "true" ]; then
22+
if [ "${CHECK_OPENSHIFT_CLUSTER:-true}" == "true" ]; then
23+
log_error "This script should only be run on OpenShift clusters"
24+
exit 1
25+
fi
26+
fi
27+
2128
# link OpenSearch serviceAccounts to 'privileged' scc
2229
oc adm policy add-scc-to-user privileged -z v4m-os -n "$LOG_NS"
2330

logging/bin/deploy_servicemonitors_openshift.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ if [ "$DEPLOY_SERVICEMONITORS" != "true" ]; then
1818
exit
1919
fi
2020

21+
if [ "$OPENSHIFT_CLUSTER" != "true" ]; then
22+
if [ "${CHECK_OPENSHIFT_CLUSTER:-true}" == "true" ]; then
23+
log_error "This script should only be run on OpenShift clusters"
24+
exit 1
25+
fi
26+
fi
27+
2128
EVENTROUTER_ENABLE=${EVENTROUTER_ENABLE:-true}
2229
if [ "$EVENTROUTER_ENABLE" == "true" ]; then
2330
# Eventrouter ServiceMonitor

logging/bin/remove_openshift_artifacts.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ if [ "$OPENSHIFT_ARTIFACTS_REMOVE" != "true" ]; then
1818
exit
1919
fi
2020

21+
if [ "$OPENSHIFT_CLUSTER" != "true" ]; then
22+
if [ "${CHECK_OPENSHIFT_CLUSTER:-true}" == "true" ]; then
23+
log_error "This script should only be run on OpenShift clusters"
24+
exit 1
25+
fi
26+
fi
27+
2128
# remove custom OpenShift SCC
2229
oc delete scc v4mlogging --ignore-not-found
2330
oc delete scc v4m-logging-v2 --ignore-not-found

logging/bin/remove_openshift_routes.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ this_script=$(basename "$0")
1010

1111
log_debug "Script [$this_script] has started [$(date)]"
1212

13+
if [ "$OPENSHIFT_CLUSTER" != "true" ]; then
14+
if [ "${CHECK_OPENSHIFT_CLUSTER:-true}" == "true" ]; then
15+
log_error "This script should only be run on OpenShift clusters"
16+
exit 1
17+
fi
18+
fi
19+
1320
oc -n "$LOG_NS" delete route v4m-es-kibana-svc --ignore-not-found
1421
oc -n "$LOG_NS" delete route v4m-es-client-service --ignore-not-found
1522
oc -n "$LOG_NS" delete route v4m-search --ignore-not-found

logging/bin/remove_servicemonitors_openshift.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ if [ "$DEPLOY_SERVICEMONITORS" != "true" ]; then
1818
exit
1919
fi
2020

21+
if [ "$OPENSHIFT_CLUSTER" != "true" ]; then
22+
if [ "${CHECK_OPENSHIFT_CLUSTER:-true}" == "true" ]; then
23+
log_error "This script should only be run on OpenShift clusters"
24+
exit 1
25+
fi
26+
fi
27+
2128
EVENTROUTER_ENABLE=${EVENTROUTER_ENABLE:-true}
2229
if [ "$EVENTROUTER_ENABLE" == "true" ]; then
2330
# Eventrouter ServiceMonitor

0 commit comments

Comments
 (0)