✨ Refactor controller, handler errors, resync & remove telemetry#434
Merged
✨ Refactor controller, handler errors, resync & remove telemetry#434
Conversation
🔄 Replace watcher package with SharedInformerFactory + TypedRateLimitingInterface controller - controller/controller.go: standard informer event handlers, workqueue workers, cache sync - Removed watcher/start.go, watcher/watcher.go, watcher/watcher_test.go⚠️ Handler methods now return error for transient failures - ProcessPod/ProcessNode/ProcessPodObject/ProcessNodeObject return error - Transient errors (cache misses, API failures) trigger requeue with backoff - Permanent outcomes (filtered, deleted, alert sent) return nil 🔁 Add configurable resync period (config.resyncSeconds) - Default 0 = event-driven only, no periodic resync - Ensures missed events are eventually re-processed 🧹 Remove telemetry subsystem entirely - Deleted telemetry/ package - Removed from config, state, startup, constant, deploy configs, docs - Removed IsTelemetrySent/MarkTelemetrySent from StateManager - Simplified StartupManager constructor (removed telemetryCfg param) 📝 Clean up unused Controller.client field, update deploy configs and READMEs
🧹 Probes removed from deploy/deploy.yaml and Helm chart deployment template 🗑️ Removed readinessProbe and livenessProbe config from values.yaml and chart README ✅ restartPolicy: Always kept (explicit for clarity) Probes were pointless for kwatch: - Readiness: no inbound traffic to route, no Service in deploy - Liveness: health server goroutine runs independently of controller loop (stuck controller still gets 200 OK from /healthz) K8s restarts containers automatically when the process exits.
Mock handler podKeys/podDel/nodeKeys/nodeDel slices were accessed concurrently by the controller worker goroutine and the test goroutine without synchronization, causing -race failures in CI. Added sync.Mutex to mockHandler and thread-safe accessor methods (podCount, nodeCount, podEntry, nodeEntry).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔄 Replace watcher package with SharedInformerFactory + TypedRateLimitingInterface controller
🔁 Add configurable resync period (config.resyncSeconds)
🧹 Remove telemetry subsystem entirely
📝 Clean up unused Controller.client field, update deploy configs and READMEs