Skip to content

Commit

Permalink
Lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nolancon committed Nov 11, 2024
1 parent a755fe7 commit 8aa1d0a
Show file tree
Hide file tree
Showing 23 changed files with 1 addition and 49 deletions.
1 change: 0 additions & 1 deletion internal/controller/bucket/acl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ func TestACLObserveBackend(t *testing.T) {
},
}
for name, tc := range cases {
tc := tc
t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down
1 change: 0 additions & 1 deletion internal/controller/bucket/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ func (c *external) Create(ctx context.Context, mg resource.Managed) (managed.Ext

c.log.Info("Creating bucket on backend", consts.KeyBucketName, originalBucket.Name, consts.KeyBackendName, beName)
// Launch a go routine for each backend, creating buckets concurrently.
beName := beName
go func() {
_, err := rgw.CreateBucket(ctx, cl, rgw.BucketToCreateBucketInput(originalBucket))
if err != nil {
Expand Down
4 changes: 0 additions & 4 deletions internal/controller/bucket/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ func TestCreateBasicErrors(t *testing.T) {
},
}
for name, tc := range cases {
tc := tc

t.Run(name, func(t *testing.T) {
t.Parallel()
s := runtime.NewScheme()
Expand Down Expand Up @@ -364,8 +362,6 @@ func TestCreate(t *testing.T) {
}

for name, tc := range cases {
tc := tc

t.Run(name, func(t *testing.T) {
s := runtime.NewScheme()
s.AddKnownTypes(v1alpha1.SchemeGroupVersion, &v1alpha1.Bucket{}, &v1alpha1.BucketList{})
Expand Down
2 changes: 0 additions & 2 deletions internal/controller/bucket/delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ func TestDeleteBasicErrors(t *testing.T) {
}

for name, tc := range cases {
tc := tc
t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -744,7 +743,6 @@ func TestDelete(t *testing.T) {
s.AddKnownTypes(apisv1alpha1.SchemeGroupVersion, bk)

for name, tc := range cases {
tc := tc
t.Run(name, func(t *testing.T) {
kubeClient := fake.NewClientBuilder().
WithScheme(s).
Expand Down
1 change: 0 additions & 1 deletion internal/controller/bucket/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1543,7 +1543,6 @@ func TestIsPauseRequired(t *testing.T) {
},
}
for name, tc := range cases {
tc := tc
t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down
2 changes: 0 additions & 2 deletions internal/controller/bucket/lifecycleconfiguration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,6 @@ func TestObserveBackend(t *testing.T) {
},
}
for name, tc := range cases {
tc := tc
t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -777,7 +776,6 @@ func TestHandle(t *testing.T) {
},
}
for name, tc := range cases {
tc := tc
t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down
2 changes: 0 additions & 2 deletions internal/controller/bucket/objectlockconfiguration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ func TestObjectLockConfigObserveBackend(t *testing.T) {
},
}
for name, tc := range cases {
tc := tc
t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -488,7 +487,6 @@ func TestObjectLockConfigurationHandle(t *testing.T) {
},
}
for name, tc := range cases {
tc := tc
t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down
2 changes: 0 additions & 2 deletions internal/controller/bucket/observe.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,6 @@ func (c *external) Observe(ctx context.Context, mg resource.Managed) (managed.Ex

// Check for the bucket on each backend in a separate go routine
for beName, backendClient := range backendClients {
beName := beName
backendClient := backendClient
g.Go(func() error {
bucketExists, err := rgw.BucketExists(ctxC, backendClient, bucket.Name)
if err != nil {
Expand Down
2 changes: 0 additions & 2 deletions internal/controller/bucket/observe_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ func TestObserveBasicErrors(t *testing.T) {
},
}
for name, tc := range cases {
tc := tc
t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -461,7 +460,6 @@ func TestObserve(t *testing.T) {
},
}
for name, tc := range cases {
tc := tc
t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down
1 change: 0 additions & 1 deletion internal/controller/bucket/policy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@ func TestPolicyObserveBackend(t *testing.T) {
}

for name, tc := range cases {
tc := tc
t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down
10 changes: 0 additions & 10 deletions internal/controller/bucket/update_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ func TestUpdateBasicErrors(t *testing.T) {
},
}
for name, tc := range cases {
tc := tc

t.Run(name, func(t *testing.T) {
t.Parallel()
e := external{
Expand Down Expand Up @@ -461,8 +459,6 @@ func TestUpdate(t *testing.T) {
s.AddKnownTypes(apisv1alpha1.SchemeGroupVersion, bk)

for name, tc := range cases {
tc := tc

t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -776,8 +772,6 @@ func TestUpdateLifecycleConfigSubResource(t *testing.T) {
s.AddKnownTypes(apisv1alpha1.SchemeGroupVersion, bk)

for name, tc := range cases {
tc := tc

t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -1076,8 +1070,6 @@ func TestUpdateVersioningConfigSubResource(t *testing.T) {
s.AddKnownTypes(apisv1alpha1.SchemeGroupVersion, bk)

for name, tc := range cases {
tc := tc

t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -1381,8 +1373,6 @@ func TestUpdateObjectLockConfigSubResource(t *testing.T) {
s.AddKnownTypes(apisv1alpha1.SchemeGroupVersion, bk)

for name, tc := range cases {
tc := tc

t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down
2 changes: 0 additions & 2 deletions internal/controller/bucket/versioningconfiguration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,6 @@ func TestVersioningConfigObserveBackend(t *testing.T) {
},
}
for name, tc := range cases {
tc := tc
t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -631,7 +630,6 @@ func TestVersioningConfigurationHandle(t *testing.T) {
},
}
for name, tc := range cases {
tc := tc
t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,6 @@ func (c *Controller) unpauseBuckets(ctx context.Context, s3BackendName string) {
}

for i := range buckets.Items {
i := i
c.log.Debug("Attempting to unpause bucket", consts.KeyBucketName, buckets.Items[i].Name)
err := retry.OnError(wait.Backoff{
Steps: steps,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,6 @@ func TestReconcile(t *testing.T) {
}

for name, tc := range cases {
tc := tc
t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ func TestErrNoRequestID(t *testing.T) {
},
}
for name, tc := range cases {
tc := tc

t.Run(name, func(t *testing.T) {
t.Parallel()
assert.Equal(t, tc.want.result, errNoRequestID(tc.args.err), "unexpected string")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ func TestRoleSessionNameGenerator_Generate(t *testing.T) {
}

for name, tt := range tests {
tt := tt
t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,6 @@ func TestCreateAssumeRoleS3Client(t *testing.T) {
s.AddKnownTypes(apisv1alpha1.SchemeGroupVersion, pc)

for name, tt := range tests {
tt := tt
t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down
2 changes: 0 additions & 2 deletions internal/rgw/acl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ func TestGenerateGrants(t *testing.T) {
},
}
for name, tc := range cases {
tc := tc
t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -183,7 +182,6 @@ func TestGenerateOwner(t *testing.T) {
},
}
for name, tc := range cases {
tc := tc
t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down
2 changes: 0 additions & 2 deletions internal/rgw/bucket_helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ func TestIsNotEmpty(t *testing.T) {
}

for name, tt := range testCases {
tt := tt

t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down
2 changes: 0 additions & 2 deletions internal/rgw/bucket_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,6 @@ func TestDeleteBucket(t *testing.T) {
bucketName := "test-bucket"

for name, tt := range testCases {
tt := tt

t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down
1 change: 0 additions & 1 deletion internal/rgw/lifecycleconfig_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ func TestGenerateLifecycleConfigurationInput(t *testing.T) {
},
}
for name, tc := range cases {
tc := tc
t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down
1 change: 0 additions & 1 deletion internal/utils/randomstring/randomstring_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ func TestStandardGenerator_Generate(t *testing.T) {
}

for name, tt := range tests {
tt := tt
t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down
6 changes: 1 addition & 5 deletions internal/utils/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,11 @@ func TestMissingStrings(t *testing.T) {
},
}
for name, tc := range cases {
tc := tc
n := name
t.Run(name, func(t *testing.T) {
t.Parallel()
missing := MissingStrings(tc.sliceA, tc.sliceB)
if diff := cmp.Diff(tc.missing, missing); diff != "" {
t.Errorf("\n%s\nMissingStrings(...): -want, +got:\n%s\n", n, diff)
t.Errorf("\n%s\nMissingStrings(...): -want, +got:\n%s\n", name, diff)
}
})
}
Expand Down Expand Up @@ -112,7 +110,6 @@ func TestMapConditionToHealthStatus(t *testing.T) {
},
}
for name, tc := range cases {
tc := tc
t.Run(name, func(t *testing.T) {
t.Parallel()
s := MapConditionToHealthStatus(tc.c)
Expand Down Expand Up @@ -163,7 +160,6 @@ func TestResolveHostBase(t *testing.T) {
},
}
for name, tc := range cases {
tc := tc
t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down

0 comments on commit 8aa1d0a

Please sign in to comment.