Skip to content

Commit

Permalink
Adding an option to skip the kernel validation
Browse files Browse the repository at this point in the history
Signed-off-by: Amit Schendel <amitschendel@gmail.com>
  • Loading branch information
amitschendel committed Jul 23, 2024
1 parent 98feb0a commit aa63a89
Showing 1 changed file with 10 additions and 7 deletions.
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 aa63a89

Please sign in to comment.