Skip to content

Commit 201fdeb

Browse files
committed
[CHANGE] All OpenShift-specific scripts now fail when run on non-OpenShift clusters
1 parent 0891813 commit 201fdeb

File tree

6 files changed

+40
-0
lines changed

6 files changed

+40
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
# SAS Viya Monitoring for Kubernetes
2+
## Unreleased
3+
* **Logging**
4+
* [CHANGE] All OpenShift-specific scripts now fail when run on non-OpenShift clusters
5+
26
## Version 1.2.43 (10OCT2025)
37
* **Metrics**
48
* [FEATURE] A new sample demonstrates how to extend SAS Viya Monitoring

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: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ 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+
28+
2129
# remove custom OpenShift SCC
2230
oc delete scc v4mlogging --ignore-not-found
2331
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)