Skip to content

Commit

Permalink
CI sould look for forklift routes if exist
Browse files Browse the repository at this point in the history
Signed-off-by: yaacov <[email protected]>
  • Loading branch information
yaacov committed May 19, 2024
1 parent ddc8d56 commit a3eaf28
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions ci/start-console.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,16 @@ PLUGIN_URL=${PLUGIN_URL:-"http://localhost:9001"}
CONTAINER_NETWORK_TYPE=${CONTAINER_NETWORK_TYPE:-"host"}
CONSOLE_IMAGE=${CONSOLE_IMAGE:-"quay.io/openshift/origin-console:latest"}
CONSOLE_PORT=${CONSOLE_PORT:-9000}

# Look for forklift routes
if oc_available_loggedin; then
routes=$(oc get routes -A -o template --template='{{range .items}}{{.spec.host}}{{"\n"}}{{end}}' 2>/dev/null || true)
INVENTORY_SERVER_HOST=${INVENTORY_SERVER_HOST:-$(echo "$routes" | grep forklift-inventory)}
SERVICES_API_SERVER_HOST=${SERVICES_API_SERVER_HOST:-$(echo "$routes" | grep forklift-services)}
fi

# Default to localhost if no route found
INVENTORY_SERVER_HOST=${INVENTORY_SERVER_HOST:-"https://localhost:30444"}
MUST_GATHER_API_SERVER_HOST=${MUST_GATHER_API_SERVER_HOST:-"https://localhost:30445"}
SERVICES_API_SERVER_HOST=${SERVICES_API_SERVER_HOST:-"https://localhost:30446"}

if [[ ${CONSOLE_IMAGE} =~ ^localhost/ ]]; then
Expand Down Expand Up @@ -48,11 +56,6 @@ BRIDGE_PLUGIN_PROXY=$(cat << END | jq -c .
"endpoint":"${INVENTORY_SERVER_HOST}",
"authorize":true
},
{
"consoleAPIPath":"/api/proxy/plugin/${PLUGIN_NAME}/forklift-must-gather-api/",
"endpoint":"${MUST_GATHER_API_SERVER_HOST}",
"authorize":true
},
{
"consoleAPIPath":"/api/proxy/plugin/${PLUGIN_NAME}/forklift-services/",
"endpoint":"${SERVICES_API_SERVER_HOST}",
Expand Down Expand Up @@ -83,7 +86,6 @@ Container pull policy: ${PULL_POLICY}
Plugins: ${BRIDGE_PLUGINS}
Inventory server URL: ${INVENTORY_SERVER_HOST}
Must gather API server URL: ${MUST_GATHER_API_SERVER_HOST}
Services server URL: ${SERVICES_API_SERVER_HOST}
Plugin proxy:
$(echo ${BRIDGE_PLUGIN_PROXY} | jq .)
Expand Down

0 comments on commit a3eaf28

Please sign in to comment.