falcosecurity / plugin-sdk-go

Falco plugins SDK for Go
Apache License 2.0
26 stars 17 forks source link

Semver check for RequiredAPIVersion values #73

Closed Rohith-Raju closed 1 year ago

Rohith-Raju commented 1 year ago

What type of PR is this? /kind documentation /kind feature

Any specific area of the project related to this PR?

/area plugin-sdk

What this PR does / why we need it: This pr checks if user's RequiredAPIVersion follows semver system and checks if is compatible with
internally-supported API version

Which issue(s) this PR fixes:

Fixes #51

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE
poiana commented 1 year ago

Welcome @Rohith-Raju! It looks like this is your first PR to falcosecurity/plugin-sdk-go 🎉

Andreagit97 commented 1 year ago

ei @Rohith-Raju thank you for this, if I correctly understood the issue, the check should be even easier than this, you can do it in the go-side, the code would be something very similar to this
https://github.com/falcosecurity/plugin-sdk-go/blob/c2c8a3e406da1828cd9a00c7dab39b2db0855286/pkg/sdk/symbols/info/info.go#L108 if pRequiredAPIVersion is different from "" you have to compute a semver check between pRequiredAPIVersion and C.get_default_required_api_version()

Andreagit97 commented 1 year ago

Ooops Jason is faster than me as always :rocket: :laughing:

Rohith-Raju commented 1 year ago

@Andreagit97 @jasondellaluce, This makes total sense. I took a look at this and went overboard 😆 . My bad!!. Fixed it now. WDYT? Btw do we need to add panic tests?

Rohith-Raju commented 1 year ago

Sure, Thank you for reviewing my PR!!

poiana commented 1 year ago

LGTM label has been added.

Git tree hash: 83969e9462e764e36e0ba1a23ae859a8a2af22ce

poiana commented 1 year ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: leogr, Rohith-Raju

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/falcosecurity/plugin-sdk-go/blob/main/OWNERS)~~ [leogr] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
jasondellaluce commented 1 year ago

/unhold

jasondellaluce commented 1 year ago

/unhold