diff --git a/agent/vendor/github.com/aws/amazon-ecs-agent/ecs-agent/api/ecs/statechange.go b/agent/vendor/github.com/aws/amazon-ecs-agent/ecs-agent/api/ecs/statechange.go index 076926bd368..70111f02a2d 100644 --- a/agent/vendor/github.com/aws/amazon-ecs-agent/ecs-agent/api/ecs/statechange.go +++ b/agent/vendor/github.com/aws/amazon-ecs-agent/ecs-agent/api/ecs/statechange.go @@ -18,6 +18,7 @@ import ( "strconv" "time" + "github.com/aws/amazon-ecs-agent/ecs-agent/api/attachment" apicontainerstatus "github.com/aws/amazon-ecs-agent/ecs-agent/api/container/status" "github.com/aws/amazon-ecs-agent/ecs-agent/api/ecs/model/ecs" apitaskstatus "github.com/aws/amazon-ecs-agent/ecs-agent/api/task/status" @@ -96,8 +97,8 @@ type TaskStateChange struct { // AttachmentStateChange represents a state change that needs to be sent to the // SubmitAttachmentStateChanges API. type AttachmentStateChange struct { - // Attachment is the ENI attachment object to send. - Attachment *ni.ENIAttachment + // Attachment is the attachment object to send. + Attachment attachment.Attachment } // String returns a human readable string representation of a ContainerStateChange. @@ -146,8 +147,8 @@ func (change *TaskStateChange) String() string { // String returns a human readable string representation of an AttachmentStateChange. func (change *AttachmentStateChange) String() string { if change.Attachment != nil { - return fmt.Sprintf("%s -> %s, %s", change.Attachment.AttachmentARN, change.Attachment.Status.String(), - change.Attachment.String()) + return fmt.Sprintf("%s -> %v, %s", change.Attachment.GetAttachmentARN(), + change.Attachment.GetAttachmentStatus(), change.Attachment.String()) } return "" diff --git a/ecs-agent/api/ecs/statechange.go b/ecs-agent/api/ecs/statechange.go index 076926bd368..70111f02a2d 100644 --- a/ecs-agent/api/ecs/statechange.go +++ b/ecs-agent/api/ecs/statechange.go @@ -18,6 +18,7 @@ import ( "strconv" "time" + "github.com/aws/amazon-ecs-agent/ecs-agent/api/attachment" apicontainerstatus "github.com/aws/amazon-ecs-agent/ecs-agent/api/container/status" "github.com/aws/amazon-ecs-agent/ecs-agent/api/ecs/model/ecs" apitaskstatus "github.com/aws/amazon-ecs-agent/ecs-agent/api/task/status" @@ -96,8 +97,8 @@ type TaskStateChange struct { // AttachmentStateChange represents a state change that needs to be sent to the // SubmitAttachmentStateChanges API. type AttachmentStateChange struct { - // Attachment is the ENI attachment object to send. - Attachment *ni.ENIAttachment + // Attachment is the attachment object to send. + Attachment attachment.Attachment } // String returns a human readable string representation of a ContainerStateChange. @@ -146,8 +147,8 @@ func (change *TaskStateChange) String() string { // String returns a human readable string representation of an AttachmentStateChange. func (change *AttachmentStateChange) String() string { if change.Attachment != nil { - return fmt.Sprintf("%s -> %s, %s", change.Attachment.AttachmentARN, change.Attachment.Status.String(), - change.Attachment.String()) + return fmt.Sprintf("%s -> %v, %s", change.Attachment.GetAttachmentARN(), + change.Attachment.GetAttachmentStatus(), change.Attachment.String()) } return "" diff --git a/ecs-agent/api/ecs/statechange_test.go b/ecs-agent/api/ecs/statechange_test.go index f27cff7fdab..3a97847b676 100644 --- a/ecs-agent/api/ecs/statechange_test.go +++ b/ecs-agent/api/ecs/statechange_test.go @@ -157,8 +157,8 @@ func TestAttachmentStateChangeString(t *testing.T) { }, } - expectedStr := fmt.Sprintf("%s -> %s, %s", change.Attachment.AttachmentARN, - change.Attachment.Status.String(), change.Attachment.String()) + expectedStr := fmt.Sprintf("%s -> %v, %s", change.Attachment.GetAttachmentARN(), + change.Attachment.GetAttachmentStatus(), change.Attachment.String()) assert.Equal(t, expectedStr, change.String()) }