mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-21 20:23:39 +09:00
fix(seaweedfs): keep the metadata database storage class a string
db.storageClass went unquoted into the values of the database release and again into its CNPG Cluster. A class name made only of digits, which Kubernetes allows, became a number that the Cluster rejects, and a line break in the value could add keys to the database release values. It is quoted at both steps. Assisted-by: LLM Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
This commit is contained in:
1 parent
e6eb3345c6
commit
f5114ae04c
4 files changed
+46
-2
No files matched your search
@@ -42,6 +42,6 @@ spec:
|
||||
resources: {{- include "cozy-lib.resources.defaultingSanitize" (list .Values.db.resourcesPreset .Values.db.resources $) | nindent 8 }}
|
||||
size: {{ .Values.db.size }}
|
||||
{{- with .Values.db.storageClass }}
|
||||
storageClass: {{ . }}
|
||||
storageClass: {{ . | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,30 @@
|
||||
suite: seaweedfs metadata database storage class reaches its release as a string
|
||||
|
||||
templates:
|
||||
- templates/seaweedfs-db.yaml
|
||||
|
||||
release:
|
||||
name: seaweedfs
|
||||
namespace: tenant-root
|
||||
|
||||
tests:
|
||||
# A StorageClass name may be all digits; handed on unquoted it reaches the
|
||||
# database release as a number, and a line break in it would open new keys
|
||||
# in that release's values.
|
||||
- it: hands a numeric storage class name on as a string
|
||||
set:
|
||||
db:
|
||||
storageClass: "123"
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.values.db.storageClass
|
||||
value: "123"
|
||||
|
||||
- it: keeps a storage class with a line break inside its own field
|
||||
set:
|
||||
db:
|
||||
storageClass: "local\n replicas: 9"
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.values.db.storageClass
|
||||
value: "local\n replicas: 9"
|
||||
@@ -11,7 +11,7 @@ spec:
|
||||
storage:
|
||||
size: {{ .Values.db.size }}
|
||||
{{- with .Values.db.storageClass }}
|
||||
storageClass: {{ . }}
|
||||
storageClass: {{ . | quote }}
|
||||
{{- end }}
|
||||
|
||||
monitoring:
|
||||
|
||||
@@ -60,3 +60,17 @@ tests:
|
||||
- equal:
|
||||
path: spec.inheritedMetadata.labels["policy.cozystack.io/allow-to-apiserver"]
|
||||
value: "true"
|
||||
|
||||
# A StorageClass name may be all digits; emitted unquoted it renders as a
|
||||
# number, which the Cluster rejects.
|
||||
- it: keeps a numeric storage class name a string
|
||||
release:
|
||||
name: seaweedfs-db
|
||||
namespace: cozy-seaweedfs
|
||||
set:
|
||||
db:
|
||||
storageClass: "123"
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.storage.storageClass
|
||||
value: "123"
|
||||
Reference in new issue
Block a user