Skip to content

Commit

Permalink
autoscaler topology label
Browse files Browse the repository at this point in the history
Signed-off-by: Maksim Paskal <paskal.maksim@gmail.com>
  • Loading branch information
maksim-paskal committed Nov 17, 2022
1 parent b89386d commit 388a5ce
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
9 changes: 8 additions & 1 deletion driver/driver.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package driver

import (
apiv1 "k8s.io/api/core/v1"
)

const (
PluginName = "csi.hetzner.cloud"
PluginVersion = "1.6.0"
Expand All @@ -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"
)
5 changes: 5 additions & 0 deletions driver/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
},
}
Expand Down

0 comments on commit 388a5ce

Please sign in to comment.