From 3521dd3833142d33eb142c2c763d6c942eff3b67 Mon Sep 17 00:00:00 2001 From: Armel Soro Date: Thu, 15 May 2025 16:43:49 +0200 Subject: [PATCH 1/3] chore(CI builds): Expose an in-cluster Helm repo off of the OCI chart pulled Ref: https://issues.redhat.com/browse/RHIDP-7251 Ref: https://issues.redhat.com/browse/RHIDP-6668 --- .rhdh/scripts/install.sh | 59 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 57 insertions(+), 2 deletions(-) diff --git a/.rhdh/scripts/install.sh b/.rhdh/scripts/install.sh index c6184ae8..021908dd 100755 --- a/.rhdh/scripts/install.sh +++ b/.rhdh/scripts/install.sh @@ -60,15 +60,70 @@ if [[ "$CV" == *"-CI" ]] || [[ $chartrepo -eq 1 ]]; then mkdir -p /tmp/"$CV"-unpacked && pushd /tmp/"$CV"-unpacked >/dev/null 2>&1 || exit 1 helm pull oci://quay.io/rhdh/chart --version "$CV" -d /tmp/"$CV"-unpacked # get tarball helm repo index /tmp/"$CV"-unpacked # create index.yaml + + # HelmChartRepository does not support OCI artifacts. + # Host an in-cluster Helm repo serving both the index and chart files. + if oc -n "$namespace" get configmap helm-repo-files > /dev/null; then + oc -n "$namespace" delete configmap helm-repo-files + fi + oc -n "$namespace" create configmap helm-repo-files \ + --from-file=/tmp/"$CV"-unpacked/index.yaml \ + --from-file=/tmp/"$CV"-unpacked/chart-${CV}.tgz + cat < helm-repo.yaml +apiVersion: apps/v1 +kind: Deployment +metadata: + name: helm-repo + annotations: + rhdh.redhat.com/chart-version: "$CV" +spec: + replicas: 1 + selector: + matchLabels: + app: helm-repo + template: + metadata: + labels: + app: helm-repo + annotations: + rhdh.redhat.com/chart-version: "$CV" + spec: + containers: + - name: nginx + image: quay.io/openshifttest/nginx-alpine:1.2.4 + ports: + - containerPort: 8080 + volumeMounts: + - name: chart-vol + mountPath: /data/http/charts + volumes: + - name: chart-vol + configMap: + name: helm-repo-files +--- +apiVersion: v1 +kind: Service +metadata: + name: helm-repo +spec: + selector: + app: helm-repo + ports: + - port: 80 + targetPort: 8080 +EOF + oc apply -f helm-repo.yaml || kubctl apply -f helm-repo.yaml + cat < repo.yaml apiVersion: helm.openshift.io/v1beta1 kind: HelmChartRepository metadata: name: rhdh-next-ci-repo + annotations: + rhdh.redhat.com/chart-version: "$CV" spec: connectionConfig: - file: >- - ./index.yaml + url: http://helm-repo.${namespace}.svc.cluster.local/charts EOF oc apply -f repo.yaml || kubctl apply -f repo.yaml From 5ecd9366ef85a169ee8201ac61c9b1b05e54fd90 Mon Sep 17 00:00:00 2001 From: Armel Soro Date: Thu, 15 May 2025 17:04:18 +0200 Subject: [PATCH 2/3] Update .rhdh/scripts/install.sh --- .rhdh/scripts/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.rhdh/scripts/install.sh b/.rhdh/scripts/install.sh index 021908dd..d4cfa846 100755 --- a/.rhdh/scripts/install.sh +++ b/.rhdh/scripts/install.sh @@ -112,7 +112,7 @@ spec: - port: 80 targetPort: 8080 EOF - oc apply -f helm-repo.yaml || kubctl apply -f helm-repo.yaml + oc apply -f helm-repo.yaml || kubectl apply -f helm-repo.yaml cat < repo.yaml apiVersion: helm.openshift.io/v1beta1 From db286307f98818cdcdddae107e2b9b8ea9d36b0b Mon Sep 17 00:00:00 2001 From: Armel Soro Date: Thu, 15 May 2025 17:05:26 +0200 Subject: [PATCH 3/3] Update .rhdh/scripts/install.sh --- .rhdh/scripts/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.rhdh/scripts/install.sh b/.rhdh/scripts/install.sh index d4cfa846..d5f4e561 100755 --- a/.rhdh/scripts/install.sh +++ b/.rhdh/scripts/install.sh @@ -126,7 +126,7 @@ spec: url: http://helm-repo.${namespace}.svc.cluster.local/charts EOF - oc apply -f repo.yaml || kubctl apply -f repo.yaml + oc apply -f repo.yaml || kubectl apply -f repo.yaml popd >/dev/null 2>&1 || exit 1 # clean up temp files