-
Notifications
You must be signed in to change notification settings - Fork 449
creating and using package capabilties #1253
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
Conversation
@@ -2,6 +2,7 @@ package main | |||
|
|||
import ( | |||
"fmt" | |||
"github.com/aquasecurity/tracee/pkg/capabilities" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you using goimports?
@@ -88,11 +89,11 @@ func main() { | |||
|
|||
// environment capabilities | |||
|
|||
selfCap, err := getSelfCapabilities() | |||
selfCap, err := capabilities.SelfCapabilities() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if we could avoid repetition in package names and exported functions as explained in Effective Go Package Names WDYT?
selfCap, err := capabilities.SelfCapabilities() | |
selfCap, err := capabilities.Self() |
if err != nil { | ||
return err | ||
} | ||
if err = checkRequiredCapabilities(selfCap); err != nil { | ||
if err = capabilities.CheckRequiredCapabilities(selfCap); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DITTO
if err = capabilities.CheckRequiredCapabilities(selfCap); err != nil { | |
if err = capabilities.CheckRequired(selfCap); err != nil { |
|
||
import ( | ||
"fmt" | ||
"github.com/syndtr/gocapability/capability" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of scope of this PR but I was wondering if we are okey with gocapability BSD 2-Clause "Simplified" License. (I assume that the fact it's not very actively maintained is because it is feature complete?)
We might be stepping on over on each others feet here #1256 I've restructured the package layout and re-did tests for it. I think we should reconcile our PRs to avoid duplicate work. |
Solves #1254