@@ -2514,6 +2514,7 @@ func TestV2TaskMetadataWithTags(t *testing.T) {
25142514 state .EXPECT ().GetTaskByIPAddress (remoteIP ).Return (taskARN , true ),
25152515 state .EXPECT ().TaskByArn (taskARN ).Return (task , true ),
25162516 state .EXPECT ().ContainerMapByArn (taskARN ).Return (containerNameToDockerContainer , true ),
2517+ state .EXPECT ().ContainerNameByV3EndpointID ("" ).Return (containerName , true ),
25172518 )
25182519 }
25192520
@@ -2529,9 +2530,9 @@ func TestV2TaskMetadataWithTags(t *testing.T) {
25292530 setStateExpectations : happyStateExpectations ,
25302531 setECSClientExpectations : func (ecsClient * mock_ecs.MockECSClient ) {
25312532 gomock .InOrder (
2532- ecsClient .EXPECT ().GetResourceTags (containerInstanceArn ).
2533+ ecsClient .EXPECT ().GetResourceTags (gomock . Any (), containerInstanceArn ).
25332534 Return (ecsInstanceTags , nil ),
2534- ecsClient .EXPECT ().GetResourceTags (taskARN ).Return (ecsTaskTags , nil ),
2535+ ecsClient .EXPECT ().GetResourceTags (gomock . Any (), taskARN ).Return (ecsTaskTags , nil ),
25352536 )
25362537 },
25372538 expectedStatusCode : http .StatusOK ,
@@ -2548,8 +2549,8 @@ func TestV2TaskMetadataWithTags(t *testing.T) {
25482549 setStateExpectations : happyStateExpectations ,
25492550 setECSClientExpectations : func (ecsClient * mock_ecs.MockECSClient ) {
25502551 gomock .InOrder (
2551- ecsClient .EXPECT ().GetResourceTags (containerInstanceArn ).Return (ecsInstanceTags , nil ),
2552- ecsClient .EXPECT ().GetResourceTags (taskARN ).Return (nil , errors .New ("error" )),
2552+ ecsClient .EXPECT ().GetResourceTags (gomock . Any (), containerInstanceArn ).Return (ecsInstanceTags , nil ),
2553+ ecsClient .EXPECT ().GetResourceTags (gomock . Any (), taskARN ).Return (nil , errors .New ("error" )),
25532554 )
25542555 },
25552556 expectedStatusCode : http .StatusOK ,
@@ -2564,8 +2565,8 @@ func TestV2TaskMetadataWithTags(t *testing.T) {
25642565 setStateExpectations : happyStateExpectations ,
25652566 setECSClientExpectations : func (ecsClient * mock_ecs.MockECSClient ) {
25662567 gomock .InOrder (
2567- ecsClient .EXPECT ().GetResourceTags (containerInstanceArn ).Return (nil , errors .New ("error" )),
2568- ecsClient .EXPECT ().GetResourceTags (taskARN ).Return (ecsTaskTags , nil ),
2568+ ecsClient .EXPECT ().GetResourceTags (gomock . Any (), containerInstanceArn ).Return (nil , errors .New ("error" )),
2569+ ecsClient .EXPECT ().GetResourceTags (gomock . Any (), taskARN ).Return (ecsTaskTags , nil ),
25692570 )
25702571 },
25712572 expectedStatusCode : http .StatusOK ,
@@ -2578,8 +2579,8 @@ func TestV2TaskMetadataWithTags(t *testing.T) {
25782579 setStateExpectations : happyStateExpectations ,
25792580 setECSClientExpectations : func (ecsClient * mock_ecs.MockECSClient ) {
25802581 gomock .InOrder (
2581- ecsClient .EXPECT ().GetResourceTags (containerInstanceArn ).Return (nil , errors .New ("error" )),
2582- ecsClient .EXPECT ().GetResourceTags (taskARN ).Return (nil , errors .New ("error" )),
2582+ ecsClient .EXPECT ().GetResourceTags (gomock . Any (), containerInstanceArn ).Return (nil , errors .New ("error" )),
2583+ ecsClient .EXPECT ().GetResourceTags (gomock . Any (), taskARN ).Return (nil , errors .New ("error" )),
25832584 )
25842585 },
25852586 expectedStatusCode : http .StatusOK ,
@@ -2644,15 +2645,16 @@ func TestV3TaskMetadataWithTags(t *testing.T) {
26442645
26452646 happyECSClientExpectations := func (ecsClient * mock_ecs.MockECSClient ) {
26462647 gomock .InOrder (
2647- ecsClient .EXPECT ().GetResourceTags (containerInstanceArn ).Return (ecsInstanceTags , nil ),
2648- ecsClient .EXPECT ().GetResourceTags (taskARN ).Return (ecsTaskTags , nil ),
2648+ ecsClient .EXPECT ().GetResourceTags (gomock . Any (), containerInstanceArn ).Return (ecsInstanceTags , nil ),
2649+ ecsClient .EXPECT ().GetResourceTags (gomock . Any (), taskARN ).Return (ecsTaskTags , nil ),
26492650 )
26502651 }
26512652 happyStateExpectations := func (state * mock_dockerstate.MockTaskEngineState ) {
26522653 gomock .InOrder (
26532654 state .EXPECT ().TaskARNByV3EndpointID (v3EndpointID ).Return (taskARN , true ),
26542655 state .EXPECT ().TaskByArn (taskARN ).Return (task , true ),
26552656 state .EXPECT ().ContainerMapByArn (taskARN ).Return (containerNameToDockerContainer , true ),
2657+ state .EXPECT ().ContainerNameByV3EndpointID ("" ).Return (containerName , true ),
26562658 state .EXPECT ().TaskByArn (taskARN ).Return (task , true ),
26572659 )
26582660 }
@@ -2677,8 +2679,8 @@ func TestV3TaskMetadataWithTags(t *testing.T) {
26772679 setStateExpectations : happyStateExpectations ,
26782680 setECSClientExpectations : func (ecsClient * mock_ecs.MockECSClient ) {
26792681 gomock .InOrder (
2680- ecsClient .EXPECT ().GetResourceTags (containerInstanceArn ).Return (nil , errors .New ("error" )),
2681- ecsClient .EXPECT ().GetResourceTags (taskARN ).Return (ecsTaskTags , nil ),
2682+ ecsClient .EXPECT ().GetResourceTags (gomock . Any (), containerInstanceArn ).Return (nil , errors .New ("error" )),
2683+ ecsClient .EXPECT ().GetResourceTags (gomock . Any (), taskARN ).Return (ecsTaskTags , nil ),
26822684 )
26832685 },
26842686 expectedStatusCode : http .StatusOK ,
@@ -2693,8 +2695,8 @@ func TestV3TaskMetadataWithTags(t *testing.T) {
26932695 setStateExpectations : happyStateExpectations ,
26942696 setECSClientExpectations : func (ecsClient * mock_ecs.MockECSClient ) {
26952697 gomock .InOrder (
2696- ecsClient .EXPECT ().GetResourceTags (containerInstanceArn ).Return (ecsInstanceTags , nil ),
2697- ecsClient .EXPECT ().GetResourceTags (taskARN ).Return (nil , errors .New ("error" )),
2698+ ecsClient .EXPECT ().GetResourceTags (gomock . Any (), containerInstanceArn ).Return (ecsInstanceTags , nil ),
2699+ ecsClient .EXPECT ().GetResourceTags (gomock . Any (), taskARN ).Return (nil , errors .New ("error" )),
26982700 )
26992701 },
27002702 expectedStatusCode : http .StatusOK ,
@@ -2707,8 +2709,8 @@ func TestV3TaskMetadataWithTags(t *testing.T) {
27072709 setStateExpectations : happyStateExpectations ,
27082710 setECSClientExpectations : func (ecsClient * mock_ecs.MockECSClient ) {
27092711 gomock .InOrder (
2710- ecsClient .EXPECT ().GetResourceTags (containerInstanceArn ).Return (nil , errors .New ("error" )),
2711- ecsClient .EXPECT ().GetResourceTags (taskARN ).Return (nil , errors .New ("error" )),
2712+ ecsClient .EXPECT ().GetResourceTags (gomock . Any (), containerInstanceArn ).Return (nil , errors .New ("error" )),
2713+ ecsClient .EXPECT ().GetResourceTags (gomock . Any (), taskARN ).Return (nil , errors .New ("error" )),
27122714 )
27132715 },
27142716 expectedStatusCode : http .StatusOK ,
@@ -2768,6 +2770,7 @@ func TestV3TaskMetadataWithTags(t *testing.T) {
27682770 state .EXPECT ().TaskARNByV3EndpointID (v3EndpointID ).Return (taskARN , true ),
27692771 state .EXPECT ().TaskByArn (taskARN ).Return (bridgeTask , true ),
27702772 state .EXPECT ().ContainerMapByArn (taskARN ).Return (containerNameToBridgeContainer , true ),
2773+ state .EXPECT ().ContainerNameByV3EndpointID ("" ).Return (containerName , true ),
27712774 state .EXPECT ().TaskByArn (taskARN ).Return (bridgeTask , true ),
27722775 state .EXPECT ().ContainerByID (containerID ).Return (nil , false ),
27732776 )
@@ -2785,6 +2788,7 @@ func TestV3TaskMetadataWithTags(t *testing.T) {
27852788 state .EXPECT ().TaskARNByV3EndpointID (v3EndpointID ).Return (taskARN , true ),
27862789 state .EXPECT ().TaskByArn (taskARN ).Return (bridgeTask , true ),
27872790 state .EXPECT ().ContainerMapByArn (taskARN ).Return (containerNameToBridgeContainer , true ),
2791+ state .EXPECT ().ContainerNameByV3EndpointID ("" ).Return (containerName , true ),
27882792 state .EXPECT ().TaskByArn (taskARN ).Return (bridgeTask , true ),
27892793 state .EXPECT ().ContainerByID (containerID ).Return (bridgeContainerNoNetwork , true ),
27902794 )
@@ -2818,8 +2822,8 @@ func TestV4TaskMetadataWithTags(t *testing.T) {
28182822
28192823 happyECSClientExpectations := func (ecsClient * mock_ecs.MockECSClient ) {
28202824 gomock .InOrder (
2821- ecsClient .EXPECT ().GetResourceTags (containerInstanceArn ).Return (ecsInstanceTags , nil ),
2822- ecsClient .EXPECT ().GetResourceTags (taskARN ).Return (ecsTaskTags , nil ),
2825+ ecsClient .EXPECT ().GetResourceTags (gomock . Any (), containerInstanceArn ).Return (ecsInstanceTags , nil ),
2826+ ecsClient .EXPECT ().GetResourceTags (gomock . Any (), taskARN ).Return (ecsTaskTags , nil ),
28232827 )
28242828 }
28252829 happyStateExpectations := func (state * mock_dockerstate.MockTaskEngineState ) {
@@ -2828,6 +2832,7 @@ func TestV4TaskMetadataWithTags(t *testing.T) {
28282832 state .EXPECT ().TaskByArn (taskARN ).Return (task , true ).AnyTimes (),
28292833 state .EXPECT ().ContainerByID (containerID ).Return (bridgeContainer , true ).AnyTimes (),
28302834 state .EXPECT ().ContainerMapByArn (taskARN ).Return (containerNameToDockerContainer , true ),
2835+ state .EXPECT ().ContainerNameByV3EndpointID (v3EndpointID ).Return (containerName , true ),
28312836 state .EXPECT ().TaskByArn (taskARN ).Return (task , true ).AnyTimes (),
28322837 state .EXPECT ().ContainerByID (containerID ).Return (bridgeContainer , true ).AnyTimes (),
28332838 state .EXPECT ().PulledContainerMapByArn (taskARN ).Return (nil , true ),
@@ -2857,8 +2862,8 @@ func TestV4TaskMetadataWithTags(t *testing.T) {
28572862 setStateExpectations : happyStateExpectations ,
28582863 setECSClientExpectations : func (ecsClient * mock_ecs.MockECSClient ) {
28592864 gomock .InOrder (
2860- ecsClient .EXPECT ().GetResourceTags (containerInstanceArn ).Return (nil , errors .New ("error" )),
2861- ecsClient .EXPECT ().GetResourceTags (taskARN ).Return (ecsTaskTags , nil ),
2865+ ecsClient .EXPECT ().GetResourceTags (gomock . Any (), containerInstanceArn ).Return (nil , errors .New ("error" )),
2866+ ecsClient .EXPECT ().GetResourceTags (gomock . Any (), taskARN ).Return (ecsTaskTags , nil ),
28622867 )
28632868 },
28642869 expectedStatusCode : http .StatusOK ,
@@ -2874,8 +2879,8 @@ func TestV4TaskMetadataWithTags(t *testing.T) {
28742879 setStateExpectations : happyStateExpectations ,
28752880 setECSClientExpectations : func (ecsClient * mock_ecs.MockECSClient ) {
28762881 gomock .InOrder (
2877- ecsClient .EXPECT ().GetResourceTags (containerInstanceArn ).Return (ecsInstanceTags , nil ),
2878- ecsClient .EXPECT ().GetResourceTags (taskARN ).Return (nil , errors .New ("error" )),
2882+ ecsClient .EXPECT ().GetResourceTags (gomock . Any (), containerInstanceArn ).Return (ecsInstanceTags , nil ),
2883+ ecsClient .EXPECT ().GetResourceTags (gomock . Any (), taskARN ).Return (nil , errors .New ("error" )),
28792884 )
28802885 },
28812886 expectedStatusCode : http .StatusOK ,
@@ -2891,8 +2896,8 @@ func TestV4TaskMetadataWithTags(t *testing.T) {
28912896 setStateExpectations : happyStateExpectations ,
28922897 setECSClientExpectations : func (ecsClient * mock_ecs.MockECSClient ) {
28932898 gomock .InOrder (
2894- ecsClient .EXPECT ().GetResourceTags (containerInstanceArn ).Return (nil , errors .New ("error" )),
2895- ecsClient .EXPECT ().GetResourceTags (taskARN ).Return (nil , errors .New ("error" )),
2899+ ecsClient .EXPECT ().GetResourceTags (gomock . Any (), containerInstanceArn ).Return (nil , errors .New ("error" )),
2900+ ecsClient .EXPECT ().GetResourceTags (gomock . Any (), taskARN ).Return (nil , errors .New ("error" )),
28962901 )
28972902 },
28982903 expectedStatusCode : http .StatusOK ,
@@ -2963,6 +2968,7 @@ func TestV4TaskMetadataWithTags(t *testing.T) {
29632968 state .EXPECT ().TaskARNByV3EndpointID (v3EndpointID ).Return (taskARN , true ),
29642969 state .EXPECT ().TaskByArn (taskARN ).Return (task , true ).Times (2 ),
29652970 state .EXPECT ().ContainerMapByArn (taskARN ).Return (containerNameToDockerContainer , true ),
2971+ state .EXPECT ().ContainerNameByV3EndpointID (v3EndpointID ).Return (containerName , true ),
29662972 state .EXPECT ().TaskByArn (taskARN ).Return (nil , false ),
29672973 )
29682974 },
@@ -2983,6 +2989,7 @@ func TestV4TaskMetadataWithTags(t *testing.T) {
29832989 state .EXPECT ().TaskARNByV3EndpointID (v3EndpointID ).Return (taskARN , true ),
29842990 state .EXPECT ().TaskByArn (taskARN ).Return (bridgeTask , true ).Times (2 ),
29852991 state .EXPECT ().ContainerMapByArn (taskARN ).Return (containerNameToBridgeContainer , true ),
2992+ state .EXPECT ().ContainerNameByV3EndpointID (v3EndpointID ).Return (containerName , true ),
29862993 state .EXPECT ().ContainerByID (containerID ).Return (nil , false ).AnyTimes (),
29872994 state .EXPECT ().PulledContainerMapByArn (taskARN ).Return (nil , true ),
29882995 state .EXPECT ().ContainerByID (containerID ).Return (nil , false ).AnyTimes (),
@@ -3004,6 +3011,7 @@ func TestV4TaskMetadataWithTags(t *testing.T) {
30043011 state .EXPECT ().TaskARNByV3EndpointID (v3EndpointID ).Return (taskARN , true ),
30053012 state .EXPECT ().TaskByArn (taskARN ).Return (bridgeTask , true ).Times (2 ),
30063013 state .EXPECT ().ContainerMapByArn (taskARN ).Return (containerNameToBridgeContainer , true ),
3014+ state .EXPECT ().ContainerNameByV3EndpointID (v3EndpointID ).Return (containerName , true ),
30073015 state .EXPECT ().ContainerByID (containerID ).Return (bridgeContainerNoNetwork , true ).AnyTimes (),
30083016 state .EXPECT ().PulledContainerMapByArn (taskARN ).Return (nil , true ),
30093017 state .EXPECT ().ContainerByID (containerID ).Return (bridgeContainerNoNetwork , true ).AnyTimes (),
0 commit comments