Skip to content

Commit

Permalink
chore: Apply changes from code review
Browse files Browse the repository at this point in the history
Signed-off-by: Marco Maurer <mkilchhofer@users.noreply.github.com>
  • Loading branch information
mkilchhofer committed Jan 23, 2025
1 parent bb36dc9 commit 599db6c
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 20 deletions.
5 changes: 4 additions & 1 deletion charts/argocd-image-updater/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ The `config.registries` value can be used exactly as it looks in the documentati
|-----|------|---------|-------------|
| affinity | object | `{}` | Kubernetes affinity settings for the deployment |
| authScripts.enabled | bool | `false` | Whether to mount the defined scripts that can be used to authenticate with a registry, the scripts will be mounted at `/scripts` |
| authScripts.name | string | `"argocd-image-updater-authscripts"` | Name of the authentication scripts ConfigMap |
| authScripts.scripts | object | `{}` | Map of key-value pairs where the key consists of the name of the script and the value the contents |
| config.applicationsAPIKind | string | `""` | API kind that is used to manage Argo CD applications (`kubernetes` or `argocd`) |
| config.argocd.grpcWeb | bool | `true` | Use the gRPC-web protocol to connect to the Argo CD API |
Expand All @@ -85,8 +86,10 @@ The `config.registries` value can be used exactly as it looks in the documentati
| config.gitCommitTemplate | string | `""` | Changing the Git commit message |
| config.gitCommitUser | string | `""` | Username to use for Git commits |
| config.logLevel | string | `"info"` | Argo CD Image Update log level |
| config.name | string | `"argocd-image-updater-config"` | Name of the ConfigMap |
| config.registries | list | `[]` | Argo CD Image Updater registries list configuration. More information [here](https://argocd-image-updater.readthedocs.io/en/stable/configuration/registries/) |
| config.sshConfig | object | `{}` | Argo CD Image Updater ssh client parameter configuration. |
| config.sshConfig.config | string | `""` | Argo CD Image Updater ssh client parameter configuration. |
| config.sshConfig.name | string | `"argocd-image-updater-authscripts"` | Name of the authentication scripts ConfigMap |
| createClusterRoles | bool | `true` | Create cluster roles for cluster-wide installation. |
| extraArgs | list | `[]` | Extra arguments for argocd-image-updater not defined in `config.argocd`. If a flag contains both key and value, they need to be split to a new entry |
| extraEnv | list | `[]` | Extra environment variables for argocd-image-updater |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ kind: ConfigMap
metadata:
labels:
{{- include "argocd-image-updater.labels" . | nindent 4 }}
name: {{ include "argocd-image-updater.fullname" . }}-authscripts
name: {{ .Values.authScripts.name }}
namespace: {{ include "argocd-image-updater.namespace" . | quote }}
data:
{{- toYaml .Values.authScripts.scripts | nindent 2}}
Expand Down
10 changes: 8 additions & 2 deletions charts/argocd-image-updater/templates/configmap-sshconfig.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
{{- $sshConfig := omit .Values.config.sshConfig "name" }}
{{- range $key, $val := $sshConfig }}
{{- if not $val }}
{{ $_ := unset $sshConfig $key }}
{{- end }}
{{- end }}
apiVersion: v1
kind: ConfigMap
metadata:
labels:
{{- include "argocd-image-updater.labels" . | nindent 4 }}
name: {{ include "argocd-image-updater.fullname" . }}-ssh-config
name: {{ .Values.config.sshConfig.name }}
namespace: {{ include "argocd-image-updater.namespace" . | quote }}
{{- with .Values.config.sshConfig }}
{{- with $sshConfig }}
data:
{{- toYaml . | nindent 2 }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/argocd-image-updater/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ kind: ConfigMap
metadata:
labels:
{{- include "argocd-image-updater.labels" . | nindent 4 }}
name: {{ include "argocd-image-updater.fullname" . }}-config
name: {{ .Values.config.name }}
namespace: {{ include "argocd-image-updater.namespace" . | quote }}
data:
{{- with .Values.config.applicationsAPIKind }}
Expand Down
26 changes: 13 additions & 13 deletions charts/argocd-image-updater/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,31 +44,31 @@ spec:
valueFrom:
configMapKeyRef:
key: applications_api
name: {{ include "argocd-image-updater.fullname" . }}-config
name: {{ .Values.config.name }}
optional: true
- name: ARGOCD_GRPC_WEB
valueFrom:
configMapKeyRef:
key: argocd.grpc_web
name: {{ include "argocd-image-updater.fullname" . }}-config
name: {{ .Values.config.name }}
optional: true
- name: ARGOCD_SERVER
valueFrom:
configMapKeyRef:
key: argocd.server_addr
name: {{ include "argocd-image-updater.fullname" . }}-config
name: {{ .Values.config.name }}
optional: true
- name: ARGOCD_INSECURE
valueFrom:
configMapKeyRef:
key: argocd.insecure
name: {{ include "argocd-image-updater.fullname" . }}-config
name: {{ .Values.config.name }}
optional: true
- name: ARGOCD_PLAINTEXT
valueFrom:
configMapKeyRef:
key: argocd.plaintext
name: {{ include "argocd-image-updater.fullname" . }}-config
name: {{ .Values.config.name }}
optional: true
- name: ARGOCD_TOKEN
valueFrom:
Expand All @@ -80,43 +80,43 @@ spec:
valueFrom:
configMapKeyRef:
key: log.level
name: {{ include "argocd-image-updater.fullname" . }}-config
name: {{ .Values.config.name }}
optional: true
- name: GIT_COMMIT_USER
valueFrom:
configMapKeyRef:
key: git.user
name: {{ include "argocd-image-updater.fullname" . }}-config
name: {{ .Values.config.name }}
optional: true
- name: GIT_COMMIT_EMAIL
valueFrom:
configMapKeyRef:
key: git.email
name: {{ include "argocd-image-updater.fullname" . }}-config
name: {{ .Values.config.name }}
optional: true
- name: IMAGE_UPDATER_KUBE_EVENTS
valueFrom:
configMapKeyRef:
key: kube.events
name: {{ include "argocd-image-updater.fullname" . }}-config
name: {{ .Values.config.name }}
optional: true
- name: GIT_COMMIT_SIGNING_KEY
valueFrom:
configMapKeyRef:
key: git.commit-signing-key
name: {{ include "argocd-image-updater.fullname" . }}-config
name: {{ .Values.config.name }}
optional: true
- name: GIT_COMMIT_SIGNING_METHOD
valueFrom:
configMapKeyRef:
key: git.commit-signing-method
name: {{ include "argocd-image-updater.fullname" . }}-config
name: {{ .Values.config.name }}
optional: true
- name: GIT_COMMIT_SIGN_OFF
valueFrom:
configMapKeyRef:
key: git.commit-sign-off
name: {{ include "argocd-image-updater.fullname" . }}-config
name: {{ .Values.config.name }}
optional: true
{{- with .Values.extraEnv }}
{{- toYaml . | nindent 10 }}
Expand Down Expand Up @@ -177,7 +177,7 @@ spec:
path: registries.conf
- key: git.commit-message-template
path: commit.template
name: {{ include "argocd-image-updater.fullname" . }}-config
name: {{ .Values.config.name }}
optional: true
name: image-updater-conf
{{- if .Values.authScripts.enabled }}
Expand Down
10 changes: 8 additions & 2 deletions charts/argocd-image-updater/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ volumes: []
# emptyDir: {}

config:
# -- Name of the ConfigMap
name: argocd-image-updater-config
# -- API kind that is used to manage Argo CD applications (`kubernetes` or `argocd`)
applicationsAPIKind: ""

Expand Down Expand Up @@ -175,9 +177,11 @@ config:
# credentials: ext:/scripts/auth1.sh
# credsexpire: 10h

# -- Argo CD Image Updater ssh client parameter configuration.
sshConfig:
{}
# -- Name of the authentication scripts ConfigMap
name: argocd-image-updater-authscripts
# -- Argo CD Image Updater ssh client parameter configuration.
config: ""
# config: |
# Host *
# PubkeyAcceptedAlgorithms +ssh-rsa
Expand All @@ -188,6 +192,8 @@ config:
authScripts:
# -- Whether to mount the defined scripts that can be used to authenticate with a registry, the scripts will be mounted at `/scripts`
enabled: false
# -- Name of the authentication scripts ConfigMap
name: argocd-image-updater-authscripts
# -- Map of key-value pairs where the key consists of the name of the script and the value the contents
scripts: {}
# auth1.sh: |
Expand Down

0 comments on commit 599db6c

Please sign in to comment.