diff --git a/hcloud/cloud.go b/hcloud/cloud.go index 621ee7a1..0b0586ec 100644 --- a/hcloud/cloud.go +++ b/hcloud/cloud.go @@ -226,7 +226,14 @@ func (c *cloud) ProviderName() string { } func (c *cloud) HasClusterID() bool { - return false + // Hetzner does not consume the kubernetes/cloud-provider ClusterID for + // any tagging or reconciliation — see issue #1119, where this was + // confirmed by maintainers. Returning true lets operators omit the + // `--allow-untagged-cloud` flag entirely, which in turn silences the + // upstream deprecation warning ("Flag --allow-untagged-cloud has been + // deprecated, ... A cluster-id will be required on cloud instances.") + // emitted by k8s.io/cloud-provider when the flag is set. + return true } // serverIsAttachedToNetwork checks if the server where the master is running on is attached to the configured private network diff --git a/hcloud/cloud_test.go b/hcloud/cloud_test.go index 71634ee5..69c50e73 100644 --- a/hcloud/cloud_test.go +++ b/hcloud/cloud_test.go @@ -240,8 +240,8 @@ func TestCloud(t *testing.T) { }) t.Run("HasClusterID", func(t *testing.T) { - if cloud.HasClusterID() { - t.Error("HasClusterID should be false") + if !cloud.HasClusterID() { + t.Error("HasClusterID should be true so operators can omit --allow-untagged-cloud (see issue #1119)") } })