diff --git a/pkg/KubeArmorOperator/cmd/snitch-cmd/main.go b/pkg/KubeArmorOperator/cmd/snitch-cmd/main.go index a0a8cc84a1..663da1bb10 100644 --- a/pkg/KubeArmorOperator/cmd/snitch-cmd/main.go +++ b/pkg/KubeArmorOperator/cmd/snitch-cmd/main.go @@ -189,7 +189,6 @@ func applyCRIOHook(socket string) error { "/usr/share/kubearmor/hook", "--runtime-socket", socket, - "--k8s", }, }, When: hooks.When{Always: &always}, diff --git a/pkg/KubeArmorOperator/hook/crio.go b/pkg/KubeArmorOperator/hook/crio.go index c26727ec54..3e30c78c14 100644 --- a/pkg/KubeArmorOperator/hook/crio.go +++ b/pkg/KubeArmorOperator/hook/crio.go @@ -6,6 +6,7 @@ package main import ( "context" "encoding/json" + "log" "github.com/kubearmor/KubeArmor/KubeArmor/types" "github.com/opencontainers/runtime-spec/specs-go" @@ -53,7 +54,8 @@ func (h *crioHandler) listContainers(ctx context.Context) ([]types.Container, er for _, container := range containersList.GetContainers() { c, err := h.getContainer(ctx, container.GetId()) if err != nil { - return nil, err + log.Printf("failed to get container %q: %s", container.GetId(), err.Error()) + continue } containers = append(containers, c) } diff --git a/pkg/KubeArmorOperator/hook/main.go b/pkg/KubeArmorOperator/hook/main.go index 7adb47fd7e..5b6503976c 100644 --- a/pkg/KubeArmorOperator/hook/main.go +++ b/pkg/KubeArmorOperator/hook/main.go @@ -25,14 +25,12 @@ import ( var ( kubeArmorSocket string runtimeSocket string - k8s bool detached bool ) func main() { flag.StringVar(&kubeArmorSocket, "kubearmor-socket", "/var/run/kubearmor/ka.sock", "KubeArmor socket") flag.StringVar(&runtimeSocket, "runtime-socket", "", "container runtime socket") - flag.BoolVar(&k8s, "k8s", false, "kubernetes environment") flag.BoolVar(&detached, "detached", false, "run detached") flag.Parse()