Skip to content

Commit

Permalink
Merge pull request #912 from Elbehery/removing_k8s_duplicate_topology…
Browse files Browse the repository at this point in the history
…_label

remove WellKnownTopologyKey from PV Topology
  • Loading branch information
wongma7 authored Jun 3, 2021
2 parents a2a1b1f + 1dd799b commit f678406
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 13 deletions.
2 changes: 1 addition & 1 deletion pkg/driver/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ func newCreateVolumeResponse(disk *cloud.Disk) *csi.CreateVolumeResponse {
}
}

segments := map[string]string{TopologyKey: disk.AvailabilityZone, WellKnownTopologyKey: disk.AvailabilityZone}
segments := map[string]string{TopologyKey: disk.AvailabilityZone}

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

Expand Down
13 changes: 6 additions & 7 deletions pkg/driver/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,11 @@ func TestCreateVolume(t *testing.T) {
AccessibleTopology: []*csi.Topology{
{
Segments: map[string]string{
TopologyKey: expZone,
WellKnownTopologyKey: expZone,
AwsAccountIDKey: outpostArn.AccountID,
AwsOutpostIDKey: outpostArn.Resource,
AwsRegionKey: outpostArn.Region,
AwsPartitionKey: outpostArn.Partition,
TopologyKey: expZone,
AwsAccountIDKey: outpostArn.AccountID,
AwsOutpostIDKey: outpostArn.Resource,
AwsRegionKey: outpostArn.Region,
AwsPartitionKey: outpostArn.Partition,
},
},
},
Expand Down Expand Up @@ -1231,7 +1230,7 @@ func TestCreateVolume(t *testing.T) {
VolumeContext: map[string]string{},
AccessibleTopology: []*csi.Topology{
{
Segments: map[string]string{TopologyKey: expZone, WellKnownTopologyKey: expZone},
Segments: map[string]string{TopologyKey: expZone},
},
},
}
Expand Down
3 changes: 1 addition & 2 deletions pkg/driver/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -516,8 +516,7 @@ func (d *nodeService) NodeGetInfo(ctx context.Context, req *csi.NodeGetInfoReque
zone := d.metadata.GetAvailabilityZone()

segments := map[string]string{
TopologyKey: zone,
WellKnownTopologyKey: zone,
TopologyKey: zone,
}

outpostArn := d.metadata.GetOutpostArn()
Expand Down
3 changes: 0 additions & 3 deletions pkg/driver/node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1654,9 +1654,6 @@ func TestNodeGetInfo(t *testing.T) {
if at.Segments[TopologyKey] != tc.availabilityZone {
t.Fatalf("Expected topology %q, got %q", tc.availabilityZone, at.Segments[TopologyKey])
}
if at.Segments[WellKnownTopologyKey] != tc.availabilityZone {
t.Fatalf("Expected well-known topology %q, got %q", tc.availabilityZone, at.Segments[WellKnownTopologyKey])
}

if at.Segments[AwsAccountIDKey] != tc.outpostArn.AccountID {
t.Fatalf("Expected AwsAccountId %q, got %q", tc.outpostArn.AccountID, at.Segments[AwsAccountIDKey])
Expand Down

0 comments on commit f678406

Please sign in to comment.