@@ -53,11 +53,11 @@ func createTestCloudStorage(name string) *oadpv1alpha1.CloudStorage {
53
53
}
54
54
55
55
// Helper function to create a test cloud credentials secret
56
- func createTestCloudCredentialsSecret (namespace string ) * corev1.Secret {
56
+ func createTestCloudCredentialsSecret () * corev1.Secret {
57
57
return & corev1.Secret {
58
58
ObjectMeta : metav1.ObjectMeta {
59
59
Name : "cloud-credentials" ,
60
- Namespace : namespace ,
60
+ Namespace : "test- namespace" ,
61
61
},
62
62
Data : map [string ][]byte {
63
63
"credentials" : []byte (mockAWSCredentials ),
@@ -216,7 +216,7 @@ var _ = ginkgo.Describe("CloudStorage Controller", func() {
216
216
gomega .Expect (fakeClient .Create (ctx , cloudStorage )).Should (gomega .Succeed ())
217
217
218
218
// Create necessary secret for bucket client
219
- secret := createTestCloudCredentialsSecret (testNamespace )
219
+ secret := createTestCloudCredentialsSecret ()
220
220
gomega .Expect (fakeClient .Create (ctx , secret )).Should (gomega .Succeed ())
221
221
222
222
// Create mock bucket client that simulates successful bucket creation
@@ -241,15 +241,15 @@ var _ = ginkgo.Describe("CloudStorage Controller", func() {
241
241
// Verify status was updated
242
242
updatedCS := & oadpv1alpha1.CloudStorage {}
243
243
gomega .Expect (fakeClient .Get (ctx , req .NamespacedName , updatedCS )).Should (gomega .Succeed ())
244
-
244
+
245
245
// Verify bucket operations were called
246
246
gomega .Expect (mockClient .ExistsCalled ).To (gomega .Equal (1 ))
247
247
gomega .Expect (mockClient .CreateCalled ).To (gomega .Equal (1 ))
248
-
248
+
249
249
// Verify status fields
250
250
gomega .Expect (updatedCS .Status .Name ).To (gomega .Equal (cloudStorage .Spec .Name ))
251
251
gomega .Expect (updatedCS .Status .LastSynced ).ToNot (gomega .BeZero ())
252
-
252
+
253
253
// Verify BucketReady condition is set
254
254
bucketReadyCondition := findCondition (updatedCS .Status .Conditions , oadpv1alpha1 .ConditionBucketReady )
255
255
gomega .Expect (bucketReadyCondition ).ToNot (gomega .BeNil ())
@@ -264,7 +264,7 @@ var _ = ginkgo.Describe("CloudStorage Controller", func() {
264
264
gomega .Expect (fakeClient .Create (ctx , cs )).Should (gomega .Succeed ())
265
265
266
266
// Create necessary secret
267
- secret := createTestCloudCredentialsSecret (testNamespace )
267
+ secret := createTestCloudCredentialsSecret ()
268
268
gomega .Expect (fakeClient .Create (ctx , secret )).Should (gomega .Succeed ())
269
269
270
270
// Create mock bucket client that simulates bucket creation failure
@@ -299,7 +299,7 @@ var _ = ginkgo.Describe("CloudStorage Controller", func() {
299
299
gomega .Expect (retryingCondition ).ToNot (gomega .BeNil ())
300
300
gomega .Expect (retryingCondition .Status ).To (gomega .Equal (metav1 .ConditionFalse ))
301
301
gomega .Expect (retryingCondition .Reason ).To (gomega .Equal ("BucketCreationRetrying" ))
302
-
302
+
303
303
// Verify bucket client was called
304
304
gomega .Expect (mockClient .ExistsCalled ).To (gomega .Equal (1 ))
305
305
gomega .Expect (mockClient .CreateCalled ).To (gomega .Equal (1 ))
@@ -312,7 +312,7 @@ var _ = ginkgo.Describe("CloudStorage Controller", func() {
312
312
gomega .Expect (fakeClient .Create (ctx , cs )).Should (gomega .Succeed ())
313
313
314
314
// Create necessary secret
315
- secret := createTestCloudCredentialsSecret (testNamespace )
315
+ secret := createTestCloudCredentialsSecret ()
316
316
gomega .Expect (fakeClient .Create (ctx , secret )).Should (gomega .Succeed ())
317
317
318
318
// Get the created resource to update its status
@@ -377,7 +377,7 @@ var _ = ginkgo.Describe("CloudStorage Controller", func() {
377
377
gomega .Expect (fakeClient .Create (ctx , cs )).Should (gomega .Succeed ())
378
378
379
379
// Create necessary secret
380
- secret := createTestCloudCredentialsSecret (testNamespace )
380
+ secret := createTestCloudCredentialsSecret ()
381
381
gomega .Expect (fakeClient .Create (ctx , secret )).Should (gomega .Succeed ())
382
382
383
383
// Get the created resource to update its status
@@ -435,7 +435,7 @@ var _ = ginkgo.Describe("CloudStorage Controller", func() {
435
435
gomega .Expect (fakeClient .Create (ctx , cs )).Should (gomega .Succeed ())
436
436
437
437
// Create necessary secret
438
- secret := createTestCloudCredentialsSecret (testNamespace )
438
+ secret := createTestCloudCredentialsSecret ()
439
439
gomega .Expect (fakeClient .Create (ctx , secret )).Should (gomega .Succeed ())
440
440
441
441
// Get the created resource to update its status with retry count
0 commit comments