Skip to content

Commit

Permalink
Add topology.kubernetes.io/zone if topology.bsu.outscale.com/zone not…
Browse files Browse the repository at this point in the history
… found
  • Loading branch information
vincentBaer committed Sep 18, 2023
1 parent 8be720e commit 935460f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
8 changes: 8 additions & 0 deletions pkg/driver/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
}
Expand Down
5 changes: 3 additions & 2 deletions pkg/driver/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 935460f

Please sign in to comment.