Skip to content

fix: statically map deprecated datacenter names#1159

Merged
lukasmetzner merged 2 commits intomainfrom
fix-datacenter-deprecation
Feb 18, 2026
Merged

fix: statically map deprecated datacenter names#1159
lukasmetzner merged 2 commits intomainfrom
fix-datacenter-deprecation

Conversation

@lukasmetzner
Copy link
Contributor

@lukasmetzner lukasmetzner commented Feb 18, 2026

The server.datacenter field is deprecated and will be removed from the API response after July 2026: https://docs.hetzner.cloud/changelog#2025-12-16-phasing-out-datacenters

To avoid a breaking change in HCCM, we decided to statically map from the old location names to the existing datacenter names for the topology.kubernetes.io/zone label. For new locations we will return the location name without a -dcxx suffix.

Deployments of hcloud-cloud-controller-manager that are not updated when the field is removed from the API will panic with the following error:

"Observed a panic" panic="runtime error: invalid memory address or nil pointer dereference" panicGoValue="\"invalid memory address or nil pointer dereference\""

@lukasmetzner lukasmetzner requested a review from a team as a code owner February 18, 2026 09:42
@lukasmetzner lukasmetzner changed the title fix: datacenter deprecation fix: statically map deprecated datacenter names Feb 18, 2026
Datacenters will be deprecated after July 2026 and no longer returned in the API.
To avoid a breaking change in the API we decided to statically map from the old
location names to the existing datacenter names in the `topology.kuberenetes.io/zone`
label.
@codecov
Copy link

codecov bot commented Feb 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.55%. Comparing base (74b7c6f) to head (e1d37af).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1159      +/-   ##
==========================================
+ Coverage   68.36%   68.55%   +0.19%     
==========================================
  Files          23       24       +1     
  Lines        2627     2643      +16     
==========================================
+ Hits         1796     1812      +16     
  Misses        656      656              
  Partials      175      175              
Flag Coverage Δ
e2e 43.88% <33.33%> (-0.14%) ⬇️
unit 64.96% <100.00%> (+0.21%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@lukasmetzner
Copy link
Contributor Author

This PR addresses the immediate fix for #1146

@lukasmetzner lukasmetzner merged commit 0dc8d6a into main Feb 18, 2026
18 of 22 checks passed
@lukasmetzner lukasmetzner deleted the fix-datacenter-deprecation branch February 18, 2026 10:58
lukasmetzner pushed a commit that referenced this pull request Feb 20, 2026
### Datacenter Deprecation

The `server.datacenter` field is deprecated and will be removed from the
API response after July 2026:
https://docs.hetzner.cloud/changelog#2025-12-16-phasing-out-datacenters

To avoid a breaking change in HCCM, we decided to statically map from
the old location names to the existing datacenter names for the
`topology.kubernetes.io/zone` label. For new locations we will return
the location name without a `-dcxx` suffix.

Deployments of `hcloud-cloud-controller-manager` that are not updated
when the field is removed from the API will **panic** with the following
error:

"Observed a panic" panic="runtime error: invalid memory address or nil
pointer dereference" panicGoValue="\"invalid memory address or nil
pointer dereference\""

We have published an RFC which details how we want to continue utilizing
the labels `topology.kubernetes.io/zone` and
`topology.kubernetes.io/region`:
#1146 (comment)

### Bug Fixes

- statically map deprecated datacenter names (#1159)
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.

2 participants