Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cgidmap: do not panic if cri is not enabled
cgidmap requires cri for pod association to work with existing pods. Currently, if cri is not enabled the cgidmap code will panic: E0904 10:02:54.892524 22765 runtime.go:79] Observed a panic: "invalid memory address or nil pointer dereference" (runtime error: invalid memory address or nil pointer dereference) goroutine 13 [running]: k8s.io/apimachinery/pkg/util/runtime.logPanic({0x276f260, 0x4a09c00}) /home/kkourt/src/tetragon/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:75 +0x85 k8s.io/apimachinery/pkg/util/runtime.HandleCrash({0x0, 0x0, 0xc004fd3340?}) /home/kkourt/src/tetragon/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:49 +0x6b panic({0x276f260?, 0x4a09c00?}) /opt/go/src/runtime/panic.go:770 +0x132 github.com/cilium/tetragon/pkg/cgidmap.(*criResolver).enqeue(0x0, {0xc005434f20, 0xc004fdfb28?, 0x40?}) This commit adds a nil check to avoid the panic and issues a warning if cri is not enabled but cgidmap is. Signed-off-by: Kornilios Kourtis <[email protected]>
- Loading branch information