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

allow custom components to run without nanobox's hooks #368

Merged
merged 1 commit into from
Feb 14, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion util/hookit/hookit.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ import (
// Exec executes a hook inside of a container
func Exec(container, hook, payload, displayLevel string) (string, error) {
out, err := util.DockerExec(container, "root", "/opt/nanobox/hooks/"+hook, []string{payload}, display.NewStreamer(displayLevel))
if err != nil && (strings.Contains(string(out), "No such file or directory") && strings.Contains(err.Error(), "bad exit code(126)")) {
if err != nil && (strings.Contains(string(out), "such file or directory") && strings.Contains(err.Error(), "bad exit code(126)")) {
// if its a 126 the hook didnt exist
return "", nil
}

if err != nil {
return out, util.ErrorAppend(err, "failed to exe in container")
}
Expand Down