Don't prepent docker.io to image URI. Let the container runtime apply default registry

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
Nicolas De Loof 2020-07-08 16:07:13 +02:00
parent 6664447d29
commit ec58975524
No known key found for this signature in database
GPG Key ID: 9858809D6F8F6E7E
4 changed files with 4 additions and 15 deletions

View File

@ -128,7 +128,7 @@ services:
`)
def := template.Resources["TestTaskDefinition"].(*ecs.TaskDefinition)
container := def.ContainerDefinitions[0]
assert.Equal(t, container.Image, "docker.io/library/image")
assert.Equal(t, container.Image, "image")
assert.Equal(t, container.Command[0], "command")
assert.Equal(t, container.EntryPoint[0], "entrypoint")
assert.Equal(t, get(container.Environment, "FOO"), "BAR")

View File

@ -52,7 +52,7 @@ func Convert(project *types.Project, service types.ServiceConfig) (*ecs.TaskDefi
FirelensConfiguration: nil,
HealthCheck: toHealthCheck(service.HealthCheck),
Hostname: service.Hostname,
Image: getImage(service.Image),
Image: service.Image,
Interactive: false,
Links: nil,
LinuxParameters: toLinuxParameters(service),
@ -308,17 +308,6 @@ func toKeyValuePair(environment types.MappingWithEquals) []ecs.TaskDefinition_Ke
return pairs
}
func getImage(image string) string {
switch f := strings.Split(image, "/"); len(f) {
case 1:
return "docker.io/library/" + image
case 2:
return "docker.io/" + image
default:
return image
}
}
func getRepoCredentials(service types.ServiceConfig) *ecs.TaskDefinition_RepositoryCredentials {
// extract registry and namespace string from image name
for key, value := range service.Extensions {

View File

@ -174,7 +174,7 @@
}
],
"Essential": true,
"Image": "docker.io/library/nginx",
"Image": "nginx",
"LinuxParameters": {},
"LogConfiguration": {
"LogDriver": "awslogs",

View File

@ -174,7 +174,7 @@
}
],
"Essential": true,
"Image": "docker.io/library/haproxy",
"Image": "haproxy",
"LinuxParameters": {},
"LogConfiguration": {
"LogDriver": "awslogs",