-
Notifications
You must be signed in to change notification settings - Fork 38.6k
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
Add DataSource to PVC describe #76463
Add DataSource to PVC describe #76463
Conversation
/sig storage |
/hold |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle stale |
/hold cancel |
@@ -1519,6 +1519,11 @@ func describePersistentVolumeClaim(pvc *corev1.PersistentVolumeClaim, events *co | |||
if pvc.Spec.VolumeMode != nil { | |||
w.Write(LEVEL_0, "VolumeMode:\t%v\n", *pvc.Spec.VolumeMode) | |||
} | |||
if pvc.Spec.DataSource != nil { |
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.
can we add a unit test for this?
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.
Yup, added!
403f70e
to
a21a410
Compare
/retest |
/lgtm |
a21a410
to
5cc2ea7
Compare
same changes, rebased to the move to staging |
/retest |
/kind bug |
/lgtm |
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.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: j-griffith, mengqiy 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 |
/retestt |
/retest Review the full test history for this PR. Silence the bot with an |
3 similar comments
/retest Review the full test history for this PR. Silence the bot with an |
/retest Review the full test history for this PR. Silence the bot with an |
/retest Review the full test history for this PR. Silence the bot with an |
@@ -1534,6 +1534,11 @@ func describePersistentVolumeClaim(pvc *corev1.PersistentVolumeClaim, events *co | |||
if pvc.Spec.VolumeMode != nil { | |||
w.Write(LEVEL_0, "VolumeMode:\t%v\n", *pvc.Spec.VolumeMode) | |||
} | |||
if pvc.Spec.DataSource != nil { | |||
w.Write(LEVEL_0, "DataSource:\n") | |||
w.Write(LEVEL_1, "Name:\t%v\n", pvc.Spec.DataSource.Name) |
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 am confused why not print pvc.Spec.DataSource.APIGroup at the same time
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.
Yes, I think printing out api group makes sense too. Can you open a PR to add it? Right now, since only cloning is beta and on by default, then this can only be PVC type.
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.
Yes, I think printing out api group makes sense too. Can you open a PR to add it? Right now, since only cloning is beta and on by default, then this can only be PVC type.
Sure, I will open a pr.
…_pvc_describe Add DataSource to PVC describe Kubernetes-commit: 9dad928
/kind bug
What this PR does / why we need it:
This change adds non nil DataSource entries of a PVC to the
describe pvc
output. Currently there's no real way to know for sure if you submitted an invalid or unsupported DataSource Kind if it was accepted or not.For example, using the Hostpath driver, I can enter any info I want as DataSource Kind and Name and the volume is succesfully created/bound. Of course the info I supplied is filtered out, but I don't have any way of knowing that via the API.
In the case of valid entries (ie VolumeSnapshot and a supporting CSI Plugin) again there's no information after creation to make it clear to me that the PVC was in fact valid and created with the DataSource that I specified.
Which issue(s) this PR fixes:
Fixes #76460
Special notes for your reviewer:
Does this PR introduce a user-facing change?: