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
4 changes: 2 additions & 2 deletions .github/workflows/helm-unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ on: [push, pull_request]

jobs:
build:
name: Run helm lint over the chart
name: Run helm unittest over the chart
# It has to be 24.04 because -latest has a podman version that is too old
runs-on: ubuntu-24.04

steps:
- name: Checkout Code
uses: actions/checkout@v6

- name: Run make helmlint
- name: Run make helmunittest
run: |
make helm-unittest
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ This chart is used to set up the basic building blocks in [Validated Patterns](h
| clusterGroup.argoCD.resourceHealthChecks[1].group | string | `"serving.kserve.io"` | |
| clusterGroup.argoCD.resourceHealthChecks[1].kind | string | `"InferenceService"` | |
| clusterGroup.argoCD.resourceTrackingMethod | string | `"label"` | |
| clusterGroup.argoCD.volumes | list | `[]` | |
| clusterGroup.extraObjects | object | `{}` | |
| clusterGroup.imperative.activeDeadlineSeconds | int | `3600` | |
| clusterGroup.imperative.adminClusterRoleName | string | `"imperative-admin-cluster-role"` | |
Expand Down
23 changes: 14 additions & 9 deletions templates/plumbing/argocd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,18 @@ spec:
name: trusted-hub-bundle
- emptyDir: {}
name: ca-bundles
{{- if len $.Values.clusterGroup.argoCD.volumes }}
{{ toYaml $.Values.clusterGroup.argoCD.volumes | indent 4 }}
{{- end }}
{{- if len $.Values.clusterGroup.argoCD.configManagementPlugins }}
- emptyDir: {}
name: cmp-tmp
{{- range $cmp := $.Values.clusterGroup.argoCD.configManagementPlugins }}
- configMap:
name: "argocd-cmp-{{ $cmp.name }}"
name: {{ $cmp.name }}
{{- end }}
{{- end }}
{{- if len $.Values.clusterGroup.argoCD.configManagementPlugins }}
sidecarContainers:
{{- range $cmp := $.Values.clusterGroup.argoCD.configManagementPlugins }}
Expand All @@ -123,17 +135,10 @@ spec:
subPath: plugin.yaml
name: {{ $cmp.name }}
{{- end }}
{{- if $cmp.volumeMounts }}
{{ toYaml $cmp.volumeMounts | indent 10 }}
{{- end }}
{{- end }}
{{- if len $.Values.clusterGroup.argoCD.configManagementPlugins }}
volumes:
- emptyDir: {}
name: cmp-tmp
{{- range $cmp := $.Values.clusterGroup.argoCD.configManagementPlugins }}
- configMap:
name: "argocd-cmp-{{ $cmp.name }}"
name: {{ $cmp.name }}
{{- end }}
{{- end }}
{{- if $.Values.clusterGroup.argoCD.resourceExclusions }}
resourceExclusions: {{- $.Values.clusterGroup.argoCD.resourceExclusions | toYaml | indent 2 }}
Expand Down
52 changes: 52 additions & 0 deletions tests/argocd_cmp_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
suite: Test argocd with configManagementPlugins
templates:
- templates/plumbing/argocd.yaml
release:
name: release-test
tests:
- it: should render the volumes and the sidecarContainer from CMP correctly
set:
clusterGroup:
argoCD:
configManagementPlugins:
- name: test-cmp
image: test-cmp-img
pluginConfig: |
test-cmp-config
volumeMounts:
- mountPath: /test
name: test-cmp-volumemount
documentIndex: 0
asserts:
- contains:
path: spec.repo.volumes
content:
emptyDir: {}
name: cmp-tmp
- contains:
path: spec.repo.volumes
content:
configMap:
name: argocd-cmp-test-cmp
name: test-cmp
- contains:
path: spec.repo.sidecarContainers
content:
name: test-cmp
command: [/var/run/argocd/argocd-cmp-server]
image: test-cmp-img
imagePullPolicy: Always
securityContext:
runAsNonRoot: true
volumeMounts:
- mountPath: /var/run/argocd
name: var-files
- mountPath: /home/argocd/cmp-server/plugins
name: plugins
- mountPath: /tmp
name: cmp-tmp
- mountPath: /home/argocd/cmp-server/config/plugin.yaml
subPath: plugin.yaml
name: test-cmp
- mountPath: /test
name: test-cmp-volumemount
29 changes: 29 additions & 0 deletions tests/argocd_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -203,3 +203,32 @@ tests:
- echo
image: test
name: test

- it: should render volumes correctly when configManagementPlugins is set
set:
clusterGroup:
argoCD:
configManagementPlugins:
- name: test
image: test
pluginConfig: |
test
documentIndex: 0
asserts:
- contains:
path: spec.repo.volumes
content:
configMap:
name: kube-root-ca.crt
name: kube-root-ca
- contains:
path: spec.repo.volumes
content:
emptyDir: {}
name: cmp-tmp
- contains:
path: spec.repo.volumes
content:
configMap:
name: argocd-cmp-test
name: test
20 changes: 20 additions & 0 deletions tests/argocd_volumes_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
suite: Test argocd with volumes
templates:
- templates/plumbing/argocd.yaml
release:
name: release-test
tests:
- it: should render the additional custom volumes correctly
set:
clusterGroup:
argoCD:
volumes:
- emptyDir: {}
name: test
documentIndex: 0
asserts:
- contains:
path: spec.repo.volumes
content:
emptyDir: {}
name: test
10 changes: 9 additions & 1 deletion values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,10 @@
"type": "array",
"description": "A list of initContainers to add to the repo-server if needed"
},
"volumes": {
"type": "array",
"description": "A list of volumes to add to the repo-server if needed"
},
"resourceTrackingMethod": {
"type": "string",
"description": "ResourceTrackingMethod defines how Argo CD should track resources that it manages",
Expand All @@ -700,7 +704,7 @@
},
"ArgoCDConfigManagementPlugin": {
"type": "object",
"additionalProperties": true,
"additionalProperties": false,
"properties": {
"name": {
"type": "string",
Expand All @@ -714,6 +718,10 @@
"type": "string",
"description": "Image pull policy for the sidecar. Defaults to 'Always'"
},
"volumeMounts": {
"type": "array",
"description": "Additional volumeMounts for the sidecar"
},
"pluginConfig": {
"type": "string",
"description": "Configuration file to project into sidecar container. This will create a configMap if specified"
Expand Down
1 change: 1 addition & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ clusterGroup:

argoCD:
initContainers: []
volumes: []
configManagementPlugins: []
# resource tracking can be set to annotation, label, or annotation+label
resourceTrackingMethod: label
Expand Down