Skip to content

Commit

Permalink
add IG config for default socketpaths
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Bertschy <[email protected]>
  • Loading branch information
matthyx committed Dec 17, 2024
1 parent 48aaca8 commit 53e0900
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ RUN --mount=target=. \
FROM gcr.io/distroless/static-debian12:latest

COPY --from=builder /out/node-agent /usr/bin/node-agent
COPY configuration/ig-config.yaml /root/.ig/config.yaml

ARG image_version
ENV RELEASE=$image_version
Expand Down
4 changes: 4 additions & 0 deletions configuration/ig-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
containerd-socketpath: /run/containerd/containerd.sock
crio-socketpath: /var/run/crio/crio.sock
docker-socketpath: /var/run/docker.sock
podman-socketpath: /run/podman/podman.sock
4 changes: 4 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
apitypes "github.com/armosec/armoapi-go/armotypes"
utilsmetadata "github.com/armosec/utils-k8s-go/armometadata"
mapset "github.com/deckarep/golang-set/v2"
igconfig "github.com/inspektor-gadget/inspektor-gadget/pkg/config"
containercollection "github.com/inspektor-gadget/inspektor-gadget/pkg/container-collection"
beUtils "github.com/kubescape/backend/pkg/utils"
"github.com/kubescape/go-logger"
Expand Down Expand Up @@ -280,6 +281,9 @@ func main() {
}

// Create the IG k8sClient
if err := igconfig.Config.ReadInConfig(); err != nil {
logger.L().Warning("reading IG config", helpers.Error(err))
}
igK8sClient, err := containercollection.NewK8sClient(cfg.NodeName)
if err != nil {
logger.L().Fatal("error creating IG Kubernetes client", helpers.Error(err))
Expand Down

0 comments on commit 53e0900

Please sign in to comment.