Skip to content

Commit dbbfdab

Browse files
kaovilaiclaude
andcommitted
Fix unparam linting issue in createTestCloudCredentialsSecret
Remove unused namespace parameter since it always receives the same value (test-namespace) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 1007c40 commit dbbfdab

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

internal/controller/cloudstorage_controller_test.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ func createTestCloudStorage(name string) *oadpv1alpha1.CloudStorage {
5353
}
5454

5555
// Helper function to create a test cloud credentials secret
56-
func createTestCloudCredentialsSecret(namespace string) *corev1.Secret {
56+
func createTestCloudCredentialsSecret() *corev1.Secret {
5757
return &corev1.Secret{
5858
ObjectMeta: metav1.ObjectMeta{
5959
Name: "cloud-credentials",
60-
Namespace: namespace,
60+
Namespace: "test-namespace",
6161
},
6262
Data: map[string][]byte{
6363
"credentials": []byte(mockAWSCredentials),
@@ -216,7 +216,7 @@ var _ = ginkgo.Describe("CloudStorage Controller", func() {
216216
gomega.Expect(fakeClient.Create(ctx, cloudStorage)).Should(gomega.Succeed())
217217

218218
// Create necessary secret for bucket client
219-
secret := createTestCloudCredentialsSecret(testNamespace)
219+
secret := createTestCloudCredentialsSecret()
220220
gomega.Expect(fakeClient.Create(ctx, secret)).Should(gomega.Succeed())
221221

222222
// Create mock bucket client that simulates successful bucket creation
@@ -241,15 +241,15 @@ var _ = ginkgo.Describe("CloudStorage Controller", func() {
241241
// Verify status was updated
242242
updatedCS := &oadpv1alpha1.CloudStorage{}
243243
gomega.Expect(fakeClient.Get(ctx, req.NamespacedName, updatedCS)).Should(gomega.Succeed())
244-
244+
245245
// Verify bucket operations were called
246246
gomega.Expect(mockClient.ExistsCalled).To(gomega.Equal(1))
247247
gomega.Expect(mockClient.CreateCalled).To(gomega.Equal(1))
248-
248+
249249
// Verify status fields
250250
gomega.Expect(updatedCS.Status.Name).To(gomega.Equal(cloudStorage.Spec.Name))
251251
gomega.Expect(updatedCS.Status.LastSynced).ToNot(gomega.BeZero())
252-
252+
253253
// Verify BucketReady condition is set
254254
bucketReadyCondition := findCondition(updatedCS.Status.Conditions, oadpv1alpha1.ConditionBucketReady)
255255
gomega.Expect(bucketReadyCondition).ToNot(gomega.BeNil())
@@ -264,7 +264,7 @@ var _ = ginkgo.Describe("CloudStorage Controller", func() {
264264
gomega.Expect(fakeClient.Create(ctx, cs)).Should(gomega.Succeed())
265265

266266
// Create necessary secret
267-
secret := createTestCloudCredentialsSecret(testNamespace)
267+
secret := createTestCloudCredentialsSecret()
268268
gomega.Expect(fakeClient.Create(ctx, secret)).Should(gomega.Succeed())
269269

270270
// Create mock bucket client that simulates bucket creation failure
@@ -299,7 +299,7 @@ var _ = ginkgo.Describe("CloudStorage Controller", func() {
299299
gomega.Expect(retryingCondition).ToNot(gomega.BeNil())
300300
gomega.Expect(retryingCondition.Status).To(gomega.Equal(metav1.ConditionFalse))
301301
gomega.Expect(retryingCondition.Reason).To(gomega.Equal("BucketCreationRetrying"))
302-
302+
303303
// Verify bucket client was called
304304
gomega.Expect(mockClient.ExistsCalled).To(gomega.Equal(1))
305305
gomega.Expect(mockClient.CreateCalled).To(gomega.Equal(1))
@@ -312,7 +312,7 @@ var _ = ginkgo.Describe("CloudStorage Controller", func() {
312312
gomega.Expect(fakeClient.Create(ctx, cs)).Should(gomega.Succeed())
313313

314314
// Create necessary secret
315-
secret := createTestCloudCredentialsSecret(testNamespace)
315+
secret := createTestCloudCredentialsSecret()
316316
gomega.Expect(fakeClient.Create(ctx, secret)).Should(gomega.Succeed())
317317

318318
// Get the created resource to update its status
@@ -377,7 +377,7 @@ var _ = ginkgo.Describe("CloudStorage Controller", func() {
377377
gomega.Expect(fakeClient.Create(ctx, cs)).Should(gomega.Succeed())
378378

379379
// Create necessary secret
380-
secret := createTestCloudCredentialsSecret(testNamespace)
380+
secret := createTestCloudCredentialsSecret()
381381
gomega.Expect(fakeClient.Create(ctx, secret)).Should(gomega.Succeed())
382382

383383
// Get the created resource to update its status
@@ -435,7 +435,7 @@ var _ = ginkgo.Describe("CloudStorage Controller", func() {
435435
gomega.Expect(fakeClient.Create(ctx, cs)).Should(gomega.Succeed())
436436

437437
// Create necessary secret
438-
secret := createTestCloudCredentialsSecret(testNamespace)
438+
secret := createTestCloudCredentialsSecret()
439439
gomega.Expect(fakeClient.Create(ctx, secret)).Should(gomega.Succeed())
440440

441441
// Get the created resource to update its status with retry count

0 commit comments

Comments
 (0)