Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions charts/gitops-runtime/templates/app-proxy/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
{{- $_ := set $appProxyContext.Values "redis" (get .Values "redis") }}
{{- $_ := set $appProxyContext.Values "redis-ha" (get .Values "redis-ha") }}

{{- $_ := set $appProxyContext.Values.podAnnotations "checksum/config-codefresh-cm" (include (print $.Template.BasePath "/codefresh-cm.yaml") . | sha256sum) }}
{{- $_ := set $appProxyContext.Values.podAnnotations "checksum/config-cap-app-proxy" (include (print $.Template.BasePath "/app-proxy/config.yaml") . | sha256sum) }}

{{/* Merge environment variables with the ones in _app-proxy-env.yaml */}}
{{- $mainContainerMergedValues := mergeOverwrite $appProxyContext.Values.env (include "codefresh-gitops-runtime.app-proxy.calculated-env-vars" . | fromYaml) }}
{{- $_ := set $appProxyContext.Values "env" $mainContainerMergedValues }}
Expand Down
5 changes: 0 additions & 5 deletions charts/gitops-runtime/templates/argo-gateway/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,3 @@ metadata:
{{- include "argo-gateway.labels" . | nindent 4 }}
data:
{{- $mergedConfig | toYaml | nindent 2 }}
{{- if index .Values "argo-cd" "enabled" }}
foo: bar
{{- else }}
baz: qux
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ spec:
{{- include "argo-gateway.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with $context.Values.podAnnotations }}
annotations:
checksum/config-argo-gateway: {{ include (print $.Template.BasePath "/argo-gateway/configmap.yaml") . | sha256sum }}
checksum/config-codefresh-cm: {{ include (print $.Template.BasePath "/codefresh-cm.yaml") . | sha256sum }}
{{- with $context.Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,13 @@ spec:
{{- include "cluster-event-reporter.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with $context.Values.podAnnotations }}
annotations:
checksum/config-event-reporter: {{ include (print $.Template.BasePath "/event-reporters/cluster-event-reporter/configmap.yaml") . | sha256sum }}
checksum/config-codefresh-cm: {{ include (print $.Template.BasePath "/codefresh-cm.yaml") . | sha256sum }}
{{- if index .Values "argo-cd" "enabled" }}
checksum/config-argocd: {{ include ("argo-cd.config.params") (index .Subcharts "argo-cd") | sha256sum }}
{{- end }}
{{- with $context.Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,13 @@ spec:
{{- include "runtime-event-reporter.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with $context.Values.podAnnotations }}
annotations:
checksum/config-event-reporter: {{ include (print $.Template.BasePath "/event-reporters/runtime-event-reporter/configmap.yaml") . | sha256sum }}
checksum/config-codefresh-cm: {{ include (print $.Template.BasePath "/codefresh-cm.yaml") . | sha256sum }}
{{- if index .Values "argo-cd" "enabled" }}
checksum/config-argocd: {{ include ("argo-cd.config.params") (index .Subcharts "argo-cd") | sha256sum }}
{{- end }}
{{- with $context.Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
Expand Down
7 changes: 5 additions & 2 deletions charts/gitops-runtime/tests/app-proxy-hosted_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ suite: Test hosted runtime flow in app-proxy
templates:
- app-proxy/deployment.yaml
- app-proxy/config.yaml
- _components/cap-app-proxy/_deployment.yaml
- _components/cap-app-proxy/_config.yaml
- codefresh-cm.yaml
tests:
- it: accountId appears in app-proxy env if provided - used in hosted
template: 'app-proxy/deployment.yaml'
Expand All @@ -26,7 +29,7 @@ tests:
global.codefresh.accountId: ""
asserts:
- failedTemplate:
errorMessage: 'global.codefresh.accountId must be provided for hosted runtimes'
errorMessage: 'global.codefresh.accountId is required for tunnel based runtime'

- it: accountId appears in app-proxy env and runtime type is HELM_HOSTED
template: 'app-proxy/deployment.yaml'
Expand Down Expand Up @@ -66,4 +69,4 @@ tests:
path: spec.template.spec.containers[0].env
content:
name: INSTALLATION_TYPE
value: "HELM_HOSTED"
value: "HELM_HOSTED"
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ templates:
- app-proxy/enrichment/sa.yaml
- app-proxy/enrichment/rbac.yaml
- app-proxy/enrichment/enforce-workflows-enabled.yaml
- _components/cap-app-proxy/_deployment.yaml
- _components/cap-app-proxy/_config.yaml
- codefresh-cm.yaml
tests:
- it: Fail template if enrichment is enabled and workflows disabled
template: 'app-proxy/enrichment/enforce-workflows-enabled.yaml'
Expand Down
5 changes: 4 additions & 1 deletion charts/gitops-runtime/tests/app-proxy-misc_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ suite: misc tests on app-proxy templates generation
templates:
- app-proxy/deployment.yaml
- app-proxy/config.yaml
- _components/cap-app-proxy/_deployment.yaml
- _components/cap-app-proxy/_config.yaml
- codefresh-cm.yaml
tests:
- it: overriding of environment variables on main container
template: 'app-proxy/deployment.yaml'
Expand Down Expand Up @@ -222,7 +225,7 @@ tests:
mountPath: /my-secret

- it: Fail template if runtime name not provided
template: 'app-proxy/config.yaml'
template: 'app-proxy/deployment.yaml'
set:
global.codefresh.userToken.token: dummy
global.codefresh.accountId: asddd
Expand Down
1 change: 1 addition & 0 deletions charts/gitops-runtime/tests/argo-api-gateway_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
suite: argo-gateway tests
templates:
- argo-gateway/**
- codefresh-cm.yaml
tests:
- it: Argo Api Gateway ConfigMap should have valid data
template: argo-gateway/configmap.yaml
Expand Down
29 changes: 29 additions & 0 deletions charts/gitops-runtime/tests/checksum_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
suite: checksum tests
templates:
- event-reporters/**/deployment.yaml
- event-reporters/**/configmap.yaml
- argo-gateway/deployment.yaml
- argo-gateway/configmap.yaml
- app-proxy/deployment.yaml
- app-proxy/config.yaml
- _components/cap-app-proxy/_deployment.yaml
- _components/cap-app-proxy/_config.yaml
- codefresh-cm.yaml
tests:
- it: default checksum annotations is present
values:
- ./values/mandatory-values-ingress.yaml
asserts:
- exists:
path: spec.template.metadata.annotations["checksum/config-argo-gateway"]
template: argo-gateway/deployment.yaml
- exists:
path: spec.template.metadata.annotations["checksum/config-event-reporter"]
template: event-reporters/cluster-event-reporter/deployment.yaml
- exists:
path: spec.template.metadata.annotations["checksum/config-argocd"]
template: event-reporters/cluster-event-reporter/deployment.yaml
- exists:
path: spec.template.metadata.annotations["checksum/config-cap-app-proxy"]
template: app-proxy/deployment.yaml
4 changes: 4 additions & 0 deletions charts/gitops-runtime/tests/custom-ca_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ templates:
- tls-custom-ca/codefresh-tls-certs.yaml
- tls-custom-ca/workflow-pipelines-git-webhooks.yaml
- app-proxy/deployment.yaml
- app-proxy/config.yaml
- hooks/pre-uninstall/delete-runtime-from-platform.yaml
- gitops-operator/*
- _components/gitops-operator/*
- _components/cap-app-proxy/_deployment.yaml
- _components/cap-app-proxy/_config.yaml
- codefresh-cm.yaml
tests:

- it: test chart created secret contents - default secret key
Expand Down
1 change: 1 addition & 0 deletions charts/gitops-runtime/tests/event-reporters_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
suite: argo-gateway tests
templates:
- event-reporters/**/*.yaml
- codefresh-cm.yaml
tests:
- it: Runtime Reporter should be deployed with forked ArgoCD
template: event-reporters/runtime-event-reporter/deployment.yaml
Expand Down
4 changes: 4 additions & 0 deletions charts/gitops-runtime/tests/global_constraints_test.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
suite: Test global constraints (nodeSelector, tolerations)
templates:
- app-proxy/deployment.yaml
- app-proxy/config.yaml
- gitops-operator/*
- event-reporters/**
- argo-gateway/**
Expand All @@ -15,6 +16,9 @@ templates:
- charts/argo-events/*
- charts/argo-rollouts/*
- charts/argo-workflows/*
- _components/cap-app-proxy/_deployment.yaml
- _components/cap-app-proxy/_config.yaml
- codefresh-cm.yaml
values:
- ./values/mandatory-values.yaml
tests:
Expand Down
4 changes: 4 additions & 0 deletions charts/gitops-runtime/tests/installation-token_test.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
suite: test installation token in app proxy
templates:
- app-proxy/deployment.yaml
- app-proxy/config.yaml
- installation-token-secret.yaml
- _components/cap-app-proxy/_deployment.yaml
- _components/cap-app-proxy/_config.yaml
- codefresh-cm.yaml

tests:
- it: app proxy plain string value
Expand Down
4 changes: 4 additions & 0 deletions charts/gitops-runtime/tests/redis_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ suite: redis tests
templates:
- cf-argocd-extras/**/*.yaml
- app-proxy/deployment.yaml
- app-proxy/config.yaml
- redis/**
- charts/redis-ha/**
- _components/cap-app-proxy/_deployment.yaml
- _components/cap-app-proxy/_config.yaml
- codefresh-cm.yaml
tests:
- it: Standalone Redis Deployment should be created by when redis.enabled is true
template: redis/deployment.yaml
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
suite: test runtime git credentials in app proxy
templates:
- app-proxy/deployment.yaml
- app-proxy/config.yaml
- git-password-secret.yaml

- _components/cap-app-proxy/_deployment.yaml
- _components/cap-app-proxy/_config.yaml
- codefresh-cm.yaml
tests:
- it: secret created for plain text value
template: 'git-password-secret.yaml'
Expand Down