fix(cloud): make HasClusterID() return true to silence deprecation warning#1244
Open
arbianshkodra wants to merge 1 commit into
Open
fix(cloud): make HasClusterID() return true to silence deprecation warning#1244arbianshkodra wants to merge 1 commit into
arbianshkodra wants to merge 1 commit 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Changes
HasClusterID()inhcloud/cloud.gofrom returningfalseto returningtrue, and updates the corresponding test inhcloud/cloud_test.go.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()was hardcoded tofalse, operators were forced to pass--allow-untagged-cloudjust to clear the fail-fast check inmain.go:73-80, which then triggered the deprecation warning. The flag was functionally a no-op for Hetzner, but its presence was what caused the warning.Returning
truehere states the truth (Hetzner does not use ClusterID; treats every cluster as "tagged enough" for its purposes) and lets operators omit the flag entirely. The deprecation warning goes away at its source — kubernetes/cloud-provider only emits it when the flag is set.Behavior change
--allow-untagged-cloudor HCCM crashes on startupHasClusterID()returnsfalse(untruthful: Hetzner doesn't have or want a ClusterID, but the false return implies it should have one)HasClusterID()returnstrue(truthful: Hetzner is "tagged enough" for its own purposes)Operators who keep
--allow-untagged-cloudset will continue to see the deprecation warning (because the upstream library still notices the flag) — but they no longer need the flag.Testing
go build ./...passesgo test ./hcloud/ -run TestCloudpasses (test updated to assert the new expected behavior with a comment referencing HCCM: "--allow-untagged-cloud=false" and cluster labeling / tagging #1119)Closes #1119