diff --git a/.github/workflows/lint-test.yaml b/.github/workflows/lint-test.yaml index 6db580e9..9e9e3b07 100644 --- a/.github/workflows/lint-test.yaml +++ b/.github/workflows/lint-test.yaml @@ -96,6 +96,11 @@ jobs: ct install --config ./default.ct.yaml --helm-extra-args "--timeout 30m" if: ${{ contains(github.event.pull_request.labels.*.name, 'next-release') }} + - name: Run chart-testing (upgrade changed next-release only) + run: | + ct install --upgrade --config ./default.ct.yaml --helm-extra-args "--timeout 30m" + if: ${{ contains(github.event.pull_request.labels.*.name, 'next-release') }} + - name: Run chart-testing (install all charts when required) run: ct install --config ./default.ct.yaml --helm-extra-args "--timeout 30m" --all if: ${{ contains(github.event.pull_request.labels.*.name, 'next-release') || contains(github.event.pull_request.labels.*.name, 'needs-testing') }} diff --git a/charts/lagoon-core/Chart.yaml b/charts/lagoon-core/Chart.yaml index 9c2c7518..8e21e1ac 100644 --- a/charts/lagoon-core/Chart.yaml +++ b/charts/lagoon-core/Chart.yaml @@ -21,7 +21,7 @@ type: application # 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: 1.46.0 +version: 1.47.0 # This is the version number of the application being deployed. This version # number should be incremented each time you make changes to the application. @@ -41,18 +41,4 @@ dependencies: annotations: artifacthub.io/changes: | - kind: changed - description: update values for local development - - kind: changed - description: bump minimum Kubernetes version to 1.25 - - kind: changed - description: added api-sidecar-handler container to api and webhooks2tasks - - kind: changed - description: update ssh-portal components to v0.37.0 - links: - - name: ssh-portal release - url: https://github.com/uselagoon/lagoon-ssh-portal/releases/tag/v0.37.0 - - kind: changed - description: update Lagoon appVersion to v2.20.0 - links: - - name: lagoon v2.20.0 release notes - url: https://docs.lagoon.sh/releases/2.20.0/ + description: add broker-flag-enable pre-upgrade job diff --git a/charts/lagoon-core/templates/_helpers.tpl b/charts/lagoon-core/templates/_helpers.tpl index 5c5b0951..ec90ca69 100644 --- a/charts/lagoon-core/templates/_helpers.tpl +++ b/charts/lagoon-core/templates/_helpers.tpl @@ -240,6 +240,15 @@ app.kubernetes.io/instance: {{ .Release.Name }} +{{/* +Create a default fully qualified app name for broker-flag-enable job. +*/}} +{{- define "lagoon-core.brokerFlagEnable.fullname" -}} +{{- include "lagoon-core.fullname" . }}-broker-flag-enable +{{- end }} + + + {{/* Create a default fully qualified app name for auth-server. */}} diff --git a/charts/lagoon-core/templates/broker.flag-enable.job.yaml b/charts/lagoon-core/templates/broker.flag-enable.job.yaml new file mode 100644 index 00000000..2f0d84c6 --- /dev/null +++ b/charts/lagoon-core/templates/broker.flag-enable.job.yaml @@ -0,0 +1,63 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: {{ include "lagoon-core.brokerFlagEnable.fullname" . }} + labels: + {{- include "lagoon-core.broker.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": pre-upgrade + "helm.sh/hook-weight": "-5" +spec: + backoffLimit: 2 + template: + metadata: + labels: + {{- include "lagoon-core.broker.selectorLabels" . | nindent 8 }} + spec: + restartPolicy: Never + securityContext: + {{- toYaml .Values.broker.securityContext | nindent 8 }} + terminationGracePeriodSeconds: 120 + containers: + - name: broker-flag-enable + args: + - /enable-feature-flags.sh + image: "{{ .Values.broker.image.repository }}:{{ coalesce .Values.broker.image.tag .Values.imageTag .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.broker.image.pullPolicy }} + command: + - /bin/sh + - -c + securityContext: + {{- toYaml .Values.broker.securityContext | nindent 10 }} + env: + - name: RABBITMQ_DEFAULT_PASS + valueFrom: + secretKeyRef: + name: {{ include "lagoon-core.broker.fullname" . }} + key: RABBITMQ_PASSWORD + - name: RABBITMQ_DEFAULT_USER + valueFrom: + secretKeyRef: + name: {{ include "lagoon-core.broker.fullname" . }} + key: RABBITMQ_USERNAME + - name: RABBITMQ_USE_LONGNAME + value: "true" + # these variables are used by the /cluster-rabbit.sh entrypoint + - name: POD_NAMESPACE + value: {{ .Release.Namespace | quote }} + - name: SERVICE_NAME + value: {{ include "lagoon-core.broker.fullname" . }} + {{- range $key, $val := .Values.broker.additionalEnvs }} + - name: {{ $key }} + value: {{ $val | quote }} + {{- end }} + resources: + {{- toYaml .Values.broker.resources | nindent 10 }} + {{- with .Values.broker.nodeSelector }} + nodeSelector: + {{ toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.broker.tolerations }} + tolerations: + {{ toYaml . | nindent 8 }} + {{- end }}