diff --git a/Makefile b/Makefile index 27e28b75..64088fcf 100644 --- a/Makefile +++ b/Makefile @@ -41,6 +41,9 @@ SKIP_ALL_DEPS = DISABLE_CORE_HARBOR = # Set to `true` to enable the elements of lagoon-core that talk to OpenSearch installs OPENSEARCH_INTEGRATION_ENABLED = false +# Ordinarily we shouldn't need to clear the API data as it's usually a first run. Set this +# variable on a test run to clear (what's clearable) first +CLEAR_API_DATA = false TIMEOUT = 30m HELM = helm @@ -56,7 +59,7 @@ fill-test-ci-values: && export token="$$($(KUBECTL) -n lagoon create token lagoon-build-deploy --duration 3h)" \ && export $$([ $(IMAGE_TAG) ] && echo imageTag='$(IMAGE_TAG)' || echo imageTag='latest') \ && export webhookHandler="lagoon-core-webhook-handler" \ - && export tests='$(TESTS)' imageRegistry='$(IMAGE_REGISTRY)' \ + && export tests='$(TESTS)' imageRegistry='$(IMAGE_REGISTRY)' clearApiData='$(CLEAR_API_DATA)' \ && valueTemplate=charts/lagoon-test/ci/linter-values.yaml \ && envsubst < $$valueTemplate.tpl > $$valueTemplate \ && cat $$valueTemplate diff --git a/charts/lagoon-test/ci/linter-values.yaml.tpl b/charts/lagoon-test/ci/linter-values.yaml.tpl index 221725a5..d2f94f44 100644 --- a/charts/lagoon-test/ci/linter-values.yaml.tpl +++ b/charts/lagoon-test/ci/linter-values.yaml.tpl @@ -14,6 +14,8 @@ localGit: localAPIDataWatcherPusher: image: repository: ${imageRegistry}/local-api-data-watcher-pusher + additonalEnvs: + CLEAR_API_DATA: ${clearApiData} tests: image: diff --git a/charts/lagoon-test/templates/local-api-data-watcher-pusher.job.yaml b/charts/lagoon-test/templates/local-api-data-watcher-pusher.job.yaml index 2efae436..0b35d692 100644 --- a/charts/lagoon-test/templates/local-api-data-watcher-pusher.job.yaml +++ b/charts/lagoon-test/templates/local-api-data-watcher-pusher.job.yaml @@ -50,6 +50,10 @@ spec: value: {{ .Values.minioPass | quote }} - name: TOKEN value: {{ required "A valid .Values.token required!" .Values.token | quote }} + {{- range $key, $val := .Values.localAPIDataWatcherPusher.additionalEnvs }} + - name: {{ $key }} + value: {{ $val | quote }} + {{- end }} resources: {{- toYaml .Values.localAPIDataWatcherPusher.resources | nindent 10 }} {{- with .Values.localAPIDataWatcherPusher.nodeSelector }} diff --git a/charts/lagoon-test/values.yaml b/charts/lagoon-test/values.yaml index 49108445..1a29b857 100644 --- a/charts/lagoon-test/values.yaml +++ b/charts/lagoon-test/values.yaml @@ -119,6 +119,9 @@ localAPIDataWatcherPusher: # Overrides the image tag whose default is the chart appVersion. tag: "" + additionalEnvs: + # CLEAR_API_DATA: true + podSecurityContext: {} securityContext: {}