Skip to content

Commit

Permalink
Merge pull request #340 from ndeloof/healthcheck
Browse files Browse the repository at this point in the history
validate healthcheck is well configured
  • Loading branch information
laurazard committed Jan 10, 2023
2 parents e4c15da + 4e1fcd3 commit 5c348e3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions loader/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ func checkConsistency(project *types.Project) error {
}
}

if s.HealthCheck != nil && len(s.HealthCheck.Test) > 0 {
switch s.HealthCheck.Test[0] {
case "CMD", "CMD-SHELL", "NONE":
default:
return errors.New(`healthcheck.test must start either by "CMD", "CMD-SHELL" or "NONE"`)
}
}

for dependedService := range s.DependsOn {
if _, err := project.GetService(dependedService); err != nil {
return errors.Wrap(errdefs.ErrInvalid, fmt.Sprintf("service %q depends on undefined service %s", s.Name, dependedService))
Expand Down

0 comments on commit 5c348e3

Please sign in to comment.