Skip to content

Commit

Permalink
Migrate CreateVolume response topology to standard label topology.kub…
Browse files Browse the repository at this point in the history
…ernetes.io/zone

Signed-off-by: Connor Catlett <[email protected]>
  • Loading branch information
ConnorJC3 committed Jul 12, 2024
1 parent ec8718a commit 8b70f71
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion pkg/driver/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ func newCreateVolumeResponse(disk *cloud.Disk, ctx map[string]string) *csi.Creat
}
}

segments := map[string]string{ZoneTopologyKey: disk.AvailabilityZone}
segments := map[string]string{WellKnownZoneTopologyKey: disk.AvailabilityZone}

arn, err := arn.Parse(disk.OutpostArn)

Expand Down
48 changes: 24 additions & 24 deletions pkg/driver/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,11 @@ func TestCreateVolume(t *testing.T) {
Requisite: []*csi.Topology{
{
Segments: map[string]string{
ZoneTopologyKey: expZone,
AwsAccountIDKey: outpostArn.AccountID,
AwsOutpostIDKey: outpostArn.Resource,
AwsRegionKey: outpostArn.Region,
AwsPartitionKey: outpostArn.Partition,
WellKnownZoneTopologyKey: expZone,
AwsAccountIDKey: outpostArn.AccountID,
AwsOutpostIDKey: outpostArn.Resource,
AwsRegionKey: outpostArn.Region,
AwsPartitionKey: outpostArn.Partition,
},
},
},
Expand All @@ -164,11 +164,11 @@ func TestCreateVolume(t *testing.T) {
AccessibleTopology: []*csi.Topology{
{
Segments: map[string]string{
ZoneTopologyKey: expZone,
AwsAccountIDKey: outpostArn.AccountID,
AwsOutpostIDKey: outpostArn.Resource,
AwsRegionKey: outpostArn.Region,
AwsPartitionKey: outpostArn.Partition,
WellKnownZoneTopologyKey: expZone,
AwsAccountIDKey: outpostArn.AccountID,
AwsOutpostIDKey: outpostArn.Resource,
AwsRegionKey: outpostArn.Region,
AwsPartitionKey: outpostArn.Partition,
},
},
},
Expand Down Expand Up @@ -1232,7 +1232,7 @@ func TestCreateVolume(t *testing.T) {
AccessibilityRequirements: &csi.TopologyRequirement{
Requisite: []*csi.Topology{
{
Segments: map[string]string{ZoneTopologyKey: expZone},
Segments: map[string]string{WellKnownZoneTopologyKey: expZone},
},
},
},
Expand All @@ -1245,7 +1245,7 @@ func TestCreateVolume(t *testing.T) {
AccessibilityRequirements: &csi.TopologyRequirement{
Requisite: []*csi.Topology{
{
Segments: map[string]string{ZoneTopologyKey: expZone},
Segments: map[string]string{WellKnownZoneTopologyKey: expZone},
},
},
},
Expand All @@ -1256,7 +1256,7 @@ func TestCreateVolume(t *testing.T) {
VolumeContext: map[string]string{},
AccessibleTopology: []*csi.Topology{
{
Segments: map[string]string{ZoneTopologyKey: expZone},
Segments: map[string]string{WellKnownZoneTopologyKey: expZone},
},
},
}
Expand Down Expand Up @@ -2084,17 +2084,17 @@ func TestGetOutpostArn(t *testing.T) {
requirement: &csi.TopologyRequirement{
Requisite: []*csi.Topology{
{
Segments: map[string]string{ZoneTopologyKey: expZone},
Segments: map[string]string{WellKnownZoneTopologyKey: expZone},
},
},
Preferred: []*csi.Topology{
{
Segments: map[string]string{
ZoneTopologyKey: expZone,
AwsAccountIDKey: outpostArn.AccountID,
AwsOutpostIDKey: outpostArn.Resource,
AwsRegionKey: outpostArn.Region,
AwsPartitionKey: outpostArn.Partition,
WellKnownZoneTopologyKey: expZone,
AwsAccountIDKey: outpostArn.AccountID,
AwsOutpostIDKey: outpostArn.Resource,
AwsRegionKey: outpostArn.Region,
AwsPartitionKey: outpostArn.Partition,
},
},
},
Expand All @@ -2108,11 +2108,11 @@ func TestGetOutpostArn(t *testing.T) {
Requisite: []*csi.Topology{
{
Segments: map[string]string{
ZoneTopologyKey: expZone,
AwsAccountIDKey: outpostArn.AccountID,
AwsOutpostIDKey: outpostArn.Resource,
AwsRegionKey: outpostArn.Region,
AwsPartitionKey: outpostArn.Partition,
WellKnownZoneTopologyKey: expZone,
AwsAccountIDKey: outpostArn.AccountID,
AwsOutpostIDKey: outpostArn.Resource,
AwsRegionKey: outpostArn.Region,
AwsPartitionKey: outpostArn.Partition,
},
},
},
Expand Down

0 comments on commit 8b70f71

Please sign in to comment.