From c69539a9aaad9b1cf327bcb77837d83d59a1923f 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 | 1 + 2 files changed, 9 insertions(+) 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..f1ee9792 100644 --- a/pkg/driver/driver.go +++ b/pkg/driver/driver.go @@ -43,6 +43,7 @@ const ( const ( DriverName = "bsu.csi.outscale.com" TopologyKey = "topology." + DriverName + "/zone" + TopologyK8sKey = "topology.kubernetes.io/zone" ) type Driver struct {