Skip to content

Commit 35cd022

Browse files
authored
fix(cloudwatchlogs-log-group): list function continue even with error with tags (#843)
1 parent 3c955d2 commit 35cd022

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

resources/cloudwatchlogs-loggroup.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"time"
77

88
"github.com/gotidy/ptr"
9+
"github.com/sirupsen/logrus"
910
"go.uber.org/ratelimit"
1011

1112
"github.com/aws/aws-sdk-go-v2/aws"
@@ -79,7 +80,10 @@ func (l *CloudWatchLogsLogGroupLister) List(ctx context.Context, o interface{})
7980
ResourceArn: &arn,
8081
})
8182
if err != nil {
82-
return nil, err
83+
logrus.WithError(err).
84+
WithField("arn", arn).
85+
Warn("unable to list tags for log group, skipping to avoid incorrect filtering")
86+
continue
8387
}
8488

8589
streamRl.Take() // Wait for DescribeLogStreams rate limiter
@@ -92,7 +96,10 @@ func (l *CloudWatchLogsLogGroupLister) List(ctx context.Context, o interface{})
9296
Descending: aws.Bool(true),
9397
})
9498
if err != nil {
95-
return nil, err
99+
logrus.WithError(err).
100+
WithField("arn", arn).
101+
Warn("unable to describe log streams for log group, skipping to avoid incorrect filtering")
102+
continue
96103
}
97104

98105
var lastEvent time.Time

0 commit comments

Comments
 (0)