From 9d8a94616d5706c9fcc177a57eae073ef893a7cd Mon Sep 17 00:00:00 2001 From: PrimalPimmy Date: Thu, 14 Mar 2024 20:15:29 +0530 Subject: [PATCH] fixed checking for filepath Signed-off-by: PrimalPimmy --- pkg/KubeArmorOperator/seccomp/seccomp.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/KubeArmorOperator/seccomp/seccomp.go b/pkg/KubeArmorOperator/seccomp/seccomp.go index cbdee43b66..0774232891 100644 --- a/pkg/KubeArmorOperator/seccomp/seccomp.go +++ b/pkg/KubeArmorOperator/seccomp/seccomp.go @@ -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" }