mirror of
https://github.com/YuzuZensai/netbird-kubernetes-operator.git
synced 2026-09-13 10:49:15 +00:00
Add ready conditon and cleanup finalizer and status patching (#186)
This change adds a ready condition. It also sets a standard for status fields and documentation. It makes use of helper functions from FluxCD to better manage patching of finalizers and status. Signed-off-by: Philip Laine <philip.laine@gmail.com>
This commit is contained in:
@@ -60,18 +60,18 @@ var _ = Describe("Group Controller", func() {
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
err = k8sClient.Get(ctx, nn, group)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(*group.Status.GroupID).NotTo(BeEmpty())
|
||||
Expect(group.Status.ObservedGeneration).To(Equal(group.Generation))
|
||||
Expect(group.Status.GroupID).NotTo(BeEmpty())
|
||||
|
||||
By("crerating a new group when deleted from API")
|
||||
err = controllerReconciler.Netbird.Groups.Delete(ctx, *group.Status.GroupID)
|
||||
err = controllerReconciler.Netbird.Groups.Delete(ctx, group.Status.GroupID)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
_, err = controllerReconciler.Reconcile(ctx, reconcile.Request{NamespacedName: nn})
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
newGroup := &nbv1alpha1.Group{}
|
||||
err = k8sClient.Get(ctx, nn, newGroup)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(*newGroup.Status.GroupID).NotTo(BeEmpty())
|
||||
Expect(*newGroup.Status.GroupID).NotTo(Equal(*group.Status.GroupID))
|
||||
Expect(newGroup.Status.GroupID).NotTo(Equal(group.Status.GroupID))
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user