diff --git a/pkg/aws/aws_cloud_test.go b/pkg/aws/aws_cloud_test.go index 4ffac4eb..08da4834 100644 --- a/pkg/aws/aws_cloud_test.go +++ b/pkg/aws/aws_cloud_test.go @@ -40,6 +40,7 @@ func testOpenPorts() { JustBeforeEach(func() { t.expectDescribeVpcs(t.vpcID) + t.expectDescribeVpcsSigs(t.vpcID) t.expectDescribePublicSubnets(t.subnets...) retError = t.cloud.OpenPorts([]api.PortSpec{ @@ -116,6 +117,7 @@ func testClosePorts() { JustBeforeEach(func() { t.expectDescribeVpcs(t.vpcID) + t.expectDescribeVpcsSigs(t.vpcID) t.expectDescribePublicSubnets(t.subnets...) t.expectDescribePublicSubnetsSigs(t.subnets...) diff --git a/pkg/aws/aws_suite_test.go b/pkg/aws/aws_suite_test.go index 7d583ec6..79f62932 100644 --- a/pkg/aws/aws_suite_test.go +++ b/pkg/aws/aws_suite_test.go @@ -115,8 +115,24 @@ func (f *fakeAWSClientBase) expectDescribeVpcs(vpcID string) { }, types.Filter{ Name: awssdk.String(clusterFilterTagName), Values: []string{"owned"}, + })).Return(&ec2.DescribeVpcsOutput{Vpcs: vpcs}, nil).AnyTimes() +} + +func (f *fakeAWSClientBase) expectDescribeVpcsSigs(vpcID string) { + var vpcs []types.Vpc + if vpcID != "" { + vpcs = []types.Vpc{ + { + VpcId: ptr.To(vpcID), + }, + } + } + + f.awsClient.EXPECT().DescribeVpcs(gomock.Any(), eqFilters(types.Filter{ + Name: ptr.To("tag:Name"), + Values: []string{infraID + "-vpc"}, }, types.Filter{ - Name: ptr.To(providerAWSTagPrefix + infraID), + Name: ptr.To(clusterFilterTagNameSigs), Values: []string{"owned"}, })).Return(&ec2.DescribeVpcsOutput{Vpcs: vpcs}, nil).AnyTimes() } diff --git a/pkg/aws/ocpgwdeployer_test.go b/pkg/aws/ocpgwdeployer_test.go index ea43a598..edac284e 100644 --- a/pkg/aws/ocpgwdeployer_test.go +++ b/pkg/aws/ocpgwdeployer_test.go @@ -284,6 +284,7 @@ func newGatewayDeployerTestDriver() *gatewayDeployerTestDriver { t.expectDescribeInstances(instanceImageID) t.expectDescribeSecurityGroups(workerSGName, workerGroupID) t.expectDescribePublicSubnets(t.subnets...) + t.expectDescribeVpcsSigs(t.vpcID) t.expectDescribePublicSubnetsSigs(t.subnets...) var err error