From 0dc0b845a3667e043d45d15d51668402ee31b9a3 Mon Sep 17 00:00:00 2001 From: Alex Babel <13570439+AlexanderBabel@users.noreply.github.com> Date: Fri, 17 Dec 2021 19:39:07 +0100 Subject: [PATCH] fix(argo-cd): Merge duplicate initContainer entries introduced in 3.29.0 (#1058) * fix(repo-server): merge initContainer to one section Signed-off-by: Alex Babel * chore(argo-cd): bump version to 3.29.1 Signed-off-by: Alex Babel * Merge master into fix/repo-server-init-container Signed-off-by: Alex Babel * fix(argo-cd): add enableCopyutilInitContainer option Signed-off-by: Alex Babel * doc: update readme Signed-off-by: Alex Babel --- charts/argo-cd/Chart.yaml | 4 +-- charts/argo-cd/README.md | 1 + .../argocd-repo-server/deployment.yaml | 27 ++++++++++--------- charts/argo-cd/values.yaml | 3 +++ 4 files changed, 21 insertions(+), 14 deletions(-) diff --git a/charts/argo-cd/Chart.yaml b/charts/argo-cd/Chart.yaml index 14c4398a..2f2186a4 100644 --- a/charts/argo-cd/Chart.yaml +++ b/charts/argo-cd/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 appVersion: v2.2.1 description: A Helm chart for ArgoCD, a declarative, GitOps continuous delivery tool for Kubernetes. name: argo-cd -version: 3.29.1 +version: 3.29.2 home: https://github.com/argoproj/argo-helm icon: https://argo-cd.readthedocs.io/en/stable/assets/logo.png keywords: @@ -21,4 +21,4 @@ dependencies: condition: redis-ha.enabled annotations: artifacthub.io/changes: | - - "[Changed]: Update to app version 2.2.1" + - "[Fix]: repo-server: merge initContainer to one section" diff --git a/charts/argo-cd/README.md b/charts/argo-cd/README.md index caece20b..be610e24 100644 --- a/charts/argo-cd/README.md +++ b/charts/argo-cd/README.md @@ -316,6 +316,7 @@ NAME: my-release | repoServer.clusterRoleRules.rules | list | `[]` | List of custom rules for the Repo server's Cluster Role resource | | repoServer.containerPort | int | `8081` | Configures the repo server port | | repoServer.containerSecurityContext | object | `{}` | Repo server container-level security context | +| repoServer.enableCopyutilInitContainer | bool | `true` | Enable the copyutil init container | | repoServer.env | list | `[]` | Environment variables to pass to repo server | | repoServer.envFrom | list | `[]` (See [values.yaml]) | envFrom to pass to repo server | | repoServer.extraArgs | list | `[]` | Additional command line arguments to pass to repo server | diff --git a/charts/argo-cd/templates/argocd-repo-server/deployment.yaml b/charts/argo-cd/templates/argocd-repo-server/deployment.yaml index be260cdf..e0a8648c 100755 --- a/charts/argo-cd/templates/argocd-repo-server/deployment.yaml +++ b/charts/argo-cd/templates/argocd-repo-server/deployment.yaml @@ -34,17 +34,6 @@ spec: {{- if .Values.global.securityContext }} securityContext: {{- toYaml .Values.global.securityContext | nindent 8 }} {{- end }} - initContainers: - - command: - - cp - - -n - - /usr/local/bin/argocd - - /var/run/argocd/argocd-cmp-server - image: {{ default .Values.global.image.repository .Values.repoServer.image.repository }}:{{ default (include "argo-cd.defaultTag" .) .Values.repoServer.image.tag }} - name: copyutil - volumeMounts: - - mountPath: /var/run/argocd - name: var-files containers: - name: {{ .Values.repoServer.name }} image: {{ default .Values.global.image.repository .Values.repoServer.image.repository }}:{{ default (include "argo-cd.defaultTag" .) .Values.repoServer.image.tag }} @@ -194,10 +183,24 @@ spec: name: var-files - emptyDir: {} name: plugins - {{- if .Values.repoServer.initContainers }} + {{- if or .Values.repoServer.initContainers .Values.repoServer.enableCopyutilInitContainer }} initContainers: + {{- if .Values.repoServer.enableCopyutilInitContainer }} + - command: + - cp + - -n + - /usr/local/bin/argocd + - /var/run/argocd/argocd-cmp-server + image: {{ default .Values.global.image.repository .Values.repoServer.image.repository }}:{{ default (include "argo-cd.defaultTag" .) .Values.repoServer.image.tag }} + name: copyutil + volumeMounts: + - mountPath: /var/run/argocd + name: var-files + {{- end }} + {{- if .Values.repoServer.initContainers }} {{- toYaml .Values.repoServer.initContainers | nindent 6 }} {{- end }} + {{- end }} {{- if .Values.repoServer.priorityClassName }} priorityClassName: {{ .Values.repoServer.priorityClassName }} {{- end }} diff --git a/charts/argo-cd/values.yaml b/charts/argo-cd/values.yaml index 58e2d52c..4fbf2a74 100755 --- a/charts/argo-cd/values.yaml +++ b/charts/argo-cd/values.yaml @@ -1530,6 +1530,9 @@ repoServer: # name: custom-tools # subPath: helm + # -- Enable the copyutil init container + enableCopyutilInitContainer: true + ## Argo Configs configs: # -- Provide one or multiple [external cluster credentials]