forked from toolshed/abra
		
	feat: detect if tags are not parsable
This commit is contained in:
		| @ -305,6 +305,7 @@ var recipeLintCommand = &cli.Command{ | |||||||
| 		healthChecksForAllServices := true | 		healthChecksForAllServices := true | ||||||
| 		allImagesTagged := true | 		allImagesTagged := true | ||||||
| 		noUnstableTags := true | 		noUnstableTags := true | ||||||
|  | 		semverLikeTags := true | ||||||
| 		for _, service := range compose.Services { | 		for _, service := range compose.Services { | ||||||
| 			if service.Name == "app" { | 			if service.Name == "app" { | ||||||
| 				serviceNamedApp = true | 				serviceNamedApp = true | ||||||
| @ -326,10 +327,15 @@ var recipeLintCommand = &cli.Command{ | |||||||
| 				allImagesTagged = false | 				allImagesTagged = false | ||||||
| 			} | 			} | ||||||
|  |  | ||||||
| 			if img.(reference.NamedTagged).Tag() == "latest" { | 			tag := img.(reference.NamedTagged).Tag() | ||||||
|  | 			if tag == "latest" { | ||||||
| 				noUnstableTags = false | 				noUnstableTags = false | ||||||
| 			} | 			} | ||||||
|  |  | ||||||
|  | 			if !tagcmp.IsParsable(tag) { | ||||||
|  | 				semverLikeTags = false | ||||||
|  | 			} | ||||||
|  |  | ||||||
| 			if service.HealthCheck == nil { | 			if service.HealthCheck == nil { | ||||||
| 				healthChecksForAllServices = false | 				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 services have a healthcheck enabled", strconv.FormatBool(healthChecksForAllServices)}) | ||||||
| 		table.Append([]string{"All images are using a tag", strconv.FormatBool(allImagesTagged)}) | 		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{"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() | 		table.Render() | ||||||
|  |  | ||||||
| 		return nil | 		return nil | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user