forked from coop-cloud/abra
fix: gracefully handle missing tag for syncing
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) {
|
||||
var services = make(map[string]string)
|
||||
|
||||
missingTag := false
|
||||
for _, service := range recipe.Config.Services {
|
||||
if service.Image == "" {
|
||||
continue
|
||||
|
@ -146,12 +147,19 @@ func getImageVersions(recipe recipe.Recipe) (map[string]string, error) {
|
|||
case reference.NamedTagged:
|
||||
tag = img.(reference.NamedTagged).Tag()
|
||||
case reference.Named:
|
||||
return services, fmt.Errorf("%s service is missing image tag?", path)
|
||||
if service.Name == "app" {
|
||||
missingTag = true
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
services[path] = tag
|
||||
}
|
||||
|
||||
if missingTag {
|
||||
return services, fmt.Errorf("app service is missing image tag?")
|
||||
}
|
||||
|
||||
return services, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue