Skip to content

Commit

Permalink
fixed checking for filepath
Browse files Browse the repository at this point in the history
Signed-off-by: PrimalPimmy <[email protected]>
  • Loading branch information
PrimalPimmy committed Mar 14, 2024
1 parent 5ec11b8 commit 9d8a946
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/KubeArmorOperator/seccomp/seccomp.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,12 @@ func LoadSeccompInNode() {
}

func CheckIfSeccompProfilePresent() string {
if _, err := os.Stat(filepath.Clean(seccompPath)); err == nil {
_, err1 := os.Stat(filepath.Clean(seccompPath + "/kubearmor-init-seccomp.json"))
_, err2 := os.Stat(filepath.Clean(seccompPath + "/kubearmor-seccomp.json"))

if err1 == nil && err2 == nil {
return "yes"
}

return "no"
}

0 comments on commit 9d8a946

Please sign in to comment.