forked from coop-cloud/abra
feat: detect if tags are not parsable
This commit is contained in:
parent
210baf1905
commit
e39c6a05be
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user