diff --git a/cli/recipe/recipe.go b/cli/recipe/recipe.go index 388ba718..22dcef28 100644 --- a/cli/recipe/recipe.go +++ b/cli/recipe/recipe.go @@ -305,6 +305,7 @@ var recipeLintCommand = &cli.Command{ healthChecksForAllServices := true allImagesTagged := true noUnstableTags := true + semverLikeTags := true for _, service := range compose.Services { if service.Name == "app" { serviceNamedApp = true @@ -326,10 +327,15 @@ var recipeLintCommand = &cli.Command{ allImagesTagged = false } - if img.(reference.NamedTagged).Tag() == "latest" { + tag := img.(reference.NamedTagged).Tag() + if tag == "latest" { noUnstableTags = false } + if !tagcmp.IsParsable(tag) { + semverLikeTags = false + } + if service.HealthCheck == nil { healthChecksForAllServices = false } @@ -344,6 +350,7 @@ var recipeLintCommand = &cli.Command{ table.Append([]string{"All services have a healthcheck enabled", strconv.FormatBool(healthChecksForAllServices)}) table.Append([]string{"All images are using a tag", strconv.FormatBool(allImagesTagged)}) table.Append([]string{"No usage of unstable 'latest' tags", strconv.FormatBool(noUnstableTags)}) + table.Append([]string{"All tags are using a semver-like format", strconv.FormatBool(semverLikeTags)}) table.Render() return nil