You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PCP-6608: cluster-api-provider-maas wipes API server FQDN empty IP set persisted to MAAS DNS when CP machine is transiently powered off, hash-cached so no self-recovery (#339)
* PCP-6608: cluster-api-provider-maas wipes API server FQDN: empty IP set persisted to MAAS DNS when CP machine is transiently powered off, hash-cached so no self-recovery
* PCP-6608: address PR review comments
- Remove empty-IP guard from updateResourceIPs helper; guard belongs in
reconcileDNSAttachments where intent is known, not in a shared helper
that must support intentional clearing (deprovisioning)
- Deduplicate runningIpAddresses before hashing so the annotation always
represents the applied IP set, consistent with updateResourceIPs set
semantics — prevents spurious re-syncs if duplicate IPs appear
- Add IsDriftDetected edge-case tests: duplicate desired IPs and empty
strings in desired are correctly handled without false drift signals
* PCP-6608: fix stale DNS on last CP deletion; add missing test coverage
Fix#2 - last CP deletion leaves stale DNS:
Track existingCPCount (CPs without DeletionTimestamp) separately.
Preserve DNS only when existingCPCount > 0 (transient power-off flap).
When existingCPCount == 0 (all CPs absent or pending deletion), fall
through to clear DNS so stale records don't persist after a rolling
replacement or scale-down.
Tests (#4, #5, #6):
- CP with DeletionTimestamp: excluded from existingCPCount, DNS cleared
- CP running but no ExternalIP: existingCPCount>0, DNS preserved
(covers preferred-subnet mismatch code path)
- GetDNSResource error: error propagated to caller
- Updated "no CP machines" assertion to reflect new DNS-clear behaviour
* Fix go vul check
0 commit comments