-
Notifications
You must be signed in to change notification settings - Fork 106
Refactor Instance Watcher #1490
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1490 +/- ##
==========================================
- Coverage 85.13% 84.54% -0.59%
==========================================
Files 102 102
Lines 13217 13199 -18
==========================================
- Hits 11252 11159 -93
- Misses 1475 1547 +72
- Partials 490 493 +3
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
| r.resourceMutex.Lock() | ||
| defer r.resourceMutex.Unlock() | ||
| func (n *NginxService) UpdateResource(ctx context.Context, resource *mpi.Resource) *mpi.Resource { | ||
| slog.DebugContext(ctx, "Updating resource") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| slog.DebugContext(ctx, "Updating resource") | |
| slog.DebugContext(ctx, "Updating resource", "resource", resource) |
Proposed changes
This PR removes each instance having its own Instance operator and health watcher.
It also moves the logic for updating the resource into the instance watcher to reduce the amount of messages being sent on the bus.
The resource plugin has been remnemed to the nginx plugin as it now only has logic to apply, relaod and validate the nginx config.
NAP no longer has its own instance watcher, the nap instance watcher is now started in the instance watcher and is checked for updates when we check for instance updates reducing complexity and the number of messages being sent.
Checklist
Before creating a PR, run through this checklist and mark each as complete.
CONTRIBUTINGdocumentmake install-toolsand have attached any dependency changes to this pull requestREADME.md)