-
Notifications
You must be signed in to change notification settings - Fork 32
Allow custom region from config #83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request adds support for a configurable region parameter in the CloudStack cloud provider configuration, allowing users to specify a region independently of the zone. This addresses the limitation where the region was previously always set to the same value as the zone.
Key Changes:
- Added
regionfield to bothCSConfigandCSCloudstructs for configuration and storage - Updated
GetZonemethod to use the configured region when available, falling back to zone name when not set - Maintained backward compatibility by defaulting to zone name when region is not configured
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ff4527c to
2433dd9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2433dd9 to
1f2ed33
Compare
DaanHoogland
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clgtm
harikrishna-patnala
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code LGTM
1f2ed33 to
c9ba7e3
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #83 +/- ##
==========================================
- Coverage 19.32% 19.21% -0.11%
==========================================
Files 4 4
Lines 885 890 +5
==========================================
Hits 171 171
- Misses 710 715 +5
Partials 4 4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
kiranchavala
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Make sure the cloudstack-secret contains region
[Global]
api-url = http://10.0.34.63:8080/client/api
api-key = uH6SGu95HNH7ICgmZWs2rW8c7Zy4yR_juqUoU5o3RoG3s_uFTk629aQlk9vksb-h_EoG_o90EhbONGKkGKyqqA
secret-key = vSRgDiyw22iunexOAMOU3YwB-xr3jMZPhDja9WY4xvWz9Ipgnwt-6EhR6RciG7I-jI8ZkaaSRDZGCVEOwNbQtA
region = india
kubectl taint nodes node.cloudprovider.kubernetes.io/uninitialized=true:NoSchedule
kubectl get node cks2-node-19b0bf63dad --show-labels
NAME STATUS ROLES AGE VERSION LABELS
cks2-node-19b0bf63dad Ready <none> 6h26m v1.33.1 beta.kubernetes.io/arch=amd64,beta.kubernetes.io/instance-type=CKS,beta.kubernetes.io/os=linux,failure-domain.beta.kubernetes.io/region=india,failure-domain.beta.kubernetes.io/zone=ref-trl-10334-k-Mol8-kiran-chavala,kubernetes.io/arch=amd64,kubernetes.io/hostname=cks2-node-19b0bf63dad,kubernetes.io/os=linux,node.kubernetes.io/instance-type=CKS,topology.kubernetes.io/region=india,topology.kubernetes.io/zone=ref-trl-10334-k-Mol8-kiran-chavala
Fixes #39
Details
This pull request introduces support for a configurable
regionparameter in the CloudStack cloud provider code. The main change is the addition of theregionfield to the configuration and internal structures, allowing the region to be set independently of the zone. The logic in theGetZonemethod is updated to use the configured region if provided.Configuration and struct updates:
regionfield to theCSConfigstruct and its configuration parsing, allowing users to specify a region in their configuration file.regionfield to theCSCloudstruct to store the configured region for use throughout the codebase.newCSCloudconstructor to initialize theregionfield from the configuration.Behavioral change:
GetZonemethod to set thezone.Regionfield to the configured region if it is set; otherwise, it defaults to using the zone as the region.