|
|
@@ -12,12 +12,18 @@ BRIDGE_K8S_MODE="off-cluster"
|
|
|
BRIDGE_K8S_AUTH="bearer-token"
|
|
|
BRIDGE_K8S_MODE_OFF_CLUSTER_SKIP_VERIFY_TLS=true
|
|
|
BRIDGE_K8S_MODE_OFF_CLUSTER_ENDPOINT=$(oc whoami --show-server)
|
|
|
-BRIDGE_K8S_MODE_OFF_CLUSTER_THANOS=$(oc -n openshift-config-managed get configmap monitoring-shared-config -o jsonpath='{.data.thanosPublicURL}')
|
|
|
-BRIDGE_K8S_MODE_OFF_CLUSTER_ALERTMANAGER=$(oc -n openshift-config-managed get configmap monitoring-shared-config -o jsonpath='{.data.alertmanagerPublicURL}')
|
|
|
+# The monitoring operator is not always installed (e.g. for local OpenShift). Tolerate missing config maps.
|
|
|
+set +e
|
|
|
+BRIDGE_K8S_MODE_OFF_CLUSTER_THANOS=$(oc -n openshift-config-managed get configmap monitoring-shared-config -o jsonpath='{.data.thanosPublicURL}' 2>/dev/null)
|
|
|
+BRIDGE_K8S_MODE_OFF_CLUSTER_ALERTMANAGER=$(oc -n openshift-config-managed get configmap monitoring-shared-config -o jsonpath='{.data.alertmanagerPublicURL}' 2>/dev/null)
|
|
|
+set -e
|
|
|
BRIDGE_K8S_AUTH_BEARER_TOKEN=$(oc whoami --show-token 2>/dev/null)
|
|
|
BRIDGE_USER_SETTINGS_LOCATION="localstorage"
|
|
|
|
|
|
-GITOPS_HOSTNAME=$(oc -n openshift-gitops get route cluster -o jsonpath='{.spec.host}' 2> /dev/null)
|
|
|
+# Don't fail if the cluster doesn't have gitops.
|
|
|
+set +e
|
|
|
+GITOPS_HOSTNAME=$(oc -n openshift-gitops get route cluster -o jsonpath='{.spec.host}' 2>/dev/null)
|
|
|
+set -e
|
|
|
if [ -n "$GITOPS_HOSTNAME" ]; then
|
|
|
BRIDGE_K8S_MODE_OFF_CLUSTER_GITOPS="https://$GITOPS_HOSTNAME"
|
|
|
fi
|