diff --git a/build/Dockerfile b/build/Dockerfile index ed1b2bfb..33bd4481 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -9,7 +9,7 @@ RUN --mount=target=. \ --mount=type=cache,target=/go/pkg \ GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o /out/node-agent . -FROM gcr.io/distroless/static-debian11:debug +FROM gcr.io/distroless/static-debian11:latest COPY --from=builder /out/node-agent /usr/bin/node-agent diff --git a/main.go b/main.go index ba247bc2..94276247 100644 --- a/main.go +++ b/main.go @@ -86,14 +86,17 @@ func main() { defer logger.ShutdownOtel(ctx) } - err = validator.CheckPrerequisites() - if err != nil { - logger.L().Ctx(ctx).Error("error during validation", helpers.Error(err)) + // Check if we need to validate the kernel version. + if os.Getenv("SKIP_KERNEL_VERSION_CHECK") == "" { + err = validator.CheckPrerequisites() + if err != nil { + logger.L().Ctx(ctx).Error("error during validation", helpers.Error(err)) - if strings.Contains(err.Error(), utils.ErrKernelVersion) { - os.Exit(utils.ExitCodeIncompatibleKernel) - } else { - os.Exit(utils.ExitCodeError) + if strings.Contains(err.Error(), utils.ErrKernelVersion) { + os.Exit(utils.ExitCodeIncompatibleKernel) + } else { + os.Exit(utils.ExitCodeError) + } } }