Skip to content

Commit

Permalink
fix(local-setup): improve cleanup process in start.sh and update repo…
Browse files Browse the repository at this point in the history
…sitory version (#343)
  • Loading branch information
nexus49 authored Feb 9, 2025
1 parent 645ae14 commit 45a82f3
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
.secret
bin/
node_modules/
./oci/
oci/
2 changes: 1 addition & 1 deletion charts/example-content/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions charts/example-content/templates/contentconfigurations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand All @@ -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 }}
4 changes: 4 additions & 0 deletions charts/example-content/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion charts/extension-manager-operator-crds/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ spec:
- yaml
- json
type: string
internalUrl:
type: string
url:
type: string
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ operator match the snapshot:
- yaml
- json
type: string
internalUrl:
type: string
url:
type: string
type: object
Expand Down
12 changes: 10 additions & 2 deletions local-setup/kustomize/components/openmfp/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -36,7 +43,9 @@ spec:
matchers:
- match:
- uri:
prefix: /ui/
prefix: /ui/example-content
rewrite:
uri: /
portal:
baseDomains:
- "localhost"
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion local-setup/kustomize/components/openmfp/repository.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 8 additions & 4 deletions local-setup/scripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 45a82f3

Please sign in to comment.