Skip to content

Conversation

@susesamu
Copy link

Problem:
When a ClusterNetwork is deleted, its corresponding NAD may remain in the cluster. This stale NAD is no longer owned by any existing ClusterNetwork and can block subsequent VLANConfig updates or network reconciliation, requiring manual cleanup.

Solution:
Extend the NAD controller reconciliation logic to detect resources that reference a non-existent ClusterNetwork. When such a condition is detected, the controller automatically deletes the orphaned NAD. This ensures that derived network resources are properly cleaned up when their owning ClusterNetwork is removed.

Related Issue:
harvester/harvester#10040

Test plan:

  1. Create a ClusterNetwork and confirm its NAD is created.
  2. Delete the ClusterNetwork and confirm the corresponding NAD is automatically removed by the controller.
  3. Verify no regression for unmanaged or non-Harvester NADs.

Copilot AI review requested due to automatic review settings February 10, 2026 19:06
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Extends the NetworkAttachmentDefinition (NAD) manager controller reconciliation to detect VLAN NADs referencing a non-existent ClusterNetwork and proactively delete them, preventing stale/orphaned NADs from blocking later network reconciliation.

Changes:

  • Add an orphan check in NAD OnChange to detect missing ClusterNetwork references.
  • Automatically delete VLAN NADs whose referenced ClusterNetwork no longer exists.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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