File tree 3 files changed +13
-1
lines changed
helm/node-feature-discovery/templates
3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 4
4
- name : host-boot
5
5
hostPath :
6
6
path : " /boot"
7
+ - name : host-swap
8
+ hostPath :
9
+ path : " /proc/swaps"
7
10
- name : host-os-release
8
11
hostPath :
9
12
path : " /etc/os-release"
38
41
- name : host-sys
39
42
mountPath : " /host-sys"
40
43
readOnly : true
44
+ - name : host-swaps
45
+ mountPath : " /host-swaps"
46
+ readOnly : true
41
47
- name : host-usr-lib
42
48
mountPath : " /host-usr/lib"
43
49
readOnly : true
Original file line number Diff line number Diff line change @@ -122,6 +122,9 @@ spec:
122
122
- name : host-lib
123
123
hostPath :
124
124
path : " /lib"
125
+ - name : host-proc-swap
126
+ hostPath :
127
+ path : " /proc/swaps"
125
128
{{- if .Values.worker.mountUsrSrc }}
126
129
- name : host-usr-src
127
130
hostPath :
Original file line number Diff line number Diff line change @@ -133,7 +133,10 @@ func (s *memorySource) GetFeatures() *nfdv1alpha1.Features {
133
133
func detectSwap () (map [string ]string , error ) {
134
134
procBasePath := hostpath .ProcDir .Path ("swaps" )
135
135
file , err := os .Open (procBasePath )
136
- defer file .Close ()
136
+ defer func () error {
137
+ err = file .Close ()
138
+ return err
139
+ }()
137
140
if err != nil {
138
141
return nil , err
139
142
}
You can’t perform that action at this time.
0 commit comments