fix: gracefully handle missing tag for syncing
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
d7cf11b876
commit
d9f3a11265
|
@ -127,6 +127,7 @@ your SSH keys configured on your account.
|
||||||
func getImageVersions(recipe recipe.Recipe) (map[string]string, error) {
|
func getImageVersions(recipe recipe.Recipe) (map[string]string, error) {
|
||||||
var services = make(map[string]string)
|
var services = make(map[string]string)
|
||||||
|
|
||||||
|
missingTag := false
|
||||||
for _, service := range recipe.Config.Services {
|
for _, service := range recipe.Config.Services {
|
||||||
if service.Image == "" {
|
if service.Image == "" {
|
||||||
continue
|
continue
|
||||||
|
@ -146,12 +147,19 @@ func getImageVersions(recipe recipe.Recipe) (map[string]string, error) {
|
||||||
case reference.NamedTagged:
|
case reference.NamedTagged:
|
||||||
tag = img.(reference.NamedTagged).Tag()
|
tag = img.(reference.NamedTagged).Tag()
|
||||||
case reference.Named:
|
case reference.Named:
|
||||||
return services, fmt.Errorf("%s service is missing image tag?", path)
|
if service.Name == "app" {
|
||||||
|
missingTag = true
|
||||||
|
}
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
services[path] = tag
|
services[path] = tag
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if missingTag {
|
||||||
|
return services, fmt.Errorf("app service is missing image tag?")
|
||||||
|
}
|
||||||
|
|
||||||
return services, nil
|
return services, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue