-
Notifications
You must be signed in to change notification settings - Fork 300
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 --no-plugins option to agent #540
Conversation
.buildkite-agent.cfg | ||
/.agent.conf | ||
/.agent.*.conf | ||
/.buildkite-agent.cfg |
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.
👍
bootstrap/bootstrap.go
Outdated
|
||
// Check if we can run plugins (disabled via --no-plugins) | ||
if b.Plugins != "" && !b.Config.PluginsEnabled { | ||
return fmt.Errorf("This agent is isn't allowed to run plugins. To allow this, re-run this agent without the `--no-plugins` option.") |
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.
Is there an extra "is" in here? ;-)
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.
There is is. Good catch.
@@ -42,7 +43,7 @@ type Shell struct { | |||
func New() (*Shell, error) { | |||
wd, err := os.Getwd() | |||
if err != nil { | |||
return nil, fmt.Errorf("Failed to find current working directory: %v", err) | |||
return nil, errors.Wrapf(err, "Failed to find current working directory: %v") |
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.
Loving the wraps 👍 🌯
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.
Yeah, me too. They are really nice.
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 all looks pretty good to me!
This adds a
--no-plugins
option to an agent, which causes as step to fail with an error if there is a plugin present:A little bit of extra technology was needed to clean up how errors are wrapped and returned from the bootstrap. Previously there was a duplication of errors from when the command failed and when the phase failed.