Skip to content

Conversation

@vishesh92
Copy link
Member

Fixes #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 region field to the CSConfig struct and its configuration parsing, allowing users to specify a region in their configuration file.
  • Added a region field to the CSCloud struct to store the configured region for use throughout the codebase.
  • Updated the newCSCloud constructor to initialize the region field from the configuration.

Behavioral change:

  • Modified the GetZone method to set the zone.Region field to the configured region if it is set; otherwise, it defaults to using the zone as the region.

Copy link
Contributor

Copilot AI left a 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 region field to both CSConfig and CSCloud structs for configuration and storage
  • Updated GetZone method 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.

Copy link
Contributor

Copilot AI left a 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.

@vishesh92 vishesh92 marked this pull request as ready for review November 25, 2025 15:04
@vishesh92 vishesh92 added this to the 1.2.0 milestone Nov 25, 2025
Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clgtm

Copy link

@harikrishna-patnala harikrishna-patnala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code LGTM

@codecov-commenter
Copy link

codecov-commenter commented Dec 11, 2025

Codecov Report

❌ Patch coverage is 0% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 19.21%. Comparing base (abddd58) to head (ba42198).

Files with missing lines Patch % Lines
cloudstack.go 0.00% 8 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

@kiranchavala kiranchavala left a 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

@vishesh92 vishesh92 merged commit 04bf536 into main Dec 12, 2025
7 checks passed
@vishesh92 vishesh92 deleted the allow-custom-region branch December 12, 2025 07:21
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.

Feature Requests: allow custom topology.kubernetes.io/region

5 participants