Skip to content

Commit

Permalink
nits
Browse files Browse the repository at this point in the history
Signed-off-by: Rudraksh Pareek <[email protected]>
  • Loading branch information
DelusionalOptimist committed Jun 23, 2022
1 parent 7fe6ec8 commit 6d8e8cb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions KubeArmor/core/crioHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,16 @@ func (ch *CrioHandler) GetContainerInfo(ctx context.Context, containerID string)
if _, err := fmt.Sscanf(data, "pid:[%d]\n", &container.PidNS); err != nil {
kg.Warnf("Unable to get PidNS (%s, %s, %s)", containerID, pid, err.Error())
}
} else {
return container, err
}

if data, err := os.Readlink("/proc/" + pid + "/ns/mnt"); err == nil {
if _, err := fmt.Sscanf(data, "mnt:[%d]\n", &container.MntNS); err != nil {
kg.Warnf("Unable to get MntNS (%s, %s, %s)", containerID, pid, err.Error())
}
} else {
return container, err
}

return container, nil
Expand Down Expand Up @@ -230,6 +234,7 @@ func (dm *KubeArmorDaemon) UpdateCrioContainer(ctx context.Context, containerID,
// get container info from client
container, err := Crio.GetContainerInfo(ctx, containerID)
if err != nil {
kg.Warnf(err.Error())
return false
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

sudo systemctl stop crio.service

sudo dnf remove cri-o
sudo yum remove cri-o

sudo rm -rf /etc/crictl.yaml
sudo rm -rf /var/lib/crio

0 comments on commit 6d8e8cb

Please sign in to comment.