From 388a5cee5778303597f7358274363a0ee7811698 Mon Sep 17 00:00:00 2001 From: Maksim Paskal Date: Thu, 17 Nov 2022 17:23:43 +0200 Subject: [PATCH] autoscaler topology label Signed-off-by: Maksim Paskal --- driver/driver.go | 9 ++++++++- driver/node.go | 5 +++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/driver/driver.go b/driver/driver.go index 0681199d..718fd7d0 100644 --- a/driver/driver.go +++ b/driver/driver.go @@ -1,5 +1,9 @@ package driver +import ( + apiv1 "k8s.io/api/core/v1" +) + const ( PluginName = "csi.hetzner.cloud" PluginVersion = "1.6.0" @@ -8,5 +12,8 @@ const ( MinVolumeSize = 10 // GB DefaultVolumeSize = MinVolumeSize - TopologySegmentLocation = PluginName + "/location" + TopologySegmentLocation = apiv1.LabelZoneRegionStable + + // this label will be deprecated in future releases + TopologySegmentLocationLegacy = PluginName + "/location" ) diff --git a/driver/node.go b/driver/node.go index f3ca8534..a10be498 100644 --- a/driver/node.go +++ b/driver/node.go @@ -172,7 +172,12 @@ func (s *NodeService) NodeGetInfo(context.Context, *proto.NodeGetInfoRequest) (* MaxVolumesPerNode: MaxVolumesPerNode, AccessibleTopology: &proto.Topology{ Segments: map[string]string{ + // need this topology key for k8s clusters without hcloud-cloud-controller-manager + // that handles this node label TopologySegmentLocation: s.serverLocation, + // need this topology key for backward compatibility + // for PV created with older version this CSI driver + TopologySegmentLocationLegacy: s.serverLocation, }, }, }