diff --git a/packages/extra/seaweedfs/templates/seaweedfs.yaml b/packages/extra/seaweedfs/templates/seaweedfs.yaml index 52009724b..9a6e952e5 100644 --- a/packages/extra/seaweedfs/templates/seaweedfs.yaml +++ b/packages/extra/seaweedfs/templates/seaweedfs.yaml @@ -279,7 +279,7 @@ spec: type: "persistentVolumeClaim" size: "{{ $pool.size | default $.Values.volume.size }}" {{- with ($pool.storageClass | default $.Values.volume.storageClass) }} - storageClass: "{{ . }}" + storageClass: {{ . | quote }} {{- end }} maxVolumes: 0 extraArgs: @@ -295,7 +295,7 @@ spec: type: "persistentVolumeClaim" size: "{{ $zone.size | default $.Values.volume.size }}" {{- with ($zone.storageClass | default $.Values.volume.storageClass) }} - storageClass: "{{ . }}" + storageClass: {{ . | quote }} {{- end }} maxVolumes: 0 nodeSelector: | @@ -320,7 +320,7 @@ spec: type: "persistentVolumeClaim" size: "{{ $pool.size | default $zone.size | default $.Values.volume.size }}" {{- with ($pool.storageClass | default $zone.storageClass | default $.Values.volume.storageClass) }} - storageClass: "{{ . }}" + storageClass: {{ . | quote }} {{- end }} maxVolumes: 0 nodeSelector: | diff --git a/packages/extra/seaweedfs/tests/volume_storage_class_test.yaml b/packages/extra/seaweedfs/tests/volume_storage_class_test.yaml index 6543afc98..2474f3358 100644 --- a/packages/extra/seaweedfs/tests/volume_storage_class_test.yaml +++ b/packages/extra/seaweedfs/tests/volume_storage_class_test.yaml @@ -45,3 +45,58 @@ tests: value: "local\n image: example/other" - notExists: path: spec.values.seaweedfs.volume.dataDirs[0].image + + # A pool or zone class is quoted by hand around the value, which a quote + # character inside it closes early, breaking the release values. + - it: keeps a pool storage class with a quote inside its own field + set: + <<: *platform + volume: + pools: + fast: + diskType: ssd + storageClass: 'local"x' + documentSelector: + path: metadata.name + value: seaweedfs-system + asserts: + - equal: + path: spec.values.seaweedfs.volumes.fast.dataDirs[0].storageClass + value: 'local"x' + + - it: keeps a zone storage class with a quote inside its own field + set: + <<: *platform + topology: MultiZone + replicationFactor: 1 + volume: + zones: + a: + storageClass: 'local"x' + documentSelector: + path: metadata.name + value: seaweedfs-system + asserts: + - equal: + path: spec.values.seaweedfs.volumes.a.dataDirs[0].storageClass + value: 'local"x' + + - it: keeps a zone pool storage class with a quote inside its own field + set: + <<: *platform + topology: MultiZone + replicationFactor: 1 + volume: + zones: + a: + pools: + fast: + diskType: ssd + storageClass: 'local"x' + documentSelector: + path: metadata.name + value: seaweedfs-system + asserts: + - equal: + path: spec.values.seaweedfs.volumes.a-fast.dataDirs[0].storageClass + value: 'local"x'