Skip to content

Commit 02df935

Browse files
author
Moritz Clasmeier
committed
tests
1 parent d16be7d commit 02df935

File tree

1 file changed

+18
-42
lines changed

1 file changed

+18
-42
lines changed

pkg/reconciler/internal/updater/updater_test.go

Lines changed: 18 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ var _ = Describe("tryMergeUpdatedObjectStatus", func() {
337337
externalCondition map[string]interface{}
338338
externalConditionTypes map[string]struct{}
339339
nonExternalCondition map[string]interface{}
340-
nonExternalConditionB map[string]interface{}
340+
// nonExternalConditionB map[string]interface{}
341341
)
342342

343343
BeforeEach(func() {
@@ -354,11 +354,11 @@ var _ = Describe("tryMergeUpdatedObjectStatus", func() {
354354
"status": string(corev1.ConditionTrue),
355355
"reason": "InitialDeployment",
356356
}
357-
nonExternalConditionB = map[string]interface{}{
358-
"type": "Foo",
359-
"status": string(corev1.ConditionTrue),
360-
"reason": "Success",
361-
}
357+
// nonExternalConditionB = map[string]interface{}{
358+
// "type": "Foo",
359+
// "status": string(corev1.ConditionTrue),
360+
// "reason": "Success",
361+
// }
362362

363363
// Setup obj with initial state (version 100).
364364
obj = &unstructured.Unstructured{
@@ -424,42 +424,18 @@ var _ = Describe("tryMergeUpdatedObjectStatus", func() {
424424
})
425425
})
426426

427-
When("non-external condition differs", func() {
428-
BeforeEach(func() {
429-
obj.Object["status"] = map[string]interface{}{
430-
"conditions": []interface{}{nonExternalCondition},
431-
}
432-
current.Object["status"] = map[string]interface{}{
433-
"conditions": []interface{}{nonExternalCondition, nonExternalConditionB},
434-
}
435-
436-
cl = fake.NewClientBuilder().WithObjects(current).Build()
437-
u = New(cl, logr.Discard())
438-
u.RegisterExternallyManagedStatusConditions(externalConditionTypes)
439-
})
440-
441-
It("should not resolve", func() {
442-
resolved, err := u.tryRefreshObject(context.Background(), obj)
443-
444-
Expect(err).ToNot(HaveOccurred())
445-
Expect(resolved).To(BeFalse())
446-
Expect(obj.GetResourceVersion()).To(Equal("100"), "resource version should not be updated")
447-
Expect(obj.Object["status"].(map[string]interface{})["conditions"]).To(HaveLen(1))
448-
})
449-
})
450-
451-
When("no external conditions are configured", func() {
452-
BeforeEach(func() {
453-
cl = fake.NewClientBuilder().Build()
454-
u = New(cl, logr.Discard())
455-
})
456-
457-
It("should return early without calling Get", func() {
458-
resolved, err := u.tryRefreshObject(context.Background(), obj)
459-
Expect(err).ToNot(HaveOccurred())
460-
Expect(resolved).To(BeFalse())
461-
})
462-
})
427+
// When("no external conditions are configured", func() {
428+
// BeforeEach(func() {
429+
// cl = fake.NewClientBuilder().Build()
430+
// u = New(cl, logr.Discard())
431+
// })
432+
433+
// It("should return early without calling Get", func() {
434+
// resolved, err := u.tryRefreshObject(context.Background(), obj)
435+
// Expect(err).ToNot(HaveOccurred())
436+
// Expect(resolved).To(BeFalse())
437+
// })
438+
// })
463439

464440
When("Get returns an error", func() {
465441
BeforeEach(func() {

0 commit comments

Comments
 (0)