Skip to content

Commit

Permalink
fix: fixed chmod issue with on-init script in pwinit
Browse files Browse the repository at this point in the history
fix: fixed an issue with entrypoint not being parsed properly when a challenges is composed of multiple services
  • Loading branch information
Z-a-r-a-k-i committed Jan 12, 2020
1 parent 56f799c commit 31d9595
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions go/cmd/pwinit/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ func main() {
} else {
log.Print("starting on-init hook")
// prepare the challenge
err = os.Chmod("/pwinit/on-init", 0555)
if err != nil {
return errcode.ErrExecuteOnInitHook.Wrap(err)
}
cmd := exec.Command("/pwinit/on-init")
err = cmd.Run()
if err != nil {
Expand Down
3 changes: 3 additions & 0 deletions go/pkg/pwcompose/compose.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,9 @@ func Up(
return errcode.ErrDockerAPIImageInspect.Wrap(err)
}
for name, service := range preparedComposeStruct.Services {
if name != instance.Labels[serviceNameLabel] {
continue
}
// find service from compose file of current instance
entrypoint := []string{}
if len(imageInspect.Config.Entrypoint) > 0 {
Expand Down

0 comments on commit 31d9595

Please sign in to comment.