Skip to content

Commit 9ccf1d8

Browse files
committed
fix linter issue and update deployments
1 parent 7e36011 commit 9ccf1d8

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

deployment/components/common/worker-mounts.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
- name: host-boot
55
hostPath:
66
path: "/boot"
7+
- name: host-swap
8+
hostPath:
9+
path: "/proc/swaps"
710
- name: host-os-release
811
hostPath:
912
path: "/etc/os-release"
@@ -38,6 +41,9 @@
3841
- name: host-sys
3942
mountPath: "/host-sys"
4043
readOnly: true
44+
- name: host-swaps
45+
mountPath: "/host-swaps"
46+
readOnly: true
4147
- name: host-usr-lib
4248
mountPath: "/host-usr/lib"
4349
readOnly: true

deployment/helm/node-feature-discovery/templates/worker.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ spec:
122122
- name: host-lib
123123
hostPath:
124124
path: "/lib"
125+
- name: host-proc-swap
126+
hostPath:
127+
path: "/proc/swaps"
125128
{{- if .Values.worker.mountUsrSrc }}
126129
- name: host-usr-src
127130
hostPath:

source/memory/memory.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,10 @@ func (s *memorySource) GetFeatures() *nfdv1alpha1.Features {
133133
func detectSwap() (map[string]string, error) {
134134
procBasePath := hostpath.ProcDir.Path("swaps")
135135
file, err := os.Open(procBasePath)
136-
defer file.Close()
136+
defer func() error {
137+
err = file.Close()
138+
return err
139+
}()
137140
if err != nil {
138141
return nil, err
139142
}

0 commit comments

Comments
 (0)