cloudstack-kubernetes-provider
cloudstack-kubernetes-provider copied to clipboard
Allow custom region from config
Fixes https://github.com/apache/cloudstack-kubernetes-provider/issues/39
Details
This pull request introduces support for a configurable region parameter in the CloudStack cloud provider code. The main change is the addition of the region field to the configuration and internal structures, allowing the region to be set independently of the zone. The logic in the GetZone method is updated to use the configured region if provided.
Configuration and struct updates:
- Added a
regionfield to theCSConfigstruct and its configuration parsing, allowing users to specify a region in their configuration file. - Added a
regionfield to theCSCloudstruct to store the configured region for use throughout the codebase. - Updated the
newCSCloudconstructor to initialize theregionfield from the configuration.
Behavioral change:
- Modified the
GetZonemethod to set thezone.Regionfield to the configured region if it is set; otherwise, it defaults to using the zone as the region.