Skip to content

Commit

Permalink
fix: ignore 0 exit code
Browse files Browse the repository at this point in the history
  • Loading branch information
xtuc committed Jun 25, 2017
1 parent 501f12c commit d782c4c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions cmd/daemon/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ func newTopicArn(str string) *string {
return &str
}

func onContainerDieFailure(sns *sdk.SNS, service string) {
func onContainerDieFailure(sns *sdk.SNS, service string, exitCode string) {
errorMessage := t.ErrorMessage{
ServiceName: service,
ServiceStatus: "died",
ServiceStatus: "died (exited with code " + exitCode + ")",
Log: "",
}

Expand Down Expand Up @@ -112,7 +112,11 @@ func main() {
}

if msg.Action == "die" {
onContainerDieFailure(snsClient, msg.Actor.Attributes["image"])
exitCode := msg.Actor.Attributes["exitCode"]

if exitCode != "0" {
onContainerDieFailure(snsClient, msg.Actor.Attributes["image"], exitCode)
}
}
}
}
Expand Down

0 comments on commit d782c4c

Please sign in to comment.