Skip to content

Commit 5c348e3

Browse files
authored
Merge pull request #340 from ndeloof/healthcheck
validate healthcheck is well configured
2 parents e4c15da + 4e1fcd3 commit 5c348e3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

loader/validate.go

+8
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ func checkConsistency(project *types.Project) error {
3838
}
3939
}
4040

41+
if s.HealthCheck != nil && len(s.HealthCheck.Test) > 0 {
42+
switch s.HealthCheck.Test[0] {
43+
case "CMD", "CMD-SHELL", "NONE":
44+
default:
45+
return errors.New(`healthcheck.test must start either by "CMD", "CMD-SHELL" or "NONE"`)
46+
}
47+
}
48+
4149
for dependedService := range s.DependsOn {
4250
if _, err := project.GetService(dependedService); err != nil {
4351
return errors.Wrap(errdefs.ErrInvalid, fmt.Sprintf("service %q depends on undefined service %s", s.Name, dependedService))

0 commit comments

Comments
 (0)