diff --git a/pkg/driver/controller.go b/pkg/driver/controller.go index db5fe32f..5a9ac11c 100644 --- a/pkg/driver/controller.go +++ b/pkg/driver/controller.go @@ -534,12 +534,20 @@ func pickAvailabilityZone(requirement *csi.TopologyRequirement) string { if exists { return zone } + zone, exists = topology.GetSegments()[TopologyK8sKey] + if exists { + return zone + } } for _, topology := range requirement.GetRequisite() { zone, exists := topology.GetSegments()[TopologyKey] if exists { return zone } + zone, exists = topology.GetSegments()[TopologyK8sKey] + if exists { + return zone + } } return "" } diff --git a/pkg/driver/driver.go b/pkg/driver/driver.go index e06387fa..64a843c9 100644 --- a/pkg/driver/driver.go +++ b/pkg/driver/driver.go @@ -41,8 +41,9 @@ const ( ) const ( - DriverName = "bsu.csi.outscale.com" - TopologyKey = "topology." + DriverName + "/zone" + DriverName = "bsu.csi.outscale.com" + TopologyKey = "topology." + DriverName + "/zone" + TopologyK8sKey = "topology.kubernetes.io/zone" ) type Driver struct {