Skip to content

Reconcile on update of Annotations#77

Merged
bigkevmcd merged 2 commits intomainfrom
add-annotation-predicate
May 17, 2023
Merged

Reconcile on update of Annotations#77
bigkevmcd merged 2 commits intomainfrom
add-annotation-predicate

Conversation

@bigkevmcd
Copy link
Copy Markdown
Collaborator

This updates the predicates for updates to reconcile when the Reconciliation annotation is added.

@bigkevmcd bigkevmcd requested a review from foot May 17, 2023 10:31
}

if err := k8sClient.Delete(ctx, u); err != nil {
if err := client.IgnoreNotFound(k8sClient.Delete(ctx, u)); err != nil {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat, haven't seen this helper before.

Is this change related to this PR? (Its still nice to have! It will help with hanging finalizers + missing resources?)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added it because the tests were failing trying to remove the GitOpsSet because of the missing ConfigMap.

This updates the predicates for updates to reconcile when the
Reconciliation annotation is added.
@bigkevmcd bigkevmcd force-pushed the add-annotation-predicate branch from 361d7d0 to f42282c Compare May 17, 2023 10:36
g.Eventually(func() bool {
log.Println("checking for the recreated object")
return testEnv.Get(ctx, client.ObjectKey{Name: "engineering-prod-cm", Namespace: "default"}, &cm) == nil
}, timeout).Should(gomega.BeTrue())
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧠 , smart.

We could also check that gitOpsSet.Status.LastHandledReconcileAt has been set?

Copy link
Copy Markdown
Collaborator

@foot foot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

Amazing, sync button working the EE UI too 🚀

@bigkevmcd bigkevmcd merged commit bff911b into main May 17, 2023
@bigkevmcd bigkevmcd deleted the add-annotation-predicate branch May 17, 2023 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants