CloudWatch: Use context in aws ListSinks and ListAttachedLinks (#77083)

* Use context in aws ListSinks and ListAttachedLinks

In the current way, ListSinks and ListAttachedLinks is used which doesn't
allow cancelling the request if the context changes.
Using ListSinksWithContext and ListAttachedLinksWithContext is the
preferred way. Adding context for GetAccountsForCurrentUserOrRole
is required to pass it to ListSinks method.
This commit is contained in:
Shabeeb Khalid
2023-10-27 11:49:37 +03:00
committed by GitHub
parent edd0e80ba0
commit df41378472
6 changed files with 43 additions and 36 deletions
+3 -3
View File
@@ -42,7 +42,7 @@ type LogGroupsProvider interface {
}
type AccountsProvider interface {
GetAccountsForCurrentUserOrRole() ([]resources.ResourceResponse[resources.Account], error)
GetAccountsForCurrentUserOrRole(ctx context.Context) ([]resources.ResourceResponse[resources.Account], error)
}
type RegionsAPIProvider interface {
@@ -65,8 +65,8 @@ type CloudWatchLogsAPIProvider interface {
}
type OAMAPIProvider interface {
ListSinks(*oam.ListSinksInput) (*oam.ListSinksOutput, error)
ListAttachedLinks(*oam.ListAttachedLinksInput) (*oam.ListAttachedLinksOutput, error)
ListSinksWithContext(ctx context.Context, in *oam.ListSinksInput, opts ...request.Option) (*oam.ListSinksOutput, error)
ListAttachedLinksWithContext(ctx context.Context, in *oam.ListAttachedLinksInput, opts ...request.Option) (*oam.ListAttachedLinksOutput, error)
}
type EC2APIProvider interface {