From 935460fca0f2bfbf7b0a63320affca6d5e03edfc Mon Sep 17 00:00:00 2001 From: "vincent.baer" Date: Mon, 18 Sep 2023 14:14:04 +0000 Subject: [PATCH] Add topology.kubernetes.io/zone if topology.bsu.outscale.com/zone not found --- pkg/driver/controller.go | 8 ++++++++ pkg/driver/driver.go | 5 +++-- 2 files changed, 11 insertions(+), 2 deletions(-) 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 {