Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sharanyad committed Aug 22, 2018
1 parent 651dc4c commit f23d4de
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 6 deletions.
9 changes: 9 additions & 0 deletions agent/engine/docker_task_engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1935,19 +1935,28 @@ func TestSynchronizeContainerStatus(t *testing.T) {
labels := map[string]string{
"name": "metadata",
}
volumes := []docker.Mount{
{
Name: "volume",
Source: "/src/vol",
Destination: "/vol",
},
}
created := time.Now()
gomock.InOrder(
client.EXPECT().DescribeContainer(gomock.Any(), dockerID).Return(apicontainerstatus.ContainerRunning,
dockerapi.DockerContainerMetadata{
Labels: labels,
DockerID: dockerID,
CreatedAt: created,
Volumes: volumes,
}),
imageManager.EXPECT().RecordContainerReference(dockerContainer.Container),
)
taskEngine.(*DockerTaskEngine).synchronizeContainerStatus(dockerContainer, nil)
assert.Equal(t, created, dockerContainer.Container.GetCreatedAt())
assert.Equal(t, labels, dockerContainer.Container.GetLabels())
assert.Equal(t, volumes, dockerContainer.Container.GetVolumes())
}

// TestHandleDockerHealthEvent tests the docker health event will only cause the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,17 @@
},
"mountPoints": [
{
"sourceVolume": "task-local",
"sourceVolume": "shared-local",
"containerPath": "/ecs/"
}
]
}],
"volumes":[
{
"name": "task-local",
"name": "shared-local",
"dockerVolumeConfiguration" :{
"scope": "task",
"scope": "shared",
"autoprovision":true,
"driver": "local"
}
}
Expand Down
2 changes: 0 additions & 2 deletions agent/functional_tests/tests/functionaltests_unix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -625,8 +625,6 @@ func TestAgentIntrospectionValidator(t *testing.T) {
},
})
defer agent.Cleanup()
// The Agent version was 1.14.2 when we added changes to agent introspection
// endpoint feature for the last time.
agent.RequireVersion(">1.20.1")

tdOverrides := make(map[string]string)
Expand Down
2 changes: 1 addition & 1 deletion agent/handlers/v1/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ func NewPortBindingsResponse(dockerContainer *apicontainer.DockerContainer, eni
// NewVolumesResponse creates VolumeResponse for a container
func NewVolumesResponse(dockerContainer *apicontainer.DockerContainer) []VolumeResponse {
container := dockerContainer.Container
resp := []VolumeResponse{}
var resp []VolumeResponse

volumes := container.GetVolumes()

Expand Down
5 changes: 5 additions & 0 deletions misc/taskmetadata-validator/taskmetadata-validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,11 @@ func main() {
os.Exit(1)
}

if containerMetadata.Volumes[0].DockerName != "shared-local" || containerMetadata.Volumes[0].Destination != "/ecs" {
fmt.Fprintf(os.Stderr, "Volume metadata fields incorrect")
os.Exit(1)
}

_, err = taskStats(client)
if err != nil {
fmt.Fprintf(os.Stderr, "Unable to get task stats: %v", err)
Expand Down

0 comments on commit f23d4de

Please sign in to comment.