Skip to content

Commit f2704cc

Browse files
committed
Set the environment variable to start the agent with 'task-iamrole' capability
1 parent 802428a commit f2704cc

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

ecs-init/docker/docker.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ func (c *Client) getContainerConfig() *godocker.Config {
142142
"ECS_UPDATE_DOWNLOAD_DIR": config.CacheDirectory(),
143143
"ECS_UPDATES_ENABLED": "true",
144144
"ECS_AVAILABLE_LOGGING_DRIVERS": `["json-file","syslog","awslogs"]`,
145+
"ECS_ENABLE_TASK_IAM_ROLE": "true",
145146
}
146147

147148
// merge in user-supplied environment variables

ecs-init/docker/docker_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ func validateCommonCreateContainerOptions(opts godocker.CreateContainerOptions,
225225
expectKey("ECS_UPDATE_DOWNLOAD_DIR="+config.CacheDirectory(), envVariables, t)
226226
expectKey("ECS_UPDATES_ENABLED=true", envVariables, t)
227227
expectKey(`ECS_AVAILABLE_LOGGING_DRIVERS=["json-file","syslog","awslogs"]`, envVariables, t)
228+
expectKey("ECS_ENABLE_TASK_IAM_ROLE=true", envVariables, t)
228229

229230
if len(cfg.ExposedPorts) != 2 {
230231
t.Errorf("Expected exactly 2 elements to be in ExposedPorts, but was %d", len(cfg.ExposedPorts))
@@ -272,7 +273,7 @@ func expectLocalhostTCPPortBindings(input map[godocker.Port][]godocker.PortBindi
272273
}
273274
}
274275
} else {
275-
t.Error("Expected 51678/tcp to be defined")
276+
t.Errorf("Expected %s/tcp to be defined", port)
276277
}
277278
}
278279

0 commit comments

Comments
 (0)