Skip to content

Commit

Permalink
lambda-promtail: remove s3 bucket_owner label from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
milenpankov-bosch committed Dec 13, 2024
1 parent b71d832 commit ad0ec5c
Showing 1 changed file with 0 additions and 53 deletions.
53 changes: 0 additions & 53 deletions tools/lambda-promtail/lambda-promtail/s3_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ func Test_getLabels(t *testing.T) {
S3: events.S3Entity{
Bucket: events.S3Bucket{
Name: "elb_logs_test",
OwnerIdentity: events.S3UserIdentity{
PrincipalID: "test",
},
},
Object: events.S3Object{
Key: "my-bucket/AWSLogs/123456789012/elasticloadbalancing/us-east-1/2022/01/24/123456789012_elasticloadbalancing_us-east-1_app.my-loadbalancer.b13ea9d19f16d015_20220124T0000Z_0.0.0.0_2et2e1mx.log.gz",
Expand All @@ -46,7 +43,6 @@ func Test_getLabels(t *testing.T) {
want: map[string]string{
"account_id": "123456789012",
"bucket": "elb_logs_test",
"bucket_owner": "test",
"bucket_region": "us-east-1",
"day": "24",
"key": "my-bucket/AWSLogs/123456789012/elasticloadbalancing/us-east-1/2022/01/24/123456789012_elasticloadbalancing_us-east-1_app.my-loadbalancer.b13ea9d19f16d015_20220124T0000Z_0.0.0.0_2et2e1mx.log.gz",
Expand All @@ -67,9 +63,6 @@ func Test_getLabels(t *testing.T) {
S3: events.S3Entity{
Bucket: events.S3Bucket{
Name: "elb_logs_test",
OwnerIdentity: events.S3UserIdentity{
PrincipalID: "test",
},
},
Object: events.S3Object{
Key: "my-bucket/prefix/AWSLogs/123456789012/elasticloadbalancing/us-east-2/2016/05/01/123456789012_elasticloadbalancing_us-east-2_net.my-loadbalancer.1234567890abcdef_201605010000Z_2soosksi.log.gz",
Expand All @@ -80,7 +73,6 @@ func Test_getLabels(t *testing.T) {
want: map[string]string{
"account_id": "123456789012",
"bucket": "elb_logs_test",
"bucket_owner": "test",
"bucket_region": "us-east-2",
"day": "01",
"key": "my-bucket/prefix/AWSLogs/123456789012/elasticloadbalancing/us-east-2/2016/05/01/123456789012_elasticloadbalancing_us-east-2_net.my-loadbalancer.1234567890abcdef_201605010000Z_2soosksi.log.gz",
Expand All @@ -101,9 +93,6 @@ func Test_getLabels(t *testing.T) {
S3: events.S3Entity{
Bucket: events.S3Bucket{
Name: "s3_guardduty_test",
OwnerIdentity: events.S3UserIdentity{
PrincipalID: "test",
},
},
Object: events.S3Object{
Key: "AWSLogs/123456789012/GuardDuty/us-east-1/2024/05/30/07a3f2ce-1485-3031-b842-e1f324c4a48d.jsonl.gz",
Expand All @@ -114,7 +103,6 @@ func Test_getLabels(t *testing.T) {
want: map[string]string{
"account_id": "123456789012",
"bucket": "s3_guardduty_test",
"bucket_owner": "test",
"bucket_region": "us-east-1",
"day": "30",
"key": "AWSLogs/123456789012/GuardDuty/us-east-1/2024/05/30/07a3f2ce-1485-3031-b842-e1f324c4a48d.jsonl.gz",
Expand All @@ -133,9 +121,6 @@ func Test_getLabels(t *testing.T) {
S3: events.S3Entity{
Bucket: events.S3Bucket{
Name: "vpc_logs_test",
OwnerIdentity: events.S3UserIdentity{
PrincipalID: "test",
},
},
Object: events.S3Object{
Key: "my-bucket/AWSLogs/123456789012/vpcflowlogs/us-east-1/2022/01/24/123456789012_vpcflowlogs_us-east-1_fl-1234abcd_20180620T1620Z_fe123456.log.gz",
Expand All @@ -146,7 +131,6 @@ func Test_getLabels(t *testing.T) {
want: map[string]string{
"account_id": "123456789012",
"bucket": "vpc_logs_test",
"bucket_owner": "test",
"bucket_region": "us-east-1",
"day": "24",
"key": "my-bucket/AWSLogs/123456789012/vpcflowlogs/us-east-1/2022/01/24/123456789012_vpcflowlogs_us-east-1_fl-1234abcd_20180620T1620Z_fe123456.log.gz",
Expand All @@ -166,9 +150,6 @@ func Test_getLabels(t *testing.T) {
S3: events.S3Entity{
Bucket: events.S3Bucket{
Name: "vpc_logs_test",
OwnerIdentity: events.S3UserIdentity{
PrincipalID: "test",
},
},
Object: events.S3Object{
Key: "my-bucket/AWSLogs/123456789012/vpcflowlogs/us-gov-east-1/2022/01/24/123456789012_vpcflowlogs_us-gov-east-1_fl-1234abcd_20180620T1620Z_fe123456.log.gz",
Expand All @@ -179,7 +160,6 @@ func Test_getLabels(t *testing.T) {
want: map[string]string{
"account_id": "123456789012",
"bucket": "vpc_logs_test",
"bucket_owner": "test",
"bucket_region": "us-gov-east-1",
"day": "24",
"key": "my-bucket/AWSLogs/123456789012/vpcflowlogs/us-gov-east-1/2022/01/24/123456789012_vpcflowlogs_us-gov-east-1_fl-1234abcd_20180620T1620Z_fe123456.log.gz",
Expand All @@ -199,9 +179,6 @@ func Test_getLabels(t *testing.T) {
S3: events.S3Entity{
Bucket: events.S3Bucket{
Name: "cloudtrail_digest_logs_test",
OwnerIdentity: events.S3UserIdentity{
PrincipalID: "test",
},
},
Object: events.S3Object{
Key: "my-bucket/AWSLogs/123456789012/CloudTrail-Digest/us-east-1/2022/01/24/123456789012_CloudTrail-Digest_us-east-1_20220124T0000Z_4jhzXFO2Jlvu2b3y.json.gz",
Expand All @@ -212,7 +189,6 @@ func Test_getLabels(t *testing.T) {
want: map[string]string{
"account_id": "123456789012",
"bucket": "cloudtrail_digest_logs_test",
"bucket_owner": "test",
"bucket_region": "us-east-1",
"day": "24",
"key": "my-bucket/AWSLogs/123456789012/CloudTrail-Digest/us-east-1/2022/01/24/123456789012_CloudTrail-Digest_us-east-1_20220124T0000Z_4jhzXFO2Jlvu2b3y.json.gz",
Expand All @@ -232,9 +208,6 @@ func Test_getLabels(t *testing.T) {
S3: events.S3Entity{
Bucket: events.S3Bucket{
Name: "cloudtrail_logs_test",
OwnerIdentity: events.S3UserIdentity{
PrincipalID: "test",
},
},
Object: events.S3Object{
Key: "my-bucket/AWSLogs/123456789012/CloudTrail/us-east-1/2022/01/24/123456789012_CloudTrail_us-east-1_20220124T0000Z_4jhzXFO2Jlvu2b3y.json.gz",
Expand All @@ -245,7 +218,6 @@ func Test_getLabels(t *testing.T) {
want: map[string]string{
"account_id": "123456789012",
"bucket": "cloudtrail_logs_test",
"bucket_owner": "test",
"bucket_region": "us-east-1",
"day": "24",
"key": "my-bucket/AWSLogs/123456789012/CloudTrail/us-east-1/2022/01/24/123456789012_CloudTrail_us-east-1_20220124T0000Z_4jhzXFO2Jlvu2b3y.json.gz",
Expand All @@ -265,9 +237,6 @@ func Test_getLabels(t *testing.T) {
S3: events.S3Entity{
Bucket: events.S3Bucket{
Name: "cloudtrail_logs_test",
OwnerIdentity: events.S3UserIdentity{
PrincipalID: "test",
},
},
Object: events.S3Object{
Key: "my-bucket/AWSLogs/123456789012/CloudTrail/us-gov-east-1/2022/01/24/123456789012_CloudTrail_us-gov-east-1_20220124T0000Z_4jhzXFO2Jlvu2b3y.json.gz",
Expand All @@ -278,7 +247,6 @@ func Test_getLabels(t *testing.T) {
want: map[string]string{
"account_id": "123456789012",
"bucket": "cloudtrail_logs_test",
"bucket_owner": "test",
"bucket_region": "us-gov-east-1",
"day": "24",
"key": "my-bucket/AWSLogs/123456789012/CloudTrail/us-gov-east-1/2022/01/24/123456789012_CloudTrail_us-gov-east-1_20220124T0000Z_4jhzXFO2Jlvu2b3y.json.gz",
Expand All @@ -298,9 +266,6 @@ func Test_getLabels(t *testing.T) {
S3: events.S3Entity{
Bucket: events.S3Bucket{
Name: "cloudtrail_logs_test",
OwnerIdentity: events.S3UserIdentity{
PrincipalID: "test",
},
},
Object: events.S3Object{
Key: "my-bucket/AWSLogs/o-test123456/123456789012/CloudTrail/us-east-1/2022/01/24/123456789012_CloudTrail_us-east-1_20220124T0000Z_4jhzXFO2Jlvu2b3y.json.gz",
Expand All @@ -311,7 +276,6 @@ func Test_getLabels(t *testing.T) {
want: map[string]string{
"account_id": "123456789012",
"bucket": "cloudtrail_logs_test",
"bucket_owner": "test",
"bucket_region": "us-east-1",
"day": "24",
"key": "my-bucket/AWSLogs/o-test123456/123456789012/CloudTrail/us-east-1/2022/01/24/123456789012_CloudTrail_us-east-1_20220124T0000Z_4jhzXFO2Jlvu2b3y.json.gz",
Expand All @@ -332,9 +296,6 @@ func Test_getLabels(t *testing.T) {
S3: events.S3Entity{
Bucket: events.S3Bucket{
Name: "cloudfront_logs_test",
OwnerIdentity: events.S3UserIdentity{
PrincipalID: "test",
},
},
Object: events.S3Object{
Key: "my/bucket/prefix/E2K2LNL5N3WR51.2022-07-18-12.a10a8496.gz",
Expand All @@ -344,7 +305,6 @@ func Test_getLabels(t *testing.T) {
},
want: map[string]string{
"bucket": "cloudfront_logs_test",
"bucket_owner": "test",
"bucket_region": "us-east-1",
"day": "18",
"key": "my/bucket/prefix/E2K2LNL5N3WR51.2022-07-18-12.a10a8496.gz",
Expand All @@ -364,9 +324,6 @@ func Test_getLabels(t *testing.T) {
S3: events.S3Entity{
Bucket: events.S3Bucket{
Name: "waf_logs_test",
OwnerIdentity: events.S3UserIdentity{
PrincipalID: "test",
},
},
Object: events.S3Object{
Key: "prefix/AWSLogs/11111111111/WAFLogs/us-east-1/TEST-WEBACL/2021/10/28/19/50/11111111111_waflogs_us-east-1_TEST-WEBACL_20211028T1950Z_e0ca43b5.log.gz",
Expand All @@ -376,7 +333,6 @@ func Test_getLabels(t *testing.T) {
},
want: map[string]string{
"account_id": "11111111111",
"bucket_owner": "test",
"bucket_region": "us-east-1",
"bucket": "waf_logs_test",
"day": "28",
Expand All @@ -399,9 +355,6 @@ func Test_getLabels(t *testing.T) {
S3: events.S3Entity{
Bucket: events.S3Bucket{
Name: "waf_logs_test",
OwnerIdentity: events.S3UserIdentity{
PrincipalID: "test",
},
},
Object: events.S3Object{
Key: "prefix/AWSLogs/11111111111/WAFLogs/us-gov-east-1/TEST-WEBACL/2021/10/28/19/50/11111111111_waflogs_us-gov-east-1_TEST-WEBACL_20211028T1950Z_e0ca43b5.log.gz",
Expand All @@ -411,7 +364,6 @@ func Test_getLabels(t *testing.T) {
},
want: map[string]string{
"account_id": "11111111111",
"bucket_owner": "test",
"bucket_region": "us-gov-east-1",
"bucket": "waf_logs_test",
"day": "28",
Expand All @@ -434,9 +386,6 @@ func Test_getLabels(t *testing.T) {
S3: events.S3Entity{
Bucket: events.S3Bucket{
Name: "missing_type",
OwnerIdentity: events.S3UserIdentity{
PrincipalID: "test",
},
},
Object: events.S3Object{
Key: "some-object.json",
Expand All @@ -446,7 +395,6 @@ func Test_getLabels(t *testing.T) {
},
want: map[string]string{
"bucket": "missing_type",
"bucket_owner": "test",
"bucket_region": "us-east-1",
"key": "some-object.json",
},
Expand Down Expand Up @@ -644,7 +592,6 @@ func Test_parseS3Log(t *testing.T) {
},
labels: map[string]string{
"bucket": "missing_parser",
"bucket_owner": "test",
"bucket_region": "us-east-1",
"key": "some-object.json",
"type": "",
Expand Down

0 comments on commit ad0ec5c

Please sign in to comment.