fix(main): drop forced --allow-untagged-cloud requirement to silence deprecation warning#1244
fix(main): drop forced --allow-untagged-cloud requirement to silence deprecation warning#1244arbianshkodra wants to merge 3 commits into
Conversation
…rning
The kubernetes/cloud-provider library deprecated --allow-untagged-cloud
and emits a startup warning whenever the flag is set:
Flag --allow-untagged-cloud has been deprecated, This flag is
deprecated and will be removed in a future release. A cluster-id
will be required on cloud instances.
For Hetzner specifically, no ClusterID is ever consumed by the cloud
provider — issue hetznercloud#1119 closed Jan 2026 with maintainer confirmation:
"We don't use cluster-ids anywhere in the code. Neither has
allow-untagged-cloud any relevance for us. ... You can safely
ignore this message from the logs."
Because HasClusterID() was hardcoded to return false, operators were
forced to pass --allow-untagged-cloud just to get past the fail-fast
check in main.go:73-80 — which then triggered the deprecation warning
from upstream. The flag is functionally a no-op for Hetzner, but its
presence is what causes the warning.
Returning true here states the truth (Hetzner does not use ClusterID,
treats every cluster as "tagged enough" for its purposes) and lets
operators omit the flag entirely, which silences the warning at its
source. Behavior is otherwise unchanged.
Closes hetznercloud#1119
|
Hey @arbianshkodra, I'd prefer not to change the value returned by That said, I'm fine with removing the startup warning, as I don't see much upstream movement toward using cluster IDs. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1244 +/- ##
==========================================
- Coverage 71.01% 67.17% -3.84%
==========================================
Files 24 24
Lines 2677 2672 -5
==========================================
- Hits 1901 1795 -106
- Misses 604 706 +102
+ Partials 172 171 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
The e2e tests failing is expected here, due to our permissions. |
|
@lukasmetzner, understood. Should I update this? |
|
Yes, feel free update this PR. |
Per review on hetznercloud#1244, keep HasClusterID() returning false (it is part of the upstream cloud-provider interface) and instead remove the fail-fast in cloudInitializer that forced operators to pass --allow-untagged-cloud. That forced flag was the only thing that triggered the upstream pflag deprecation warning. With the requirement gone, operators omit the flag and the warning disappears at its source, without changing the interface. This reverts the cloud.go/cloud_test.go changes from 6caccaa. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Done. Kept |
What
Removes the fail-fast in
cloudInitializer(main.go) that forced operators to pass--allow-untagged-cloud.HasClusterID()is left unchanged (still returnsfalse).Why
The
kubernetes/cloud-providerlibrary deprecated--allow-untagged-cloudand emits a startup warning whenever the flag is set:For Hetzner, no ClusterID is ever consumed by the cloud provider — confirmed in #1119:
Because
HasClusterID()returnsfalse,cloudInitializerwouldklog.Fatalfon startup unless--allow-untagged-cloudwas set. Operators were therefore forced to pass the flag — and passing the (deprecated) flag is exactly what triggered the upstream warning. The flag was functionally a no-op for Hetzner; its mere presence caused the warning.By removing the fail-fast requirement, operators can omit the flag entirely and the deprecation warning disappears at its source (the upstream library only emits it when the flag is set).
Why not change
HasClusterID()?The initial approach changed
HasClusterID()to returntrue. Per review feedback from @lukasmetzner, that value is part of the upstream cloud-provider interface and changing it could cause unexpected behavior if consumed upstream. This revision keeps the interface untouched and instead drops the locally-owned fail-fast inmain.go.Behavior change
--allow-untagged-cloudor HCCM crashes on startupHasClusterID()returnsfalseHasClusterID()returnsfalse(unchanged)Operators who keep
--allow-untagged-cloudset will continue to see the deprecation warning (the upstream library still notices the flag) — but they no longer need the flag.Testing
go build ./...passesgo test ./hcloud/ -run TestCloudpassesCloses #1119