Skip to content

Commit f23d4de

Browse files
committed
address comments
1 parent 651dc4c commit f23d4de

File tree

5 files changed

+19
-6
lines changed

5 files changed

+19
-6
lines changed

agent/engine/docker_task_engine_test.go

+9
Original file line numberDiff line numberDiff line change
@@ -1935,19 +1935,28 @@ func TestSynchronizeContainerStatus(t *testing.T) {
19351935
labels := map[string]string{
19361936
"name": "metadata",
19371937
}
1938+
volumes := []docker.Mount{
1939+
{
1940+
Name: "volume",
1941+
Source: "/src/vol",
1942+
Destination: "/vol",
1943+
},
1944+
}
19381945
created := time.Now()
19391946
gomock.InOrder(
19401947
client.EXPECT().DescribeContainer(gomock.Any(), dockerID).Return(apicontainerstatus.ContainerRunning,
19411948
dockerapi.DockerContainerMetadata{
19421949
Labels: labels,
19431950
DockerID: dockerID,
19441951
CreatedAt: created,
1952+
Volumes: volumes,
19451953
}),
19461954
imageManager.EXPECT().RecordContainerReference(dockerContainer.Container),
19471955
)
19481956
taskEngine.(*DockerTaskEngine).synchronizeContainerStatus(dockerContainer, nil)
19491957
assert.Equal(t, created, dockerContainer.Container.GetCreatedAt())
19501958
assert.Equal(t, labels, dockerContainer.Container.GetLabels())
1959+
assert.Equal(t, volumes, dockerContainer.Container.GetVolumes())
19511960
}
19521961

19531962
// TestHandleDockerHealthEvent tests the docker health event will only cause the

agent/functional_tests/testdata/taskdefinitions/taskmetadata-validator-awsvpc/task-definition.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,17 @@
2222
},
2323
"mountPoints": [
2424
{
25-
"sourceVolume": "task-local",
25+
"sourceVolume": "shared-local",
2626
"containerPath": "/ecs/"
2727
}
2828
]
2929
}],
3030
"volumes":[
3131
{
32-
"name": "task-local",
32+
"name": "shared-local",
3333
"dockerVolumeConfiguration" :{
34-
"scope": "task",
34+
"scope": "shared",
35+
"autoprovision":true,
3536
"driver": "local"
3637
}
3738
}

agent/functional_tests/tests/functionaltests_unix_test.go

-2
Original file line numberDiff line numberDiff line change
@@ -625,8 +625,6 @@ func TestAgentIntrospectionValidator(t *testing.T) {
625625
},
626626
})
627627
defer agent.Cleanup()
628-
// The Agent version was 1.14.2 when we added changes to agent introspection
629-
// endpoint feature for the last time.
630628
agent.RequireVersion(">1.20.1")
631629

632630
tdOverrides := make(map[string]string)

agent/handlers/v1/response.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ func NewPortBindingsResponse(dockerContainer *apicontainer.DockerContainer, eni
156156
// NewVolumesResponse creates VolumeResponse for a container
157157
func NewVolumesResponse(dockerContainer *apicontainer.DockerContainer) []VolumeResponse {
158158
container := dockerContainer.Container
159-
resp := []VolumeResponse{}
159+
var resp []VolumeResponse
160160

161161
volumes := container.GetVolumes()
162162

misc/taskmetadata-validator/taskmetadata-validator.go

+5
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,11 @@ func main() {
256256
os.Exit(1)
257257
}
258258

259+
if containerMetadata.Volumes[0].DockerName != "shared-local" || containerMetadata.Volumes[0].Destination != "/ecs" {
260+
fmt.Fprintf(os.Stderr, "Volume metadata fields incorrect")
261+
os.Exit(1)
262+
}
263+
259264
_, err = taskStats(client)
260265
if err != nil {
261266
fmt.Fprintf(os.Stderr, "Unable to get task stats: %v", err)

0 commit comments

Comments
 (0)