Skip to content

Commit

Permalink
Report zone via well-known topology key in NodeGetInfo
Browse files Browse the repository at this point in the history
Signed-off-by: Connor Catlett <conncatl@amazon.com>
  • Loading branch information
ConnorJC3 committed Feb 14, 2024
1 parent 56a4ff6 commit ae753df
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/driver/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,8 @@ func (d *nodeService) NodeGetInfo(ctx context.Context, req *csi.NodeGetInfoReque
zone := d.metadata.GetAvailabilityZone()

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

outpostArn := d.metadata.GetOutpostArn()
Expand Down
3 changes: 3 additions & 0 deletions pkg/driver/node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2331,6 +2331,9 @@ 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 ae753df

Please sign in to comment.