Skip to content

Commit

Permalink
fix linter issue and update deployments
Browse files Browse the repository at this point in the history
  • Loading branch information
kannon92 committed Feb 13, 2024
1 parent 7e36011 commit 9ccf1d8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions deployment/components/common/worker-mounts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
- name: host-boot
hostPath:
path: "/boot"
- name: host-swap
hostPath:
path: "/proc/swaps"
- name: host-os-release
hostPath:
path: "/etc/os-release"
Expand Down Expand Up @@ -38,6 +41,9 @@
- name: host-sys
mountPath: "/host-sys"
readOnly: true
- name: host-swaps
mountPath: "/host-swaps"
readOnly: true
- name: host-usr-lib
mountPath: "/host-usr/lib"
readOnly: true
Expand Down
3 changes: 3 additions & 0 deletions deployment/helm/node-feature-discovery/templates/worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ spec:
- name: host-lib
hostPath:
path: "/lib"
- name: host-proc-swap
hostPath:
path: "/proc/swaps"
{{- if .Values.worker.mountUsrSrc }}
- name: host-usr-src
hostPath:
Expand Down
5 changes: 4 additions & 1 deletion source/memory/memory.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@ func (s *memorySource) GetFeatures() *nfdv1alpha1.Features {
func detectSwap() (map[string]string, error) {
procBasePath := hostpath.ProcDir.Path("swaps")
file, err := os.Open(procBasePath)
defer file.Close()
defer func() error {
err = file.Close()
return err
}()
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 9ccf1d8

Please sign in to comment.