Skip to content

Conversation

@hsmatulis
Copy link
Collaborator

This PR removes the cleanupOldResources logic executed during the operator's startup sequence and its associated unit tests.

  • Removed cleanupOldResources function from pkg/operator/operator.go.

  • Removed the call to cleanupOldResources within the main Run loop.

  • Deleted pkg/operator/operator_test.go as it solely contained TestCleanupOldResources.

  • Cleaned up unused imports (k8s admissionregistration, apierrors, etc.).

Reasoning

The cleanupOldResources function handled legacy migrations (specifically deleting old ValidatingWebhookConfiguration and unannotated Collector/RuleEvaluator resources). This logic is no longer required for current versions of the operator. Removing it simplifies the startup path and removes technical debt. The only risk would be failure to automatically clear resources upon upgrades

Internal reference: b/422809019

b/422809019

Signed-off-by: Henrique Matulis <hmatulis@google.com>
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.

1 participant