Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow modification of the hostNetwork parameter to avoid the need of … #1046

Merged
merged 7 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions templates/csi-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ spec:
{{- if .Values.csi.priorityClassName }}
priorityClassName: {{ .Values.csi.priorityClassName }}
{{- end }}
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 |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these will need csi.enabled=true set since by default the csi daemonset is not deployed in the chart.

Suggested change
local actual=$(helm template \
--show-only templates/csi-daemonset.yaml \
. | tee /dev/stderr |
local actual=$(helm template \
--show-only templates/csi-daemonset.yaml \
--set 'csi.enabled=true' \
. | tee /dev/stderr |

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

yq -r '.spec.template.spec.hostNetwork' | tee /dev/stderr)
[ "${actual}" = "false" ]
}

@test "server/StatefulSet: server.hostNetwork is set" {
tvoran marked this conversation as resolved.
Show resolved Hide resolved
cd `chart_dir`
local actual=$(helm template \
--show-only templates/csi-daemonset.yaml \
--set 'csi.hostNetwork=true' \
. | tee /dev/stderr |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
local actual=$(helm template \
--show-only templates/csi-daemonset.yaml \
--set 'csi.hostNetwork=true' \
. | tee /dev/stderr |
local actual=$(helm template \
--show-only templates/csi-daemonset.yaml \
--set 'csi.enabled=true' \
--set 'csi.hostNetwork=true' \
. | tee /dev/stderr |

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

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"
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: These are in alphabetical order, so it would be good to move this to be after hmacSecretName.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

"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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: formatting

Suggested change
#Allow modification of the hostNetwork parameter to avoid the need of a dedicated pod ip
# Allow modification of the hostNetwork parameter to avoid the need of a
# dedicated pod ip

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

hostNetwork: false

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