diff --git a/driver/controller.go b/driver/controller.go index f2da5ea92595efb0561a9d87fb3920c4091ac554..f42c29e2db84dc664c6a6f5e96a139d8a1222010 100644 --- a/driver/controller.go +++ b/driver/controller.go @@ -94,7 +94,7 @@ func (s *ControllerService) CreateVolume(ctx context.Context, req *proto.CreateV AccessibleTopology: []*proto.Topology{ { Segments: map[string]string{ - TopologySegmentLocationLegacy: volume.Location, + TopologySegmentLocation: volume.Location, }, }, }, diff --git a/driver/controller_test.go b/driver/controller_test.go index 1abdb353a1c39f71a7446cdada27560db1bc85b4..7b14042c579312ece6d4d62eb9dd275ada7413cd 100644 --- a/driver/controller_test.go +++ b/driver/controller_test.go @@ -91,7 +91,7 @@ func TestControllerServiceCreateVolume(t *testing.T) { } if len(resp.Volume.AccessibleTopology) == 1 { top := resp.Volume.AccessibleTopology[0] - if loc := top.Segments[TopologySegmentLocationLegacy]; loc != "testloc" { + if loc := top.Segments[TopologySegmentLocation]; loc != "testloc" { t.Errorf("unexpected location segment in topology: %s", loc) } } else { @@ -146,7 +146,7 @@ func TestControllerServiceCreateVolumeWithLocation(t *testing.T) { } if len(resp.Volume.AccessibleTopology) == 1 { top := resp.Volume.AccessibleTopology[0] - if loc := top.Segments[TopologySegmentLocationLegacy]; loc != "explicit" { + if loc := top.Segments[TopologySegmentLocation]; loc != "explicit" { t.Errorf("unexpected location segment in topology: %s", loc) } } else { diff --git a/driver/driver.go b/driver/driver.go index 718fd7d02a6b0d72ffb9e710dd0c01093be14d9e..0681199dd2685f6dac2b9fd023666f237d982cdb 100644 --- a/driver/driver.go +++ b/driver/driver.go @@ -1,9 +1,5 @@ package driver -import ( - apiv1 "k8s.io/api/core/v1" -) - const ( PluginName = "csi.hetzner.cloud" PluginVersion = "1.6.0" @@ -12,8 +8,5 @@ const ( MinVolumeSize = 10 // GB DefaultVolumeSize = MinVolumeSize - TopologySegmentLocation = apiv1.LabelZoneRegionStable - - // this label will be deprecated in future releases - TopologySegmentLocationLegacy = PluginName + "/location" + TopologySegmentLocation = PluginName + "/location" ) diff --git a/driver/node.go b/driver/node.go index a10be49843b1af1cbfba5e5ffa24f68208e7fda5..f3ca85348b82dbd36972f4769c5935d45a6876fb 100644 --- a/driver/node.go +++ b/driver/node.go @@ -172,12 +172,7 @@ 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, }, }, }