Repository: kubernetes-sigs/aws-ebs-csi-driver
Pull request #912 (2021-05-31 16:31:42)

remove WellKnownTopologyKey from PV Topology
**Is this a bug fix or adding new feature?**
bug fix
**What is this PR about? / Why do we need it?**
fixes https://github.com/kubernetes/kubernetes/issues/102248
**What testing is done?** 
modified testing and verified

k8s-ci-robot: [APPROVALNOTIFIER] This PR is **NOT APPROVED**

This pull-request has been approved by: *<a href="https://github.com/kubernetes-sigs/aws-ebs-csi-driver/pull/912#" title="Author self-approved">Elbehery</a>*
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign **jsafrane** after the PR has been reviewed.
You can assign the PR to them by writing `/assign @jsafrane` in a comment when ready.

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=kubernetes-sigs%2Faws-ebs-csi-driver).

<details open>
Needs approval from an approver in each of these files:

- **[OWNERS](https://github.com/kubernetes-sigs/aws-ebs-csi-driver/blob/master/OWNERS)**

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":["jsafrane"]} -->
k8s-ci-robot: Hi @Elbehery. Thanks for your PR.

I'm waiting for a [kubernetes-sigs](https://github.com/orgs/kubernetes-sigs/people) member to verify that this patch is reasonable to test. If it is, they should reply with `/ok-to-test` on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should [join the org](https://git.k8s.io/community/community-membership.md#member) to skip this step.

Once the patch is verified, the new status will be reflected by the `ok-to-test` label.

I understand the commands that are listed [here](https://go.k8s.io/bot-commands?repo=kubernetes-sigs%2Faws-ebs-csi-driver).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
</details>

k8s-ci-robot: Welcome @Elbehery! <br><br>It looks like this is your first PR to <a href='https://github.com/kubernetes-sigs/aws-ebs-csi-driver'>kubernetes-sigs/aws-ebs-csi-driver</a> 🎉. Please refer to our [pull request process documentation](https://git.k8s.io/community/contributors/guide/pull-requests.md) to help your PR have a smooth ride to approval. <br><br>You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. [Here is the bot commands documentation](https://go.k8s.io/bot-commands). <br><br>You can also check if kubernetes-sigs/aws-ebs-csi-driver has [its own contribution guidelines](https://github.com/kubernetes-sigs/aws-ebs-csi-driver/tree/master/CONTRIBUTING.md). <br><br>You may want to refer to our [testing guide](https://git.k8s.io/community/contributors/devel/sig-testing/testing.md) if you run into trouble with your tests not passing. <br><br>If you are having difficulty getting your pull request seen, please follow the [recommended escalation practices](https://github.com/kubernetes/community/blob/master/contributors/guide/pull-requests.md#why-is-my-pull-request-not-getting-reviewed). Also, for tips and tricks in the contribution process you may want to read the [Kubernetes contributor cheat sheet](https://git.k8s.io/community/contributors/guide/contributor-cheatsheet/README.md). We want to make sure your contribution gets all the attention it needs! <br><br>Thank you, and welcome to Kubernetes. :smiley:
Elbehery: @jsafrane 
coveralls: ## Pull Request Test Coverage Report for [Build 2006](https://coveralls.io/builds/40177465)

* **1** of **1**   **(100.0%)**  changed or added relevant line in **1** file are covered.
* No unchanged relevant lines lost coverage.
* Overall coverage decreased (**-0.008%**) to **79.117%**

---



|  Totals | [![Coverage Status](https://coveralls.io/builds/40177465/badge)](https://coveralls.io/builds/40177465) |
| :-- | --: |
| Change from base [Build 2000](https://coveralls.io/builds/40065102): |  -0.008% |
| Covered Lines: | 1989 |
| Relevant Lines: | 2514 |

---
##### 💛  - [Coveralls](https://coveralls.io)

jsafrane: /ok-to-test
k8s-ci-robot: @Elbehery: The following test **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
pull-aws-ebs-csi-driver-verify | 27add9f3ba1f08af971c577d72b32a2c9af90c8b | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_aws-ebs-csi-driver/912/pull-aws-ebs-csi-driver-verify/1399635136638619648) | `/test pull-aws-ebs-csi-driver-verify`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes-sigs&repo=aws-ebs-csi-driver&pr=912). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3AElbehery). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes-sigs/aws-ebs-csi-driver/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->

Patch:
diff --git a/charts/aws-ebs-csi-driver/Chart.yaml b/charts/aws-ebs-csi-driver/Chart.yaml
index 5897f3ba..e8c7bc68 100644
--- a/charts/aws-ebs-csi-driver/Chart.yaml
+++ b/charts/aws-ebs-csi-driver/Chart.yaml
@@ -2,7 +2,7 @@ apiVersion: v1
 appVersion: "1.0.0"
 name: aws-ebs-csi-driver
 description: A Helm chart for AWS EBS CSI Driver
-version: 1.2.0
+version: 1.1.0
 kubeVersion: ">=1.17.0-0"
 home: https://github.com/kubernetes-sigs/aws-ebs-csi-driver
 sources:
diff --git a/charts/aws-ebs-csi-driver/templates/controller.yaml b/charts/aws-ebs-csi-driver/templates/controller.yaml
index 1ba9c15c..cde886f3 100644
--- a/charts/aws-ebs-csi-driver/templates/controller.yaml
+++ b/charts/aws-ebs-csi-driver/templates/controller.yaml
@@ -16,9 +16,6 @@ spec:
       labels:
         app: ebs-csi-controller
         {{- include "aws-ebs-csi-driver.labels" . | nindent 8 }}
-        {{- if .Values.controller.podLabels }}
-        {{- toYaml .Values.controller.podlabels | nindent 8 }}
-        {{- end }}
       {{- if .Values.controller.podAnnotations }}
       annotations:
         {{- toYaml .Values.controller.podAnnotations | nindent 8 }}
diff --git a/charts/aws-ebs-csi-driver/templates/node.yaml b/charts/aws-ebs-csi-driver/templates/node.yaml
index 2546bf5d..5ecb9305 100644
--- a/charts/aws-ebs-csi-driver/templates/node.yaml
+++ b/charts/aws-ebs-csi-driver/templates/node.yaml
@@ -15,9 +15,6 @@ spec:
       labels:
         app: ebs-csi-node
         {{- include "aws-ebs-csi-driver.labels" . | nindent 8 }}
-        {{- if .Values.node.podLabels }}
-        {{- toYaml .Values.node.podlabels | nindent 8 }}
-        {{- end }}
       {{- with .Values.node.podAnnotations }}
       annotations:
         {{- toYaml . | nindent 8 }}
diff --git a/charts/aws-ebs-csi-driver/templates/snapshot-controller.yaml b/charts/aws-ebs-csi-driver/templates/snapshot-controller.yaml
index 54312224..82ada816 100644
--- a/charts/aws-ebs-csi-driver/templates/snapshot-controller.yaml
+++ b/charts/aws-ebs-csi-driver/templates/snapshot-controller.yaml
@@ -18,9 +18,6 @@ spec:
       labels:
         app: ebs-snapshot-controller
         {{- include "aws-ebs-csi-driver.labels" . | nindent 8 }}
-        {{- if .Values.snapshotController.podLabels }}
-        {{- toYaml .Values.snapshotController.podlabels | nindent 8 }}
-        {{- end }}
     spec:
       serviceAccountName: {{ .Values.serviceAccount.snapshot.name }}
       nodeSelector:
diff --git a/charts/aws-ebs-csi-driver/values.yaml b/charts/aws-ebs-csi-driver/values.yaml
index fccc0fa2..a6cac89f 100644
--- a/charts/aws-ebs-csi-driver/values.yaml
+++ b/charts/aws-ebs-csi-driver/values.yaml
@@ -30,7 +30,6 @@ sidecars:
 snapshotController:
   repository: k8s.gcr.io/sig-storage/snapshot-controller
   tag: "v3.0.3"
-  podLabels: {}
 
 proxy:
   http_proxy:
@@ -81,7 +80,6 @@ controller:
   k8sTagClusterId:
   nodeSelector: {}
   podAnnotations: {}
-  podLabels: {}
   priorityClassName:
   # AWS region to use. If not specified then the region will be looked up via the AWS EC2 metadata
   # service.
@@ -136,7 +134,6 @@ node:
   priorityClassName:
   nodeSelector: {}
   podAnnotations: {}
-  podLabels: {}
   tolerateAllTaints: false
   tolerations: []
   resources: {}
diff --git a/pkg/driver/controller.go b/pkg/driver/controller.go
index ed6bed69..59fc1331 100644
--- a/pkg/driver/controller.go
+++ b/pkg/driver/controller.go
@@ -655,7 +655,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)
 
diff --git a/pkg/driver/node.go b/pkg/driver/node.go
index 46dd519e..bb8e7281 100644
--- a/pkg/driver/node.go
+++ b/pkg/driver/node.go
@@ -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()


Test patch:
diff --git a/pkg/driver/controller_test.go b/pkg/driver/controller_test.go
index 7fb380fc..84d78db1 100644
--- a/pkg/driver/controller_test.go
+++ b/pkg/driver/controller_test.go
@@ -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,
 							},
 						},
 					},
@@ -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},
 						},
 					},
 				}
diff --git a/pkg/driver/node_test.go b/pkg/driver/node_test.go
index f1e16ea8..20bf8c48 100644
--- a/pkg/driver/node_test.go
+++ b/pkg/driver/node_test.go
@@ -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])