bhouse-nexthop opened a new pull request, #14916: URL: https://github.com/apache/cloudstack/pull/14916
### Description The cluster autoscaler never scales a CKS cluster owned by a project (#14915). Its CloudStack provider looks the cluster up with `listKubernetesClusters id=<id>` and no `projectid`, using the key of the project's Kubernetes service account. For a user account, a list without `projectid` only searches the caller's own account, so the autoscaler gets an empty list and logs "Unable to fetch cluster with id". When a user account lists by `id` alone, `listKubernetesClusters` now also finds a cluster of a project it may list, as if `projectid` had been given. Whether it may list the cluster is decided by the usual entity access check (`checkAccess` with `ListEntry`), so project membership and project roles apply as they do with `projectid`. Unchanged: lists without an id; lists with `projectid`, `account` or `domainid`; admin and domain admin callers (they already find a cluster by id). The provider could also send the `project-id` it reads from the cloud-config. This change makes the autoscaler images that are already deployed work without a new image. Fixes: #14915 ### 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 #### Feature/Enhancement Scale - [ ] Major - [ ] Minor #### Bug Severity - [ ] BLOCKER - [ ] Critical - [x] Major - [ ] Minor - [ ] Trivial ### Screenshots (if appropriate): ### How Has This Been Tested? Unit tests in `KubernetesClusterManagerImplTest`: the project is resolved for a cluster the caller may list, not when the access check denies it, not for an account-owned or unknown cluster; the search is unchanged with `projectid`, `account` or `domainid`, without an id, and for admin and domain admin callers. `mvn -pl plugins/integrations/kubernetes-service -am test`: all tests pass. A lab test on a KVM zone follows in a comment. -- 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]
