Skip to content

Commit

Permalink
fix commits and add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shuyanl-qualtrics committed Aug 14, 2024
1 parent 36f9fcd commit 330b64c
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion templates/csi-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ spec:
{{- if .Values.csi.priorityClassName }}
priorityClassName: {{ .Values.csi.priorityClassName }}
{{- end }}
hostNetwork: {{ default false .Values.hostNetwork }}
hostNetwork: {{ .Values.csi.hostNetwork }}
serviceAccountName: {{ template "vault.fullname" . }}-csi-provider
{{- template "csi.pod.tolerations" . }}
{{- template "csi.pod.nodeselector" . }}
Expand Down
22 changes: 22 additions & 0 deletions test/unit/csi-daemonset.bats
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,28 @@ load _helpers
[ "${actual}" = "true" ]
}

#--------------------------------------------------------------------
# hostNetwork

@test "csi/daemonset: csi.hostNetwork not set" {
cd `chart_dir`
local actual=$(helm template \
--show-only templates/csi-daemonset.yaml \
. | tee /dev/stderr |
yq -r '.spec.template.spec.hostNetwork' | tee /dev/stderr)
[ "${actual}" = "false" ]
}

@test "server/StatefulSet: server.hostNetwork is set" {
cd `chart_dir`
local actual=$(helm template \
--show-only templates/csi-daemonset.yaml \
--set 'csi.hostNetwork=true' \
. | tee /dev/stderr |
yq -r '.spec.template.spec.hostNetwork' | tee /dev/stderr)
[ "${actual}" = "true" ]
}

#--------------------------------------------------------------------
# Readiness/liveness probes

Expand Down
3 changes: 3 additions & 0 deletions values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@
"resources": {
"type": "object"
},
"hostNetwork": {
"type": "boolean"
},
"serviceAccount": {
"type": "object",
"properties": {
Expand Down
3 changes: 3 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1119,6 +1119,9 @@ csi:
# generating secret versions.
hmacSecretName: ""

#Allow modification of the hostNetwork parameter to avoid the need of a dedicated pod ip
hostNetwork: false

# Settings for the daemonSet used to run the provider.
daemonSet:
updateStrategy:
Expand Down

0 comments on commit 330b64c

Please sign in to comment.