From 98ac1779a137e36abde7d42d0fe40f4dbbabeac9 Mon Sep 17 00:00:00 2001 From: Ugo Palatucci Date: Fri, 29 Nov 2024 16:31:46 +0100 Subject: [PATCH] Add networking-console-plugin on start-console --- package.json | 2 ++ start-console.sh | 6 +++--- webpack.config.ts | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 6ee479443..01530b5ed 100644 --- a/package.json +++ b/package.json @@ -142,8 +142,10 @@ "po-to-i18n": "node ./i18n-scripts/po-to-i18n.js", "postinstall": "cp node_modules/@openshift-console/dynamic-plugin-sdk/docs/console-extensions.md .", "prepare": "husky install", + "start": "yarn ts-node node_modules/.bin/webpack serve", "start-console": "./start-console.sh", "start-console-with-monitoring": "./start-console.sh monitoring-plugin", + "start-console-with-networking": "./start-console.sh networking-console-plugin", "test": "jest", "test-cov": "jest --coverage", "test-cypress": "cd cypress && ../node_modules/cypress/bin/cypress open --config-file ./cypress.json --env openshift=true", diff --git a/start-console.sh b/start-console.sh index ab2618661..ef1c17092 100755 --- a/start-console.sh +++ b/start-console.sh @@ -4,7 +4,7 @@ set -euo pipefail #Cloning, pulling and running other plugins starting from port 9002 # to add more plugin simply add more properites to dic. [name-of-plugin]={git-repo-url} -declare -A plugins=(["monitoring-plugin"]="https://github.com/openshift/monitoring-plugin.git") +declare -A plugins=(["monitoring-plugin"]="https://github.com/openshift/monitoring-plugin.git", ["networking-console-plugin"]="https://github.com/openshift/networking-console-plugin.git") declare -A runningPlugins=(["podman-linux"]="kubevirt-plugin=http://localhost:9001", ["podman"]="kubevirt-plugin=http://host.containers.internal:9001", ["docker"]="kubevirt-plugin=http://host.docker.internal:9001") INITIAL_PORT=9002 @@ -31,7 +31,7 @@ for arg in $@; do kill -9 $(lsof -t -i:$INITIAL_PORT) fi - yarn start --port=$INITIAL_PORT & + PORT=$INITIAL_PORT yarn start --port=$INITIAL_PORT & runningPlugins["podman-linux"]+=",${arg}=http://localhost:${INITIAL_PORT}" runningPlugins["podman"]+=",${arg}=http://host.containers.internal:${INITIAL_PORT}" @@ -67,7 +67,7 @@ if [ -x "$(command -v podman)" ]; then podman run --pull=always --rm --network=host --env-file <(set | grep BRIDGE) $CONSOLE_IMAGE else BRIDGE_PLUGINS="${runningPlugins["podman"]}" - podman run --pull=always --rm -p "$CONSOLE_PORT":9000 --env-file <(set | grep BRIDGE) $CONSOLE_IMAGE + podman run --platform=linux/x86_64 --pull=always --rm -p "$CONSOLE_PORT":9000 --env-file <(set | grep BRIDGE) $CONSOLE_IMAGE fi else BRIDGE_PLUGINS="${runningPlugins["docker"]}" diff --git a/webpack.config.ts b/webpack.config.ts index fa139a576..21ee7f806 100644 --- a/webpack.config.ts +++ b/webpack.config.ts @@ -23,7 +23,7 @@ const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin'); const isProd = process.env.NODE_ENV === 'production'; -const KUBEVIRT_PLUGIN_PORT = process.env.KUBEVIRT_PLUGIN_PORT || 9001; +const KUBEVIRT_PLUGIN_PORT = process.env.PORT || process.env.KUBEVIRT_PLUGIN_PORT || 9001; const config: Configuration = { context: path.resolve(__dirname, 'src'),