bhouse-nexthop opened a new pull request, #14813: URL: https://github.com/apache/cloudstack/pull/14813
### Description Fixes #14812 | change | why | |---|---| | `listKubernetesClusters`: read the CNI configuration including removed rows, skip it if the row is gone | a deleted configuration made the call fail with an NPE | | `deleteUserData` / `deleteCniConfiguration`: refuse while a non-removed cluster references the configuration, naming the cluster | before, only a cluster with a control VM blocked it, with a generic "used by some instances" message | | `createKubernetesCluster`: `cniconfigurationid` must exist and the caller must have access to it | same check as `userdataid` on `resetUserDataForVirtualMachine` | Notes: - The in-use check goes through `KubernetesServiceHelper` (new `checkUserDataCanBeDeleted`), the same way the server already asks the plugin before destroying a VM. It runs before the VM check so the message names the cluster. - New DAO method `KubernetesClusterDao.listByCniConfigId`. No schema change. - Touches the same files as #14811 (`ManagementServerImpl`, `ManagementServerImplTest`) in different places; merges cleanly with it. #14811 covers the cluster start path for a missing configuration. ### 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? - `KubernetesClusterManagerImplTest`: response with missing / removed / no configuration; create validation with no id, unknown id, no access, access. - `KubernetesServiceHelperImplTest`: delete allowed when unused; refused with the cluster name when used. - `ManagementServerImplTest`: delete calls the helper first and stops when it refuses; existing delete tests still pass without the plugin bean. - Confirmed the list NPE on unmodified 4.22 with a unit test before the fix. - Test-merged with #14811 and ran the same tests on the result. #### How did you try to break this feature and the system with this change? - Plugin not loaded: delete falls back to the existing checks. - Destroyed clusters (removed) don't block the delete. - Admin creating a cluster for another account with an admin-owned configuration still works (caller check only). -- 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]
