Skip to content

Fix bug in cloud client missing the project id and refactor the package#28

Open
elivlo wants to merge 5 commits intoshapeblue:mainfrom
elivlo:refactor-cloud-client
Open

Fix bug in cloud client missing the project id and refactor the package#28
elivlo wants to merge 5 commits intoshapeblue:mainfrom
elivlo:refactor-cloud-client

Conversation

@elivlo
Copy link
Contributor

@elivlo elivlo commented Feb 26, 2026

Description of changes:
The client only uses the project ID in the function GetVMByID and not in the function getVMByName. This causes the CSI where the instance ID is not found in the metadata and the VM is in a project to fail. Eventually they fall back into a crash loop back off and the CSI is not usable.

It refactors all functions of the cloud package to use the default project_id option. This reduces code duplication by using cloudstack client methods that support the default options. This refactoring is based on the following fix: It fixes the function getVMByName by using the method GetVirtualMachineByName instead of ListVirtualMachines.

These changes ensure that the project id is automatically included and makes the code more mature.

Testing performed:
I installed k8s into Cloudstack inside of a project and without. The setup of the CSI worked when running in the root project but not in sub projects with the current version 3.0.0. I am using my PR version currently in a cluster on a Cloudstack instance within a project and with that it is working just fine.

Please create a bugfix release when the PR is approved and merged.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@elivlo
Copy link
Contributor Author

elivlo commented Feb 26, 2026

@Pearl1594 I have created a bugfix here and closed the issue in the cloudstack group.

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