diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index a9950d32..45e1157e 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -49,16 +49,8 @@ jobs: if: steps.list-changed.outputs.changed == 'true' uses: helm/kind-action@v1.7.0 - - name: Configure docker credentials - if: steps.list-changed.outputs.changed == 'true' - run: | - kubectl create secret docker-registry iterativeai \ - --docker-server=docker.iterative.ai \ - --docker-username="${{ secrets.ITERATIVE_DOCKER_REGISTRY_USER }}" \ - --docker-password="${{ secrets.ITERATIVE_DOCKER_REGISTRY_PASSWORD }}" - - name: Run chart-testing (install) if: steps.list-changed.outputs.changed == 'true' run: | - ct install --namespace default --target-branch ${{ github.event.repository.default_branch }} --upgrade --debug \ - --helm-extra-set-args '--set imagePullSecrets[0].name=iterativeai' + ct lint-and-install --target-branch ${{ github.event.repository.default_branch }} --upgrade --debug \ + --helm-extra-set-args '--set ci=true --set imagePullSecrets[0].name=iterativeai --set dockerUsername="${{ secrets.ITERATIVE_DOCKER_REGISTRY_USER }}" --set dockerPassword="${{ secrets.ITERATIVE_DOCKER_REGISTRY_PASSWORD }}" --set dockerServer=docker.iterative.ai' diff --git a/charts/studio/Chart.yaml b/charts/studio/Chart.yaml index 1139fb82..8cd30d72 100644 --- a/charts/studio/Chart.yaml +++ b/charts/studio/Chart.yaml @@ -15,7 +15,7 @@ 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.2.3 +version: 0.2.4 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/studio/templates/_helpers.tpl b/charts/studio/templates/_helpers.tpl index 08b23348..6db3ab61 100644 --- a/charts/studio/templates/_helpers.tpl +++ b/charts/studio/templates/_helpers.tpl @@ -129,3 +129,7 @@ checksum/secret-studio: {{ include (print $.Template.BasePath "/secret-studio.ya {{- define "studio.basePath" -}} {{- printf "%s" .Values.global.basePath | trimPrefix "/" | trimSuffix "/" }} {{- end }} + +{{- define "dockerconfig" -}} +{{- printf "{\"auths\": {\"%s\": {\"auth\": \"%s\"}}}" .Values.dockerServer (printf "%s:%s" .Values.dockerUsername .Values.dockerPassword | b64enc) }} +{{- end }} diff --git a/charts/studio/templates/secret-docker-registry.yaml b/charts/studio/templates/secret-docker-registry.yaml new file mode 100644 index 00000000..2db96f2f --- /dev/null +++ b/charts/studio/templates/secret-docker-registry.yaml @@ -0,0 +1,9 @@ +{{- if (hasKey .Values "ci") }} +apiVersion: v1 +data: + .dockerconfigjson: {{ include "dockerconfig" . | b64enc | quote }} +kind: Secret +metadata: + name: iterativeai +type: kubernetes.io/dockerconfigjson +{{- end }} diff --git a/charts/studio/templates/secret-studio.yaml b/charts/studio/templates/secret-studio.yaml index 8465791c..3a3515d3 100644 --- a/charts/studio/templates/secret-studio.yaml +++ b/charts/studio/templates/secret-studio.yaml @@ -2,8 +2,10 @@ apiVersion: v1 kind: Secret metadata: name: studio + {{ if (not (hasKey .Values "ci")) }} annotations: "helm.sh/resource-policy": "keep" + {{ end }} labels: {{- include "studio.labels" . | nindent 4 }} type: Opaque