Skip to content

Commit

Permalink
Merge pull request #106 from ccremer/fix-storage-class
Browse files Browse the repository at this point in the history
Only render reserveSpace parameter if explicitly set
  • Loading branch information
ccremer authored Aug 13, 2023
2 parents 3efc732 + c6c486e commit 452afc2
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion charts/kubernetes-zfs-provisioner/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ description: Dynamic ZFS persistent volume provisioner for Kubernetes

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: 2.2.0
version: 2.2.1

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
Expand Down
3 changes: 1 addition & 2 deletions charts/kubernetes-zfs-provisioner/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# kubernetes-zfs-provisioner

![Version: 2.2.0](https://img.shields.io/badge/Version-2.2.0-informational?style=flat-square)
![Version: 2.2.1](https://img.shields.io/badge/Version-2.2.1-informational?style=flat-square)

Dynamic ZFS persistent volume provisioner for Kubernetes

Expand Down Expand Up @@ -76,4 +76,3 @@ No 1.x or 0.x chart releases will be migrated from the `ccremer/charts` Helm rep
* The `image.registry` has changed from `quay.io` to `ghcr.io`.
* The `image.tag` has changed from to `v1.1.0` to `v1`.
* The `image.pullPolicy` has changed from `IfNotPresent` to `Always`.

Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ parameters:
type: {{ .type | default "nfs" }}
node: {{ .node | default "''" }}
shareProperties: {{ .shareProperties | default "''" }}
reserveSpace: {{ coalesce (quote .reserveSpace) (quote true) }}
{{- if kindIs "bool" .reserveSpace }}
reserveSpace: {{ quote .reserveSpace }}
{{- end }}
{{- end }}
{{- end }}
4 changes: 3 additions & 1 deletion charts/kubernetes-zfs-provisioner/test/storageclass_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ func Test_StorageClass_GivenClassesEnabled_WhenReserveSpaceUndefined_ThenRenderD
var class v1.StorageClass
helm.UnmarshalK8SYaml(t, output, &class)

assert.Equal(t, "true", class.Parameters["reserveSpace"])
value, exists := class.Parameters["reserveSpace"]
assert.False(t, exists)
assert.Empty(t, value)
}

func Test_StorageClass_GivenClassesEnabled_WhenReserveSpaceFalse_ThenRenderReserveSpace(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion charts/kubernetes-zfs-provisioner/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ storageClass:
# # `HostPath` node affinity
# node: ""
# # -- Reserve space for created datasets. Default is true. Use false to enable thin provisioning
# reserveSpace: true
# reserveSpace: false
# # -- Annotations for the storage class
# # annotations:
# # storageclass.kubernetes.io/is-default-class: "true"
Expand Down

0 comments on commit 452afc2

Please sign in to comment.