@@ -20,10 +20,10 @@ import (
20
20
21
21
"github.com/aws/amazon-ecs-agent/agent/api"
22
22
apicontainer "github.com/aws/amazon-ecs-agent/agent/api/container"
23
- "github.com/aws/amazon-ecs-agent/agent/containermetadata"
24
23
"github.com/aws/amazon-ecs-agent/agent/engine/dockerstate"
25
24
v1 "github.com/aws/amazon-ecs-agent/agent/handlers/v1"
26
25
apieni "github.com/aws/amazon-ecs-agent/ecs-agent/api/eni"
26
+ tmdsresponse "github.com/aws/amazon-ecs-agent/ecs-agent/tmds/handlers/response"
27
27
"github.com/aws/amazon-ecs-agent/ecs-agent/tmds/handlers/utils"
28
28
"github.com/aws/aws-sdk-go/aws"
29
29
"github.com/cihub/seelog"
@@ -53,27 +53,27 @@ type TaskResponse struct {
53
53
// ContainerResponse defines the schema for the container response
54
54
// JSON object
55
55
type ContainerResponse struct {
56
- ID string `json:"DockerId"`
57
- Name string `json:"Name"`
58
- DockerName string `json:"DockerName"`
59
- Image string `json:"Image"`
60
- ImageID string `json:"ImageID"`
61
- Ports []v1 .PortResponse `json:"Ports,omitempty"`
62
- Labels map [string ]string `json:"Labels,omitempty"`
63
- DesiredStatus string `json:"DesiredStatus"`
64
- KnownStatus string `json:"KnownStatus"`
65
- ExitCode * int `json:"ExitCode,omitempty"`
66
- Limits LimitsResponse `json:"Limits"`
67
- CreatedAt * time.Time `json:"CreatedAt,omitempty"`
68
- StartedAt * time.Time `json:"StartedAt,omitempty"`
69
- FinishedAt * time.Time `json:"FinishedAt,omitempty"`
70
- Type string `json:"Type"`
71
- Networks []containermetadata .Network `json:"Networks,omitempty"`
72
- Health * apicontainer.HealthStatus `json:"Health,omitempty"`
73
- Volumes []v1 .VolumeResponse `json:"Volumes,omitempty"`
74
- LogDriver string `json:"LogDriver,omitempty"`
75
- LogOptions map [string ]string `json:"LogOptions,omitempty"`
76
- ContainerARN string `json:"ContainerARN,omitempty"`
56
+ ID string `json:"DockerId"`
57
+ Name string `json:"Name"`
58
+ DockerName string `json:"DockerName"`
59
+ Image string `json:"Image"`
60
+ ImageID string `json:"ImageID"`
61
+ Ports []tmdsresponse .PortResponse `json:"Ports,omitempty"`
62
+ Labels map [string ]string `json:"Labels,omitempty"`
63
+ DesiredStatus string `json:"DesiredStatus"`
64
+ KnownStatus string `json:"KnownStatus"`
65
+ ExitCode * int `json:"ExitCode,omitempty"`
66
+ Limits LimitsResponse `json:"Limits"`
67
+ CreatedAt * time.Time `json:"CreatedAt,omitempty"`
68
+ StartedAt * time.Time `json:"StartedAt,omitempty"`
69
+ FinishedAt * time.Time `json:"FinishedAt,omitempty"`
70
+ Type string `json:"Type"`
71
+ Networks []tmdsresponse .Network `json:"Networks,omitempty"`
72
+ Health * apicontainer.HealthStatus `json:"Health,omitempty"`
73
+ Volumes []tmdsresponse .VolumeResponse `json:"Volumes,omitempty"`
74
+ LogDriver string `json:"LogDriver,omitempty"`
75
+ LogOptions map [string ]string `json:"LogOptions,omitempty"`
76
+ ContainerARN string `json:"ContainerARN,omitempty"`
77
77
}
78
78
79
79
// LimitsResponse defines the schema for task/cpu limits response
@@ -272,7 +272,7 @@ func NewContainerResponse(
272
272
}
273
273
274
274
for _ , binding := range container .GetKnownPortBindings () {
275
- port := v1 .PortResponse {
275
+ port := tmdsresponse .PortResponse {
276
276
ContainerPort : binding .ContainerPort ,
277
277
Protocol : binding .Protocol .String (),
278
278
}
@@ -289,7 +289,7 @@ func NewContainerResponse(
289
289
}
290
290
291
291
if eni != nil {
292
- resp .Networks = []containermetadata .Network {
292
+ resp .Networks = []tmdsresponse .Network {
293
293
{
294
294
NetworkMode : utils .NetworkModeAWSVPC ,
295
295
IPv4Addresses : eni .GetIPV4Addresses (),
0 commit comments