From 2e0fe5b84fdcd7981abb8de2a14c942556b61bc4 Mon Sep 17 00:00:00 2001 From: Wayne Starr Date: Tue, 7 Nov 2023 20:51:36 -0600 Subject: [PATCH] chore: keep a useable empty dir mount even when persistence is disabled (#2124) ## Description This PR sets up an empty dir when persistence is disable which is something needed for the longhorn init package: https://github.com/defenseunicorns/zarf-init-longhorn ## Related Issue Fixes #1995 ## Type of change - [ ] Bug fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Other (security config, docs update, etc) ## Checklist before merging - [ ] Test, docs, adr added or updated as needed - [x] [Contributor Guide Steps](https://github.com/defenseunicorns/zarf/blob/main/CONTRIBUTING.md#developer-workflow) followed --------- Co-authored-by: Ben Mountjoy --- examples/longhorn/values.yaml | 2 +- packages/zarf-registry/chart/templates/deployment.yaml | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/examples/longhorn/values.yaml b/examples/longhorn/values.yaml index 3f4b5a46f5..2398307d6a 100644 --- a/examples/longhorn/values.yaml +++ b/examples/longhorn/values.yaml @@ -98,7 +98,7 @@ persistence: removeSnapshotsDuringFilesystemTrim: ignored # "enabled" or "disabled" otherwise csi: - kubeletRootDir: "/var/lib/kubelet" + kubeletRootDir: "/var/lib/kubelet" attacherReplicaCount: ~ provisionerReplicaCount: ~ resizerReplicaCount: ~ diff --git a/packages/zarf-registry/chart/templates/deployment.yaml b/packages/zarf-registry/chart/templates/deployment.yaml index f899f10c04..ab3a0c0562 100644 --- a/packages/zarf-registry/chart/templates/deployment.yaml +++ b/packages/zarf-registry/chart/templates/deployment.yaml @@ -73,10 +73,8 @@ spec: {{ toYaml . | indent 12 }} {{- end }} volumeMounts: -{{- if .Values.persistence.enabled }} - name: data mountPath: /var/lib/registry/ -{{- end }} - name: config mountPath: "/etc/docker/registry" affinity: @@ -108,4 +106,8 @@ spec: - name: data persistentVolumeClaim: claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ template "docker-registry.fullname" . }}{{- end }} +{{- else }} + - name: data + emptyDir: + sizeLimit: {{ .Values.persistence.size }} {{- end }}