Skip to content

Commit

Permalink
Merge pull request #332 from kubescape/feature/skip-validation
Browse files Browse the repository at this point in the history
Feature/skip validation
  • Loading branch information
amitschendel authored Jul 23, 2024
2 parents 2703ce1 + d3c3960 commit bcad8aa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
17 changes: 10 additions & 7 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}

Expand Down

0 comments on commit bcad8aa

Please sign in to comment.