Skip to content

Commit

Permalink
fix: FakeClient expects finalizers to be set when DeletionTimestamp i…
Browse files Browse the repository at this point in the history
…s set
  • Loading branch information
yiannistri committed Nov 6, 2023
1 parent 8effc0f commit af57bbb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/query/collector/reconciler/reconciler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,17 @@ func TestReconciler_Reconcile(t *testing.T) {
deletedHelmRelease := testutils.NewHelmRelease("deletedHelmRelease", clusterName, func(hr *v2beta1.HelmRelease) {
now := metav1.Now()
hr.DeletionTimestamp = &now
hr.Finalizers = append(hr.Finalizers, "finalizers.fluxcd.io")
})
deletedClusterRoleWithRules := testutils.NewClusterRole("deletedClusterRoleWithRules", true, func(cr *rbacv1.ClusterRole) {
now := metav1.Now()
cr.DeletionTimestamp = &now
cr.Finalizers = append(cr.Finalizers, "kubernetes")
})
deletedClusterRoleWithoutRules := testutils.NewClusterRole("deletedClusterRoleWithoutRules", false, func(cr *rbacv1.ClusterRole) {
now := metav1.Now()
cr.DeletionTimestamp = &now
cr.Finalizers = append(cr.Finalizers, "kubernetes")
})
deletedClusterRoleManuallyConstructed := testutils.NewClusterRole("deletedClusterRoleManuallyConstructed", false)
objects := []runtime.Object{createdOrUpdatedHelmRelease, deletedHelmRelease, deletedClusterRoleWithRules, deletedClusterRoleWithoutRules}
Expand Down

0 comments on commit af57bbb

Please sign in to comment.