-
Notifications
You must be signed in to change notification settings - Fork 159
Add metadata info in tag on PD #570
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: saad-ali The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/assign @msau42 |
default: | ||
return p, fmt.Errorf("parameters contains invalid option %q", k) | ||
} | ||
} | ||
if len(p.Tags) > 0 { | ||
p.Tags[tagKeyCreatedBy] = driverName |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to set this regardless?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to retain the existing behavior (description set to Regional disk created by GCE-PD CSI Driver
or Disk created by GCE-PD CSI Driver
depending on disk) if the PVC/PV parameters aren't present.
@@ -788,3 +817,18 @@ func removeCryptoKeyVersion(kmsKey string) string { | |||
} | |||
return kmsKey | |||
} | |||
|
|||
// encodeDiskTags encodes requested volume tags into JSON string, as GCE does | |||
// not support tags on GCE PDs and we use Description field as fallback. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about labels?
https://cloud.google.com/compute/docs/reference/rest/v1/disks/setLabels
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is another PR adding labels (#566). My plan is to merge this, and poke that PR to incorporate these as labels as well.
@@ -32,6 +32,7 @@ spec: | |||
- "--enable-leader-election" | |||
- "--leader-election-type=leases" | |||
- "--leader-election-namespace=$(PDCSI_NAMESPACE)" | |||
- "--extra-create-metadata" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to set this in staging overlays for now? This will update the "stable" overlay, which may cause stable deployments to fail since the older released drivers can't handle the new parameters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I'll move this to staging.
PTAL |
/lgtm |
What type of PR is this?
/kind feature
What this PR does / why we need it:
In-tree GCE PD "tags" a disk with information about which PVC/PV the disk was created for.
These tags are stored as JSON in the disk Description field.
This PR archives feature-parity with that behavior using kubernetes-csi/external-provisioner#399
Added automated tests and did manual tests to verify new behavior:
Example disk Description field provisioned by in-tree GCE PD plugin:
Example disk Description field provisioned by GCE PD CSI Driver with this change:
Which issue(s) this PR fixes:
Fixes #387
Special notes for your reviewer:
Does this PR introduce a user-facing change?: