Skip to content

Conversation

@aphralG
Copy link
Contributor

@aphralG aphralG commented Jan 15, 2026

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.

  • I have read the CONTRIBUTING document
  • I have run make install-tools and have attached any dependency changes to this pull request
  • If applicable, I have added tests that prove my fix is effective or that my feature works
  • If applicable, I have checked that any relevant tests pass after adding my changes
  • If applicable, I have updated any relevant documentation (README.md)
  • If applicable, I have tested my cross-platform changes on Ubuntu 22, Redhat 8, SUSE 15 and FreeBSD 13

@aphralG aphralG requested a review from a team as a code owner January 15, 2026 17:06
@github-actions github-actions bot added the chore Pull requests for routine tasks label Jan 15, 2026
@codecov
Copy link

codecov bot commented Jan 19, 2026

Codecov Report

❌ Patch coverage is 75.28090% with 66 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.54%. Comparing base (02f4c36) to head (af3b01a).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...ernal/watcher/instance/instance_watcher_service.go 76.08% 17 Missing and 5 partials ⚠️
internal/nginx/nginx_plugin.go 67.24% 19 Missing ⚠️
internal/nginx/nginx_service.go 72.88% 15 Missing and 1 partial ⚠️
...her/instance/nginx-app-protect-instance-watcher.go 83.78% 5 Missing and 1 partial ⚠️
internal/watcher/health/health_watcher_service.go 57.14% 3 Missing ⚠️
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     
Files with missing lines Coverage Δ
internal/nginx/nginx_instance_operator.go 91.17% <ø> (ø)
internal/nginx/nginx_instance_process_operator.go 61.76% <ø> (ø)
internal/nginx/nginx_log_tailer_operator.go 86.66% <ø> (ø)
internal/nginx/nginx_plus_actions.go 97.60% <100.00%> (ø)
internal/plugin/plugin_manager.go 88.23% <100.00%> (ø)
internal/watcher/watcher_plugin.go 69.76% <100.00%> (-3.15%) ⬇️
internal/watcher/health/health_watcher_service.go 44.89% <57.14%> (-44.20%) ⬇️
...her/instance/nginx-app-protect-instance-watcher.go 80.00% <83.78%> (-2.69%) ⬇️
internal/nginx/nginx_service.go 59.74% <72.88%> (ø)
internal/nginx/nginx_plugin.go 77.67% <67.24%> (ø)
... and 1 more

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 02f4c36...af3b01a. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

r.resourceMutex.Lock()
defer r.resourceMutex.Unlock()
func (n *NginxService) UpdateResource(ctx context.Context, resource *mpi.Resource) *mpi.Resource {
slog.DebugContext(ctx, "Updating resource")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
slog.DebugContext(ctx, "Updating resource")
slog.DebugContext(ctx, "Updating resource", "resource", resource)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Pull requests for routine tasks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants