bhouse-nexthop opened a new pull request, #14792:
URL: https://github.com/apache/cloudstack/pull/14792

   ### Description
   
   Deleting a CKS cluster threw an NPE when one of its node VMs had already 
been expunged, because the VM's `kubernetes_cluster_vm_map` row was left 
behind. This PR lets the delete go through and removes the stale row.
   
   | File | Change |
   |---|---|
   | `KubernetesClusterDestroyWorker.destroy` | backup-offering, external-node 
and network-VM checks only look at VMs that still exist |
   | `KubernetesClusterDestroyWorker.destroyClusterVMs` | after destroying the 
remaining VMs, logs a WARN and expunges the map rows of VMs that no longer 
exist |
   | `KubernetesClusterManagerImpl.checkIfVmsAssociatedWithBackupOffering` | 
skips missing VMs (also used by the ExternalManaged delete path) |
   | tests | `KubernetesClusterDestroyWorkerTest` (new), 
`KubernetesClusterManagerImplTest` |
   
   Stale rows are only removed once the delete is under way (after 
`DestroyRequested`), so a delete rejected by a pre-check leaves the map 
untouched.
   
   Fixes: #14791
   
   ### Types of changes
   
   - [ ] Breaking change (fix or feature that would cause existing 
functionality to change)
   - [ ] New feature (non-breaking change which adds functionality)
   - [x] Bug fix (non-breaking change which fixes an issue)
   - [ ] Enhancement (improves an existing feature and functionality)
   - [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
   - [ ] Build/CI
   - [ ] Test (unit or integration test code)
   
   ### Feature/Enhancement Scale or Bug Severity
   
   #### Bug Severity
   
   - [ ] BLOCKER
   - [ ] Critical
   - [x] Major
   - [ ] Minor
   - [ ] Trivial
   
   ### How Has This Been Tested?
   
   - `mvn -pl plugins/integrations/kubernetes-service test`: 80 tests, all pass 
(checkstyle included).
   
   #### How did you try to break this feature and the system with this change?
   
   - Missing VM mixed with live VMs: live ones are still destroyed; stale rows 
are removed after the loop, so `fetchControlVmIfMissing` indexing is not 
shifted while CSI cleanup runs.
   - Pre-check failure (backup offering, foreign VM on the network): nothing is 
removed.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to