Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature]: Added Validate() function to check if the linux kernel version is lower than 5.15 #1828

Merged
merged 7 commits into from
Apr 20, 2024

Conversation

Akash-Singh04
Copy link
Contributor

Related Issue

  • Added Validate() function to check if the linux kernel version is lower than 5.15 for eBPF support.

Closes: #1811

Describe the changes you've made

Added Validate() function to check if the linux kernel version is lower than 5.15 for eBPF support. Validate() then calls ValidateFlags() for record and test command.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, local variables)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Please let us know if any test cases are added

NIL
Please describe the tests(if any). Provide instructions how its affecting the coverage.
NIL

Describe if there is any unusual behaviour of your code(Write NA if there isn't)

A clear and concise description of it.
NIL

Checklist:

  • My code follows the style guidelines of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.

… than 5.15

Signed-off-by: Akash Singh <akashsingh2210670@gmail.com>
@Akash-Singh04
Copy link
Contributor Author

@slayerjain @gouravkrosx Kindly review

@gouravkrosx
Copy link
Member

@Akash-Singh04, You can refer this: https://pkg.go.dev/github.com/moby/moby/pkg/parsers/kernel#section-documentation

@Akash-Singh04
Copy link
Contributor Author

@gouravkrosx your requested changes have been integrated

cli/provider/cmd.go Outdated Show resolved Hide resolved
@@ -240,6 +241,18 @@ func (c *CmdConfigurator) AddFlags(cmd *cobra.Command) error {
return nil
}

func (c *CmdConfigurator) Validate(ctx context.Context, cmd *cobra.Command) error {
//check if the version of the kernel is above 5.15 for eBPF support
isValidVersion := kernel.CheckKernelVersion(5, 15, 0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just call it isValid

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

refactored

Akash-Singh04 and others added 2 commits April 20, 2024 22:19
Signed-off-by: Akash Singh <akashsingh2210670@gmail.com>
Copy link
Member

@gouravkrosx gouravkrosx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gouravkrosx gouravkrosx merged commit 72d744e into keploy:main Apr 20, 2024
13 of 14 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Apr 20, 2024
@Akash-Singh04 Akash-Singh04 deleted the linuxver branch April 20, 2024 17:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feature]: check if the linux kernel version is lower than 5.15
2 participants