CloudWatch: Use context in aws DescribeRegionsWithContext (#76922)
* Use context in aws DescribeRegionsWithContext In the current way, DescribeRegions is used which doesn't allow cancelling the request if the context changes. Using DescribeRegionsWithContext is the preferred way. * Fix context variable * Revert GetRegionsWithContext to GetRegions GetRegions is not an AWS SDK method. Hence, GetRegions should be enough as the name change is not needed for context implementation.
This commit is contained in:
@@ -39,7 +39,7 @@ func Test_CloudWatch_CallResource_Integration_Test(t *testing.T) {
|
||||
return &logApi
|
||||
}
|
||||
ec2Mock := &mocks.EC2Mock{}
|
||||
ec2Mock.On("DescribeRegions", mock.Anything, mock.Anything).Return(&ec2.DescribeRegionsOutput{}, nil)
|
||||
ec2Mock.On("DescribeRegionsWithContext", mock.Anything, mock.Anything).Return(&ec2.DescribeRegionsOutput{}, nil)
|
||||
NewEC2Client = func(provider client.ConfigProvider) models.EC2APIProvider {
|
||||
return ec2Mock
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user