-
Notifications
You must be signed in to change notification settings - Fork 103
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
add tracing to all allowed cmds #2061
add tracing to all allowed cmds #2061
Conversation
func execFaker(filename string) func(context.Context, ...string) (*exec.Cmd, error) { | ||
return func(ctx context.Context, _ ...string) (*exec.Cmd, error) { | ||
return exec.CommandContext(ctx, "/bin/cat", filename), nil //nolint:forbidigo // Fine to use exec.CommandContext in test | ||
func execFaker(filename string) func(context.Context, ...string) (*allowedcmd.TracedCmd, error) { |
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.
the method is the reason I had to export allowedcmd.TracedCmd
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.
This is really nice! One small comment about cmd.Environ
, otherwise LGTM!
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.
🔥
Embeds our allowed commands in a TracedCmd struct to start a span when ever we exec.