Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Resync resources in the namespaces on NamespaceCredential changes #1143

Conversation

maciaszczykm
Copy link
Member

No description provided.

Copy link

linear bot commented Jul 5, 2024

@maciaszczykm maciaszczykm added the enhancement New feature or request label Jul 5, 2024
@maciaszczykm maciaszczykm requested a review from a team July 5, 2024 13:00
@maciaszczykm maciaszczykm marked this pull request as ready for review July 5, 2024 13:00
// Setting max concurrent reconciles is a hard requirement for current namespace credentials implementation.
// Following watch ensures that if namespaced credentials change, all objects that use them will be reconciled.
WithOptions(controller.Options{MaxConcurrentReconciles: 1}).
Watches(&v1alpha1.NamespaceCredentials{}, handler.EnqueueRequestsFromMapFunc(func(ctx context.Context, nc client.Object) []reconcile.Request {
Copy link
Member

Choose a reason for hiding this comment

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

Is there no way to DRY up these EnqueueRequestsFromMapFunc handlers? Maybe generics could help or something?

Copy link
Member Author

Choose a reason for hiding this comment

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

I will give it another try as at the first attempt I had problem with interface for list object that client uses to list resources.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's done now.

@maciaszczykm maciaszczykm marked this pull request as draft July 5, 2024 13:06
@maciaszczykm
Copy link
Member Author

maciaszczykm commented Jul 5, 2024

Converting to draft to connect secret with namespace credentials, so we will have full event propagation for token changes.

Edit: Reminder to merge SyncNamespacedCredentialsAnnotation and MarkCredentialsCondition.

@maciaszczykm
Copy link
Member Author

Added logic to recreate service account secret if it gets deleted.

@maciaszczykm maciaszczykm marked this pull request as ready for review July 8, 2024 11:46
@maciaszczykm maciaszczykm requested review from a team and michaeljguarino July 8, 2024 11:46
@maciaszczykm maciaszczykm merged commit d4f2f02 into master Jul 8, 2024
13 checks passed
@maciaszczykm maciaszczykm deleted the marcin/prod-2387-resync-resources-in-the-namespaces-on-namespacecredential branch July 8, 2024 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants