Skip to content

Commit

Permalink
fix(clamav): Switch to official clamav image (#456)
Browse files Browse the repository at this point in the history
Co-authored-by: Jan-Philipp Litza <Jan-Philipp.Litza@dataport.de>
  • Loading branch information
jplitza and Jan-Philipp Litza authored Apr 28, 2024
1 parent c740d88 commit 10c731f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
4 changes: 2 additions & 2 deletions charts/clamav/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: v2
description: An Open-Source antivirus engine for detecting trojans, viruses, malware & other malicious threats. Using Mailu docker image.
name: clamav
version: 2.8.3
appVersion: "1.9.50"
version: 3.0.0
appVersion: "1.3.0"
home: https://www.clamav.net
icon: https://www.clamav.net/assets/clamav-trademark.png
sources:
Expand Down
9 changes: 9 additions & 0 deletions charts/clamav/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,12 @@ app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}
{{- end -}}

{{- define "clamav.entrypoint" -}}
{{- if .Values.entrypoint -}}
{{ .Values.entrypoint }}
{{- else if eq (default 0 .Values.podSecurityContext.runAsUser | int) 0 -}}
/init
{{- else -}}
/init-unprivileged
{{- end -}}
{{- end -}}
4 changes: 3 additions & 1 deletion charts/clamav/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ spec:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default (printf "%s_base" .Chart.AppVersion) }}"
command:
- {{ include "clamav.entrypoint" . }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
Expand Down
10 changes: 4 additions & 6 deletions charts/clamav/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
replicaCount: 1

image:
# TODO: Switch to clamav/clamav container
repository: ghcr.io/mailu/clamav
repository: clamav/clamav
tag: "" # If not defined, uses appVersion
pullPolicy: IfNotPresent

Expand All @@ -23,8 +22,9 @@ fullnameOverride: ""

podSecurityContext:
runAsNonRoot: true
runAsUser: 2000
runAsGroup: 2000
runAsUser: 100
runAsGroup: 101
fsGroup: 101

securityContext:
allowPrivilegeEscalation: false
Expand Down Expand Up @@ -73,8 +73,6 @@ clamdConfig: |
# CUSTOM: Use pid file in tmp
PidFile /tmp/clamd.pid
LocalSocket /tmp/clamd.sock
# CUSTOM: Set local socket group to defined group id
LocalSocketGroup 2000
TCPSocket 3310
Foreground yes
Expand Down

0 comments on commit 10c731f

Please sign in to comment.