Skip to content

Commit

Permalink
Add networking-console-plugin on start-console
Browse files Browse the repository at this point in the history
  • Loading branch information
upalatucci committed Dec 2, 2024
1 parent 38a68df commit 98ac177
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions start-console.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}"
Expand Down Expand Up @@ -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"]}"
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down

0 comments on commit 98ac177

Please sign in to comment.