Skip to content

Add ROBOT_USE_LEGACY_PROVIDER_ID to use legacy provider ID#1142

Open
guettli wants to merge 1 commit intohetznercloud:mainfrom
guettli:use-legacy-provider-id
Open

Add ROBOT_USE_LEGACY_PROVIDER_ID to use legacy provider ID#1142
guettli wants to merge 1 commit intohetznercloud:mainfrom
guettli:use-legacy-provider-id

Conversation

@guettli
Copy link
Contributor

@guettli guettli commented Jan 28, 2026

For some clusters it might be challenging to
update the tool creating new nodes (like
Cluster API Provider Hetzner) and the CCM so that
both agree on the provider ID format.

If the env var ROBOT_USE_LEGACY_PROVIDER_ID is set to a true value ("1", "t", "T", "true", "TRUE",
"True"), then the CCM will use the legacy format
("hcloud://bm-NNNN") when returning
InstanceMetadata.

This applies only, when the node is created. Once
a provider ID is set, it won't be changed again.

For some clusters it might be challenging to
update the tool creating new nodes (like
Cluster API Provider Hetzner) and the CCM so that
both agree on the provider ID format.

If the env var ROBOT_USE_LEGACY_PROVIDER_ID is set
to a true value ("1", "t", "T", "true", "TRUE",
"True"), then the CCM will use the legacy format
("hcloud://bm-NNNN") when returning
InstanceMetadata.

This applies only, when the node is created. Once
a provider ID is set, it won't be changed again.
@guettli guettli requested a review from a team as a code owner January 28, 2026 13:01
@codecov
Copy link

codecov bot commented Jan 28, 2026

Codecov Report

❌ Patch coverage is 63.63636% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.76%. Comparing base (f66b1ce) to head (509c435).

Files with missing lines Patch % Lines
internal/config/config.go 33.33% 1 Missing and 1 partial ⚠️
internal/providerid/providerid.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1142      +/-   ##
==========================================
- Coverage   68.40%   64.76%   -3.64%     
==========================================
  Files          23       23              
  Lines        2624     2634      +10     
==========================================
- Hits         1795     1706      -89     
- Misses        655      759     +104     
+ Partials      174      169       -5     
Flag Coverage Δ
e2e ?
unit 64.76% <63.63%> (-0.02%) ⬇️

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.

@apricote
Copy link
Member

Hey @guettli, what has changed since #1066 (comment)?

@guettli
Copy link
Contributor Author

guettli commented Jan 28, 2026

@apricote Background: one caph controller (in mgt-cluster) controlls many workload-clusters. We need a way to differentiate between "wl-cluster wants new format" and "wl-cluster wants old-format". This is doable. We could extend HetznerBareMetalMachine and add a new field.

But during an upgrade things are not well defined. The update could hang after the new ccm is active. Then old machineDeployments can't scale, because they would use a HetznerBareMetalMachineTemplate with the old format. Caph would use the old format, and ccm would use the new format. Capi would never see the new Node.

We had a look at several other solutions. For example: CAPI can sync annotations from machine to node. But this happens after the node has a providerID.

So currently this PR is the easiest solution: Old cluster use the old format (even if they get updated), and new clusters use the new format. Not nice, but better than having a undefined situation during an cluster update.

It would be very nice, if you could accept the PR.

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