Przeglądaj źródła

fix: configure gitops URL in start-console.sh

If gitops is enabled on the cluster, set the `BRIDGE_K8S_MODE_OFF_CLUSTER_GITOPS`
environment variable so that the Developer -> Environments page works.
Samuel Padgett 4 lat temu
rodzic
commit
60e5622423
1 zmienionych plików z 5 dodań i 0 usunięć
  1. 5 0
      start-console.sh

+ 5 - 0
start-console.sh

@@ -17,6 +17,11 @@ BRIDGE_K8S_MODE_OFF_CLUSTER_ALERTMANAGER=$(oc -n openshift-config-managed get co
 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)
+if [ -n "$GITOPS_HOSTNAME" ]; then
+    BRIDGE_K8S_MODE_OFF_CLUSTER_GITOPS="https://$GITOPS_HOSTNAME"
+fi
+
 echo "API Server: $BRIDGE_K8S_MODE_OFF_CLUSTER_ENDPOINT"
 echo "Console Image: $CONSOLE_IMAGE"
 echo "Console URL: http://localhost:${CONSOLE_PORT}"