Skip to content

Commit

Permalink
change ports response from Ports to KnownPortBindings
Browse files Browse the repository at this point in the history
  • Loading branch information
sharanyad committed Jun 25, 2020
1 parent d800918 commit e5408cd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions agent/handlers/task_server_setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ var (
CPU: cpu,
Memory: memory,
Type: apicontainer.ContainerNormal,
Ports: []apicontainer.PortBinding{
KnownPortBindingsUnsafe: []apicontainer.PortBinding{
{
ContainerPort: containerPort,
Protocol: apicontainer.TransportProtocolTCP,
Expand Down Expand Up @@ -229,7 +229,7 @@ var (
CPU: cpu,
Memory: memory,
Type: apicontainer.ContainerNormal,
Ports: []apicontainer.PortBinding{
KnownPortBindingsUnsafe: []apicontainer.PortBinding{
{
ContainerPort: containerPort,
Protocol: apicontainer.TransportProtocolTCP,
Expand Down
2 changes: 1 addition & 1 deletion agent/handlers/v2/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ func newContainerResponse(dockerContainer *apicontainer.DockerContainer,
resp.FinishedAt = &finishedAt
}

for _, binding := range container.Ports {
for _, binding := range container.GetKnownPortBindings() {
port := v1.PortResponse{
ContainerPort: binding.ContainerPort,
Protocol: binding.Protocol.String(),
Expand Down
4 changes: 2 additions & 2 deletions agent/handlers/v2/response_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ func TestTaskResponseMarshal(t *testing.T) {
V3EndpointID: "",
Image: imageName,
ImageID: imageID,
Ports: []apicontainer.PortBinding{
KnownPortBindingsUnsafe: []apicontainer.PortBinding{
{
ContainerPort: 80,
Protocol: apicontainer.TransportProtocolTCP,
Expand Down Expand Up @@ -414,7 +414,7 @@ func TestContainerResponseMarshal(t *testing.T) {
Status: apicontainerstatus.ContainerHealthy,
Since: aws.Time(timeRFC3339),
},
Ports: []apicontainer.PortBinding{
KnownPortBindingsUnsafe: []apicontainer.PortBinding{
{
ContainerPort: 80,
Protocol: apicontainer.TransportProtocolTCP,
Expand Down

0 comments on commit e5408cd

Please sign in to comment.