From 45a82f3c4978adbbe42e6f74c60f6f61878a07b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20Echterh=C3=B6lter?= Date: Sun, 9 Feb 2025 17:55:48 +0100 Subject: [PATCH] fix(local-setup): improve cleanup process in start.sh and update repository version (#343) --- .gitignore | 2 +- charts/example-content/Chart.yaml | 2 +- .../templates/contentconfigurations.yaml | 6 ++++++ charts/example-content/values.yaml | 4 ++++ charts/extension-manager-operator-crds/Chart.yaml | 2 +- .../core.openmfp.io_contentconfigurations.yaml | 2 ++ .../tests/__snapshot__/deployment_test.yaml.snap | 2 ++ .../kustomize/components/openmfp/release.yaml | 12 ++++++++++-- .../kustomize/components/openmfp/repository.yaml | 2 +- local-setup/scripts/start.sh | 12 ++++++++---- 10 files changed, 36 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index 84abf8a0d..eaf5d7f54 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,4 @@ .secret bin/ node_modules/ -./oci/ \ No newline at end of file +oci/ \ No newline at end of file diff --git a/charts/example-content/Chart.yaml b/charts/example-content/Chart.yaml index 10a7f8cec..7fa8d9029 100644 --- a/charts/example-content/Chart.yaml +++ b/charts/example-content/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 appVersion: "0.148.0" description: Helm Chart for the openmfp Portal name: example-content -version: 0.113.1 +version: 0.113.2 dependencies: - name: common version: 0.2.7 diff --git a/charts/example-content/templates/contentconfigurations.yaml b/charts/example-content/templates/contentconfigurations.yaml index 8f5d1c2de..a8f68eb1b 100644 --- a/charts/example-content/templates/contentconfigurations.yaml +++ b/charts/example-content/templates/contentconfigurations.yaml @@ -7,6 +7,9 @@ metadata: spec: remoteConfiguration: url: {{ .Values.contentConfigurations.ui.url }} + {{- if .Values.contentConfigurations.ui.internalUrl }} + internalUrl: {{ .Values.contentConfigurations.ui.internalUrl }} + {{- end }} contentType: json {{- end }} @@ -20,5 +23,8 @@ metadata: spec: remoteConfiguration: url: {{ .Values.contentConfigurations.wc.url }} + {{- if .Values.contentConfigurations.wc.internalUrl }} + internalUrl: {{ .Values.contentConfigurations.wc.internalUrl }} + {{- end }} contentType: json {{- end }} \ No newline at end of file diff --git a/charts/example-content/values.yaml b/charts/example-content/values.yaml index 9fa5c4f31..f266813ad 100644 --- a/charts/example-content/values.yaml +++ b/charts/example-content/values.yaml @@ -18,8 +18,12 @@ contentConfigurations: ui: enabled: true url: http://localhost:8000/ui/example-content/ui/assets/config.json +# Set internal url especially for local a setup where the url is not reachable from within the cluster +# internalUrl: null wc: enabled: true url: http://localhost:8000/ui/example-content/wc/assets/config.json +# Set internal url especially for local a setup where the url is not reachable from within the cluster +# internalUrl: null contentProtocolDomain: https://example-content.some-domain.com diff --git a/charts/extension-manager-operator-crds/Chart.yaml b/charts/extension-manager-operator-crds/Chart.yaml index 95b8ef1e5..5b7e6577d 100644 --- a/charts/extension-manager-operator-crds/Chart.yaml +++ b/charts/extension-manager-operator-crds/Chart.yaml @@ -3,5 +3,5 @@ name: extension-manager-operator-crds description: A Helm chart for Kubernetes type: application -version: 0.1.7 +version: 0.2.0 appVersion: "0.0.0" diff --git a/charts/extension-manager-operator-crds/templates/core.openmfp.io_contentconfigurations.yaml b/charts/extension-manager-operator-crds/templates/core.openmfp.io_contentconfigurations.yaml index 7a6cd3a3e..781404270 100644 --- a/charts/extension-manager-operator-crds/templates/core.openmfp.io_contentconfigurations.yaml +++ b/charts/extension-manager-operator-crds/templates/core.openmfp.io_contentconfigurations.yaml @@ -87,6 +87,8 @@ spec: - yaml - json type: string + internalUrl: + type: string url: type: string type: object diff --git a/charts/extension-manager-operator-crds/tests/__snapshot__/deployment_test.yaml.snap b/charts/extension-manager-operator-crds/tests/__snapshot__/deployment_test.yaml.snap index 77346470a..39e832c72 100644 --- a/charts/extension-manager-operator-crds/tests/__snapshot__/deployment_test.yaml.snap +++ b/charts/extension-manager-operator-crds/tests/__snapshot__/deployment_test.yaml.snap @@ -87,6 +87,8 @@ operator match the snapshot: - yaml - json type: string + internalUrl: + type: string url: type: string type: object diff --git a/local-setup/kustomize/components/openmfp/release.yaml b/local-setup/kustomize/components/openmfp/release.yaml index 3a649666c..5e18cd57d 100644 --- a/local-setup/kustomize/components/openmfp/release.yaml +++ b/local-setup/kustomize/components/openmfp/release.yaml @@ -28,6 +28,13 @@ spec: example-content: enabled: true example-content: + contentConfigurations: + ui: + enabled: true + internalUrl: http://openmfp-example-content.openmfp-system.svc.cluster.local:8080/ui/assets/config.json + wc: + enabled: true + internalUrl: http://openmfp-example-content.openmfp-system.svc.cluster.local:8080/wc/assets/config.json istio: enabled: true virtualService: @@ -36,7 +43,9 @@ spec: matchers: - match: - uri: - prefix: /ui/ + prefix: /ui/example-content + rewrite: + uri: / portal: baseDomains: - "localhost" @@ -114,7 +123,6 @@ spec: - name: JAVA_OPTS_APPEND value: |- -Djgroups.dns.query=openmfp-keycloak-headless.openmfp-system.svc.cluster.local - -XX:UseSVE=0 keycloakConfig: url: http://openmfp-keycloak.openmfp-system.svc.cluster.local/keycloak diff --git a/local-setup/kustomize/components/openmfp/repository.yaml b/local-setup/kustomize/components/openmfp/repository.yaml index f09c27cc3..22e18516e 100644 --- a/local-setup/kustomize/components/openmfp/repository.yaml +++ b/local-setup/kustomize/components/openmfp/repository.yaml @@ -8,6 +8,6 @@ spec: url: oci://ghcr.io/openmfp/helm-charts/openmfp ref: # renovate: datasource=docker registryUrl=https://ghcr.io depName=ghcr.io/openmfp/helm-charts/openmfp - semver: 0.0.200 + semver: 0.0.206 secretRef: name: ghcr-credentials diff --git a/local-setup/scripts/start.sh b/local-setup/scripts/start.sh index 65b6c293b..a40a7fe7b 100755 --- a/local-setup/scripts/start.sh +++ b/local-setup/scripts/start.sh @@ -62,7 +62,14 @@ if [ "${1}" == "oci" ]; then kubectl port-forward svc/registry 5000:5000 --context kind-openmfp & sleep 1 - for dir in "oci/"; do + cleanup() { + echo -e "${COL}[$(date '+%H:%M:%S')] Cleaning up background processes ${COL_RES}" + pkill -f "kubectl port-forward svc/registry 5000:5000" + } + trap cleanup EXIT + + OCIDIR=$SCRIPT_DIR/../../oci + for dir in $OCIDIR; do if [ -d "$dir" ]; then echo -e "${COL}[$(date '+%H:%M:%S')] Listing files in directory: $dir ${COL_RES}" for file in "$dir"/*; do @@ -76,9 +83,6 @@ if [ "${1}" == "oci" ]; then exit 1 fi done - - # kill the port-forward process - pkill -f "kubectl port-forward svc/registry 5000:5000" else kubectl apply -k $SCRIPT_DIR/../kustomize/overlays/default fi