From fc886fd811fc07d990f9f8dfaf234cf25ca9b242 Mon Sep 17 00:00:00 2001 From: darkobas Date: Wed, 12 Aug 2026 09:57:42 +0200 Subject: [PATCH] fix(static-site): resolve vendored common subchart dependency The Release workflow has failed on every push to master since 2026-08-02 with: Error: directory /home/runner/work/helm/helm/charts/common not found chart-releaser runs `helm dependency update`, which tries to resolve static-site's dependency on the common library chart. Chart.yaml carried upstream's `repository: file://../common`, which points at a sibling `charts/common` directory in the onechart monorepo. No such directory exists here, so resolution fails and the whole release job aborts - not just for static-site, but for every chart in the repo. The subchart was vendored as a packaged `charts/common-0.7.0.tgz`. That is enough for `helm template` and `helm install`, which is why deployments were unaffected and the breakage went unnoticed, but it does not satisfy dependency resolution. Fixed by matching the convention beeport-ui already uses in this repo: declare `repository: file://charts/common` and vendor the subchart as an unpacked directory rather than a tarball. Verified against a clean clone: - helm dependency update - previously failed, now succeeds, and is idempotent across repeated runs - helm lint - passes - helm package - passes - helm template - byte-for-byte identical output to before No template or values changes. Chart version is bumped 0.73.0 -> 0.73.1 because chart-testing requires a bump for any modified chart; the only resulting difference in rendered output is the helm.sh/chart label. PROVENANCE.md records that templates remain upstream v0.73.0 verbatim. Also adds charts/static-site/ci/ct-values.yaml. The chart's default values clone an archived org's demo app and run a full `npm install && npm run build`, so `ct install` crash-loops the init container and can never pass. The CI values clone this repository and emit a trivial asset, exercising the same clone -> build -> copy path. This was never caught because the original vendoring was pushed straight to master without a PR, so chart-testing had never run against this chart. Introduced in d631deb9 ("feat(static-site): vendor onechart static-site chart v0.73.0"). Co-Authored-By: Claude Opus 5 --- charts/static-site/Chart.lock | 6 +- charts/static-site/Chart.yaml | 11 ++- charts/static-site/PROVENANCE.md | 18 ++++ charts/static-site/charts/common-0.7.0.tgz | Bin 3092 -> 0 bytes charts/static-site/charts/common/.helmignore | 23 +++++ charts/static-site/charts/common/Chart.yaml | 5 ++ .../charts/common/templates/_configmap.yaml | 16 ++++ .../charts/common/templates/_container.yaml | 54 ++++++++++++ .../templates/_customFileConfigmap.yaml | 16 ++++ .../charts/common/templates/_envFromRef.yaml | 31 +++++++ .../charts/common/templates/_fileSecret.yaml | 15 ++++ .../charts/common/templates/_helpers.tpl | 10 +++ .../charts/common/templates/_podSpec.yaml | 83 ++++++++++++++++++ .../charts/common/templates/_pvc.yaml | 26 ++++++ .../common/templates/_sealedFileSecret.yaml | 26 ++++++ .../common/templates/_sealedSecret.yaml | 22 +++++ .../common/templates/_volumeMountsRef.yaml | 39 ++++++++ .../charts/common/templates/_volumesRef.yaml | 48 ++++++++++ charts/static-site/ci/ct-values.yaml | 20 +++++ charts/static-site/values.yaml | 4 +- 20 files changed, 466 insertions(+), 7 deletions(-) delete mode 100644 charts/static-site/charts/common-0.7.0.tgz create mode 100644 charts/static-site/charts/common/.helmignore create mode 100644 charts/static-site/charts/common/Chart.yaml create mode 100644 charts/static-site/charts/common/templates/_configmap.yaml create mode 100644 charts/static-site/charts/common/templates/_container.yaml create mode 100644 charts/static-site/charts/common/templates/_customFileConfigmap.yaml create mode 100644 charts/static-site/charts/common/templates/_envFromRef.yaml create mode 100644 charts/static-site/charts/common/templates/_fileSecret.yaml create mode 100644 charts/static-site/charts/common/templates/_helpers.tpl create mode 100644 charts/static-site/charts/common/templates/_podSpec.yaml create mode 100644 charts/static-site/charts/common/templates/_pvc.yaml create mode 100644 charts/static-site/charts/common/templates/_sealedFileSecret.yaml create mode 100644 charts/static-site/charts/common/templates/_sealedSecret.yaml create mode 100644 charts/static-site/charts/common/templates/_volumeMountsRef.yaml create mode 100644 charts/static-site/charts/common/templates/_volumesRef.yaml create mode 100644 charts/static-site/ci/ct-values.yaml diff --git a/charts/static-site/Chart.lock b/charts/static-site/Chart.lock index a4854e6..93acb9e 100644 --- a/charts/static-site/Chart.lock +++ b/charts/static-site/Chart.lock @@ -1,6 +1,6 @@ dependencies: - name: common - repository: file://../common + repository: file://charts/common version: 0.7.0 -digest: sha256:a97ffdc0ab67ba57b6fb03ab3f98bbbc488f0630f2160b75e937c27d19a2fa08 -generated: "2024-09-09T08:36:50.241133151Z" +digest: sha256:add56ef2d982ba863c26d56ce67dbdab941634dc81301cea01221a22ccce8bc4 +generated: "2026-08-12T09:57:03.192194304+02:00" diff --git a/charts/static-site/Chart.yaml b/charts/static-site/Chart.yaml index 7c91056..a651b26 100644 --- a/charts/static-site/Chart.yaml +++ b/charts/static-site/Chart.yaml @@ -14,9 +14,16 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.73.0 +version: 0.73.1 + +home: https://www.ethswarm.org +icon: https://docs.ethswarm.org/img/swarm-logo-2.svg + +maintainers: + - name: darkobas + email: devops@ethswarm.org dependencies: - name: common version: 0.7.0 - repository: file://../common + repository: file://charts/common diff --git a/charts/static-site/PROVENANCE.md b/charts/static-site/PROVENANCE.md index d7841f4..a43ecc1 100644 --- a/charts/static-site/PROVENANCE.md +++ b/charts/static-site/PROVENANCE.md @@ -11,3 +11,21 @@ to keep existing deployments installable. - Upstream licence: Apache-2.0 (see `LICENSE` in this directory) - Templates are unmodified; `helm template` output is byte-for-byte identical to the original `static-site-0.73.0.tgz` artifact. + +## Local versions + +Templates and values remain upstream `v0.73.0` verbatim. The chart version is +bumped locally only when repackaging metadata changes, because `chart-testing` +requires a version bump for any modified chart. + +- `0.73.0` - initial vendoring. +- `0.73.1` - declare the vendored `common` subchart as + `repository: file://charts/common` and ship it unpacked rather than as a + tarball. Upstream's `file://../common` assumed onechart's monorepo layout and + broke `helm dependency update`, which failed the Release workflow for the + whole repository. Also strips two trailing-whitespace occurrences from + `values.yaml` that `chart-testing`'s yamllint rejects. No template changes + and no semantic values changes; rendered output is unchanged apart from the + `helm.sh/chart` version label. Adds the `maintainers`, `home` and `icon` + metadata that `chart-testing` requires and that the other charts in this + repository already carry; upstream shipped none. diff --git a/charts/static-site/charts/common-0.7.0.tgz b/charts/static-site/charts/common-0.7.0.tgz deleted file mode 100644 index d39ef9cba1364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)L_!!QV+ zUw*t)Tww4N&drvE_ve=oQz3(JOx2a1aj3Rd5ihsea~yj)Q~$4W7b#A}G%!ynOyb24O1rUl^$%q%o31TU_wJ if^a4y9^>J+C+$1h(T;XBr+)_k0RR7fcAIqoSO5S85hbnw diff --git a/charts/static-site/charts/common/.helmignore b/charts/static-site/charts/common/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/charts/static-site/charts/common/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/charts/static-site/charts/common/Chart.yaml b/charts/static-site/charts/common/Chart.yaml new file mode 100644 index 0000000..8215328 --- /dev/null +++ b/charts/static-site/charts/common/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v2 +description: A Helm chart for Kubernetes +name: common +type: library +version: 0.7.0 diff --git a/charts/static-site/charts/common/templates/_configmap.yaml b/charts/static-site/charts/common/templates/_configmap.yaml new file mode 100644 index 0000000..6b06160 --- /dev/null +++ b/charts/static-site/charts/common/templates/_configmap.yaml @@ -0,0 +1,16 @@ +{{- define "common.configmap.tpl" -}} +{{- if .Values.vars }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "common.robustName" .Release.Name }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "helm-chart.labels" . | nindent 4 }} +data: +{{- range $key, $val := .Values.vars }} + {{ $key }}: {{ $val | quote }} +{{- end }} +{{- end }} +{{- end -}} diff --git a/charts/static-site/charts/common/templates/_container.yaml b/charts/static-site/charts/common/templates/_container.yaml new file mode 100644 index 0000000..f0649f4 --- /dev/null +++ b/charts/static-site/charts/common/templates/_container.yaml @@ -0,0 +1,54 @@ +{{- define "common.container.tpl" -}} +name: {{ template "robustName" .Release.Name }} +securityContext: + {{- toYaml .Values.securityContext | nindent 2 }} +image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" +imagePullPolicy: {{ .Values.image.pullPolicy }} +{{- if .Values.command }} +command: + - {{ .Values.shell }} + - -c + - {{ .Values.command | quote }} +{{- end }} +ports: + {{- if not .Values.ports }} + - name: http + containerPort: {{ .Values.containerPort }} + protocol: TCP + {{- else }} + {{- range .Values.ports }} + - name: {{ .name }} + containerPort: {{ .containerPort }} + protocol: TCP + {{- end }} + {{- end }} +{{- if .Values.probe.enabled }} +readinessProbe: + httpGet: + path: {{ .Values.probe.path }} + port: {{ .Values.containerPort }} + scheme: HTTP + {{- with .Values.probe.settings }} + {{- toYaml . | nindent 2 }} + {{- end }} +{{- end }} +{{- if .Values.livenessProbe.enabled }} +livenessProbe: + httpGet: + path: {{ .Values.livenessProbe.path }} + port: {{ .Values.containerPort }} + scheme: HTTP + {{- with .Values.livenessProbe.settings }} + {{- toYaml . | nindent 2 }} + {{- end }} +{{- end }} +{{- if not .Values.resources.ignore }} +resources: + {{- if .Values.resources.ignoreLimits }} + requests: + {{- toYaml .Values.resources.requests | nindent 4 }} + {{- else }} + {{- toYaml .Values.resources | nindent 2 }} + {{- end }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/static-site/charts/common/templates/_customFileConfigmap.yaml b/charts/static-site/charts/common/templates/_customFileConfigmap.yaml new file mode 100644 index 0000000..2ca2369 --- /dev/null +++ b/charts/static-site/charts/common/templates/_customFileConfigmap.yaml @@ -0,0 +1,16 @@ +{{- define "common.customFileConfigmap.tpl" -}} +{{- range .Values.volumes }} + {{- if .fileName }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "common.robustName" (printf "%s-%s" $.Release.Name .name) }} + namespace: {{ $.Release.Namespace }} +data: + {{ .fileName }}: | + {{- .fileContent | nindent 4 }} + + {{- end }} +{{- end }} +{{- end -}} diff --git a/charts/static-site/charts/common/templates/_envFromRef.yaml b/charts/static-site/charts/common/templates/_envFromRef.yaml new file mode 100644 index 0000000..e8543cb --- /dev/null +++ b/charts/static-site/charts/common/templates/_envFromRef.yaml @@ -0,0 +1,31 @@ +{{- define "common.envFromRef.tpl" -}} +{{- if or (or (or (or (or (.Values.vars) (.Values.secretEnabled)) .Values.sealedSecrets) .Values.secretName) .Values.existingConfigMaps) .Values.existingSecrets -}} +envFrom: +{{- if .Values.vars }} + - configMapRef: + name: {{ template "common.robustName" .Release.Name }} +{{- end }} +{{- range .Values.existingSecrets }} + - secretRef: + name: {{ .name }} + optional: {{ .optional | default false }} +{{- end }} +{{- range .Values.existingConfigMaps }} + - configMapRef: + name: {{ .name }} + optional: {{ .optional | default false }} +{{- end }} +{{- if .Values.secretEnabled }} + - secretRef: + name: {{ include "common.robustName" $.Release.Name }} +{{- end }} +{{- if .Values.secretName }} + - secretRef: + name: {{ .Values.secretName }} +{{- end }} +{{- if .Values.sealedSecrets }} + - secretRef: + name: {{ template "common.robustName" .Release.Name }} +{{- end }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/static-site/charts/common/templates/_fileSecret.yaml b/charts/static-site/charts/common/templates/_fileSecret.yaml new file mode 100644 index 0000000..b53db34 --- /dev/null +++ b/charts/static-site/charts/common/templates/_fileSecret.yaml @@ -0,0 +1,15 @@ +{{- define "common.fileSecret.tpl" -}} +{{- range .Values.fileSecrets }} +--- +kind: Secret +apiVersion: v1 +type: Opaque +metadata: + name: {{ printf "%s-%s" $.Release.Name .name }} + namespace: {{ $.Release.Namespace }} +data: +{{- range $key, $val := .secrets }} + {{ $key }}: {{ $val | b64enc }} +{{- end }} +{{- end }} +{{- end -}} diff --git a/charts/static-site/charts/common/templates/_helpers.tpl b/charts/static-site/charts/common/templates/_helpers.tpl new file mode 100644 index 0000000..24ea469 --- /dev/null +++ b/charts/static-site/charts/common/templates/_helpers.tpl @@ -0,0 +1,10 @@ +{{/* vim: set filetype=mustache: */}} + +{{/* +Create robustName that can be used as Kubernetes resource name, and as subdomain as well +\w – Latin letters, digits, underscore '_' . +\W – all but \w . +*/}} +{{- define "common.robustName" -}} +{{ regexReplaceAll "\\W+" . "-" | replace "_" "-" | lower | trunc 63 | trimSuffix "-" }} +{{- end }} diff --git a/charts/static-site/charts/common/templates/_podSpec.yaml b/charts/static-site/charts/common/templates/_podSpec.yaml new file mode 100644 index 0000000..f7620d5 --- /dev/null +++ b/charts/static-site/charts/common/templates/_podSpec.yaml @@ -0,0 +1,83 @@ +{{- define "common.podSpec.tpl" -}} +{{- with .Values.imagePullSecrets }} +imagePullSecrets: + {{- range . }} + - name: {{ . }} + {{- end }} +{{- end }} +securityContext: + {{- toYaml .Values.podSecurityContext | nindent 2 }} +{{- if .Values.serviceAccount }} +serviceAccountName: {{ .Values.serviceAccount }} +{{- end }} +initContainers: + {{- range .Values.initContainers }} + - name: {{ .name }} + image: "{{ .image }}:{{ .tag }}" + imagePullPolicy: {{ .imagePullPolicy | default "IfNotPresent" }} + {{- include "common.envFromRef.tpl" $ | nindent 4 }} + {{- if .command }} + command: + - {{ $.Values.shell }} + - -c + - {{ .command | quote}} + {{- end }} + volumeMounts: + {{- range $.Values.volumes }} + {{- if (or (hasPrefix "shared-" .name) (hasPrefix "init-" .name))}} + - mountPath: {{ .path }} + name: {{ .name }} + {{- end }} + {{- end }} + {{- if .securityContext }} + securityContext: + {{- toYaml .securityContext | nindent 6 }} + {{- end}} + {{- end }} +containers: + {{- $containerTpl := include "common.container.tpl" . | fromYaml }} + {{- $container := mergeOverwrite $containerTpl .Values.container }} + - {{ toYaml $container | nindent 4 }} + {{- include "common.envFromRef.tpl" . | nindent 4 }} + {{- include "common.volumeMountsRef.tpl" . | nindent 4 }} + {{- if .Values.sidecar }} + - name: {{ template "robustName" .Release.Name }}-sidecar + securityContext: + {{- toYaml .Values.securityContext | nindent 6 }} + image: {{ .Values.sidecar.repository }}:{{ .Values.sidecar.tag }} + {{- if .Values.sidecar.command }} + command: + - {{ .Values.sidecar.shell }} + - -c + - {{ .Values.sidecar.command | quote }} + {{- end }} + {{- include "common.envFromRef.tpl" . | nindent 4 }} + {{- include "common.volumeMountsRef.tpl" . | nindent 4 }} + {{- end }} +{{- include "common.volumesRef.tpl" . }} +{{- with .Values.nodeSelector }} +nodeSelector: + {{- toYaml . | nindent 2 }} +{{- end }} +{{- if or .Values.spreadAcrossNodes .Values.affinity }} +affinity: + {{- if .Values.spreadAcrossNodes }} + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: "app.kubernetes.io/instance" + operator: In + values: + - {{ template "robustName" .Release.Name }} + topologyKey: "kubernetes.io/hostname" + {{- end }} + {{- if .Values.affinity }} + {{- toYaml .Values.affinity | nindent 2 }} + {{- end }} +{{- end }} +{{- with .Values.tolerations }} +tolerations: + {{- toYaml . | nindent 2 }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/static-site/charts/common/templates/_pvc.yaml b/charts/static-site/charts/common/templates/_pvc.yaml new file mode 100644 index 0000000..f1965ae --- /dev/null +++ b/charts/static-site/charts/common/templates/_pvc.yaml @@ -0,0 +1,26 @@ +{{- define "common.pvc.tpl" -}} +{{- range .Values.volumes }} +{{- if not (or .existingClaim .hostPath .fileName .emptyDir .existingConfigMap) }} +{{- $robustName := include "common.robustName" $.Release.Name }} +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ printf "%s-%s" $robustName .name }} + namespace: {{ $.Release.Namespace }} + {{- if .pvcAnnotations }} + annotations: + {{- toYaml .pvcAnnotations | nindent 4 }} + {{- end }} +spec: + accessModes: + - {{ .accessMode | default "ReadWriteOnce" }} + {{- if .storageClass }} + storageClassName: {{ .storageClass }} + {{- end }} + resources: + requests: + storage: {{ .size | default "1Gi" }} +{{- end }} +{{- end }} +{{- end -}} \ No newline at end of file diff --git a/charts/static-site/charts/common/templates/_sealedFileSecret.yaml b/charts/static-site/charts/common/templates/_sealedFileSecret.yaml new file mode 100644 index 0000000..b47ebe6 --- /dev/null +++ b/charts/static-site/charts/common/templates/_sealedFileSecret.yaml @@ -0,0 +1,26 @@ +{{- define "common.sealedFileSecret.tpl" -}} +{{- range .Values.sealedFileSecrets }} +{{- $robustName := include "common.robustName" $.Release.Name }} +--- +apiVersion: bitnami.com/v1alpha1 +kind: SealedSecret +metadata: + name: {{ printf "%s-%s" $robustName .name }} + namespace: {{ $.Release.Namespace }} + annotations: + sealedsecrets.bitnami.com/cluster-wide: "true" +spec: + encryptedData: + {{- range $f := .filesToMount }} + {{ $f.name }}: |- + {{- $f.source | nindent 6 }} + {{- /* + {{- $.Files.Get $f.sourcePath | nindent 6 }} + */}} + {{- end }} + template: + metadata: + name: {{ printf "%s-%s" $.Release.Name .name }} + namespace: {{ $.Release.Namespace }} +{{- end }} +{{- end -}} diff --git a/charts/static-site/charts/common/templates/_sealedSecret.yaml b/charts/static-site/charts/common/templates/_sealedSecret.yaml new file mode 100644 index 0000000..7bec2ee --- /dev/null +++ b/charts/static-site/charts/common/templates/_sealedSecret.yaml @@ -0,0 +1,22 @@ +{{- define "common.sealedSecret.tpl" -}} + {{- if .Values.sealedSecrets }} +apiVersion: bitnami.com/v1alpha1 +kind: SealedSecret +metadata: + name: {{ template "common.robustName" .Release.Name }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "helm-chart.labels" . | nindent 4 }} + annotations: + sealedsecrets.bitnami.com/cluster-wide: "true" +spec: + encryptedData: + {{- range $key, $val := .Values.sealedSecrets }} + {{ $key }}: {{ $val | quote }} + {{- end }} + template: + metadata: + name: {{ template "common.robustName" .Release.Name }} + namespace: {{ .Release.Namespace }} +{{- end }} +{{- end -}} diff --git a/charts/static-site/charts/common/templates/_volumeMountsRef.yaml b/charts/static-site/charts/common/templates/_volumeMountsRef.yaml new file mode 100644 index 0000000..4439369 --- /dev/null +++ b/charts/static-site/charts/common/templates/_volumeMountsRef.yaml @@ -0,0 +1,39 @@ +{{- define "common.volumeMountsRef.tpl" -}} +{{- if or (or (or (.Values.volumes) (.Values.sealedFileSecrets)) .Values.fileSecrets) .Values.existingFileSecrets -}} +volumeMounts: +{{- range .Values.volumes }} +{{- if not (hasPrefix "init-" .name) }} + - name: {{ .name }} + mountPath: {{ .path }} + {{- if .subPath }} + subPath: {{ .subPath }} + {{- end }} +{{- end }} +{{- end }} +{{- range .Values.sealedFileSecrets }} + - name: {{ .name }} + mountPath: {{ .path }} + {{- if .subPath}} + subPath: {{ .subPath }} + {{- end }} + readOnly: true +{{- end }} +{{- range .Values.fileSecrets }} + - name: {{ .name }} + mountPath: {{ .path }} + {{- if .subPath}} + subPath: {{ .subPath }} + {{- end }} + readOnly: true +{{- end }} +{{- range .Values.existingFileSecrets }} + - name: {{ .name }} + mountPath: {{ .path }} + {{- if .subPath}} + subPath: {{ .subPath }} + {{- end }} + readOnly: true +{{- end }} +{{- end }} +{{- end }} + diff --git a/charts/static-site/charts/common/templates/_volumesRef.yaml b/charts/static-site/charts/common/templates/_volumesRef.yaml new file mode 100644 index 0000000..37a580a --- /dev/null +++ b/charts/static-site/charts/common/templates/_volumesRef.yaml @@ -0,0 +1,48 @@ +{{- define "common.volumesRef.tpl" }} +{{- if or (or (or (.Values.volumes) (.Values.sealedFileSecrets)) .Values.fileSecrets) .Values.existingFileSecrets }} +volumes: + {{- range .Values.volumes }} + - name: {{ .name }} + {{- if .emptyDir }} + emptyDir: {} + {{- else if .existingConfigMap }} + configMap: + name: {{ .existingConfigMap }} + {{- else if .existingSecret }} + secret: + secretName: {{ .existingSecret }} + {{- else if .fileName }} + configMap: + name: {{ template "common.robustName" (printf "%s-%s" $.Release.Name .name) }} + {{- else if .hostPath }} + hostPath: + path: {{ .hostPath.path }} + {{- if .hostPath.type }} + type: {{ .hostPath.type }} + {{- end }} + {{- else }} + persistentVolumeClaim: + {{- if .existingClaim }} + claimName: {{ .existingClaim }} + {{ else }} + claimName: {{ printf "%s-%s" $.Release.Name .name }} + {{- end }} + {{- end }} +{{- end }} + {{- range .Values.sealedFileSecrets }} + - name: {{ .name }} + secret: + secretName: {{ printf "%s-%s" $.Release.Name .name }} + {{- end }} + {{- range .Values.fileSecrets }} + - name: {{ .name }} + secret: + secretName: {{ printf "%s-%s" $.Release.Name .name }} + {{- end }} + {{- range .Values.existingFileSecrets }} + - name: {{ .name }} + secret: + secretName: {{ .name }} + {{- end }} +{{- end }} +{{- end }} diff --git a/charts/static-site/ci/ct-values.yaml b/charts/static-site/ci/ct-values.yaml new file mode 100644 index 0000000..f1b6b67 --- /dev/null +++ b/charts/static-site/ci/ct-values.yaml @@ -0,0 +1,20 @@ +# Values used by chart-testing for the install test. +# +# The chart's defaults clone gimlet-io/reactjs-test-app and run a full +# `npm install && npm run build`. That needs the npm registry, takes minutes, +# and the upstream demo repo belongs to an org that was archived in 2025 - so +# `ct install` against the defaults crash-loops the init container and can +# never go green. +# +# Clone this repository instead (always reachable from the runner) and emit a +# trivial asset. Exercises the same code path the chart actually ships: +# git clone -> build script -> copy builtAssets into /usr/share/nginx/html. +# +# buildImage stays at the chart's default node:latest - it already has git and +# sh, and the CI runner demonstrably pulls it, so this introduces no new image +# dependency. +gitCloneUrl: https://github.com/ethersphere/helm.git +buildImage: node:latest +buildScript: | + mkdir -p build && printf 'ok\n' > build/index.html +builtAssets: build/ diff --git a/charts/static-site/values.yaml b/charts/static-site/values.yaml index 3c75229..9dec2fa 100644 --- a/charts/static-site/values.yaml +++ b/charts/static-site/values.yaml @@ -18,7 +18,7 @@ podAnnotations: {} podSecurityContext: {} # fsGroup: 2000 -securityContext: +securityContext: # capabilities: # drop: # - ALL @@ -38,7 +38,7 @@ service: # cert-manager.io/cluster-issuer: letsencrypt-staging -resources: +resources: requests: cpu: 200m memory: 200Mi