Skip to content

Commit

Permalink
feat: make hostNetwork configurable (#107)
Browse files Browse the repository at this point in the history
* disable it by default (fixes port conflict issue on the node if another port is trying to acquire the same port)
* chore: update `VERSION` in the `Makefile`
* chore: replace `hostNetwork: true` with `hostNetwork: false`
* fix: template substituion for `hostNetwork`
  • Loading branch information
vadasambar authored Jan 12, 2024
1 parent c350f34 commit 2da2ca1
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION ?= v1.0.0
VERSION ?= v1.0.1

IMAGE_BUILDER ?= docker
IMAGE_BUILD_CMD ?= buildx
Expand Down
4 changes: 2 additions & 2 deletions charts/warm-metal-csi-driver/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ type: application
# 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.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.0.0
version: 1.0.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. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: v1.0.0
appVersion: v1.0.1
2 changes: 1 addition & 1 deletion charts/warm-metal-csi-driver/templates/nodeplugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ spec:
- mountPath: {{ .Values.crioMountProgram }}
name: crio-mount-program
{{- end }}
hostNetwork: true
hostNetwork: {{.Values.csiPlugin.hostNetwork}}
serviceAccountName: {{ include "warm-metal-csi-driver.fullname" . }}-nodeplugin
volumes:
- hostPath:
Expand Down
1 change: 1 addition & 0 deletions charts/warm-metal-csi-driver/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ enableAsyncPullMount: false
pullImageSecretForDaemonset:

csiPlugin:
hostNetwork: false
resources: {}
image:
tag: ""
Expand Down
2 changes: 1 addition & 1 deletion cmd/install/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ spec:
labels:
app: csi-image-warm-metal
spec:
hostNetwork: true
hostNetwork: false
serviceAccountName: csi-image-warm-metal
containers:
- name: node-driver-registrar
Expand Down
3 changes: 2 additions & 1 deletion pkg/pullexecutor/pullexecutor.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ func (m *PullExecutor) StartPulling(o *PullOptions) error {
c, cancel := context.WithTimeout(context.Background(), pullCtxTimeout)
defer cancel()

if pullstatus.Get(o.NamedRef) == pullstatus.StillPulling {
if pullstatus.Get(o.NamedRef) == pullstatus.StillPulling ||
pullstatus.Get(o.NamedRef) == pullstatus.Pulled {
return
}

Expand Down
2 changes: 1 addition & 1 deletion sample/install/cri-o.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ spec:
- mountPath: /run/containers/storage
mountPropagation: Bidirectional
name: crio-run-root
hostNetwork: true
hostNetwork: false
serviceAccountName: csi-image-warm-metal
volumes:
- hostPath:
Expand Down
2 changes: 1 addition & 1 deletion sample/install/k3s-containerd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ spec:
- mountPath: /var/lib/rancher/k3s/agent/containerd/io.containerd.snapshotter.v1.overlayfs
mountPropagation: Bidirectional
name: snapshot-root-0
hostNetwork: true
hostNetwork: false
serviceAccountName: csi-image-warm-metal
volumes:
- hostPath:
Expand Down
2 changes: 1 addition & 1 deletion sample/install/minikube-containerd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ spec:
- mountPath: /mnt/vda1/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs
mountPropagation: Bidirectional
name: snapshot-root-0
hostNetwork: true
hostNetwork: false
serviceAccountName: csi-image-warm-metal
volumes:
- hostPath:
Expand Down
2 changes: 1 addition & 1 deletion sample/install/snap-microk8s-containerd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ spec:
- mountPath: /var/snap/microk8s/common/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs
mountPropagation: Bidirectional
name: snapshot-root-0
hostNetwork: true
hostNetwork: false
serviceAccountName: csi-image-warm-metal
volumes:
- hostPath:
Expand Down

0 comments on commit 2da2ca1

Please sign in to comment.