-
Notifications
You must be signed in to change notification settings - Fork 377
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
Update CRDs to include additional get information #256
Conversation
Welcome @huffmanca! |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: huffmanca The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hi @huffmanca. Thanks for your PR. I'm waiting for a kubernetes-csi member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Thanks for the PR! Did you add anything to types.go and generate this automatically? Please update README to describe how to generate CRDs with this additional info. |
/ok-to-test |
b76b4ef
to
eb923ed
Compare
Apologies.
|
For us, mere mortals who don't read CRD YAML files nor kubebuilder tags, can you please add example output of |
eb923ed
to
dd2e943
Compare
Sample output:
|
name: PVCClaim | ||
type: string | ||
- JSONPath: .spec.source.volumeSnapshotContentName | ||
description: The VolumeSnapshotContent from where a snapshot will be created. | ||
name: SnapshotClaim |
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.
PVCClaim / SnapshotClaim sounds strange. What about SourcePVC and SourceSnapshotContent?
In addition, do we need volumeSnapshotContentName
in kubectl get
? IMO, the number of pre-provisioned snapshots is going to be much smaller than number of dynamically provisioned ones. We can leave PVCClaim (SourcePVC) empty, indicating that this one is special, user will see status.boundVolumeSnapshotContentName
anyway and if not, they can do kubectl describe
to get the details.
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.
SourcePVC and SourceSnapshotContent sounds good.
Pre-provisioned snapshots is often used in backup and restore use cases so it is important to show volumeSnapshotContentName in the source, which has a different meaning from status.boundVolumeSnapshotContentName.
If there's a way to dynamically display only one of SourcePVC and SourceSnapshotContent depending on which one is not nil, that will be great. I don't know if it is possible to do that using printerColumns.
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.
It's probably more important to show the status content name since we expect them to be the same in valid cases
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.
The source field will never be nil. Can we have a "VolumeSnapshotSource" field which is either PVC or content name and have a "SourceType" field that indicates whether it is PVC name or content 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've updated the column names to be SourcePVC
and SouceSnapshotContent
to be clearer.
If there's a way to dynamically display only one of SourcePVC and SourceSnapshotContent depending on which one is not nil, that will be great. I don't know if it is possible to do that using printerColumns.
Looking at https://book.kubebuilder.io/reference/markers/crd.html I don't see way to include conditionals when using printcolumn
.
The source field will never be nil. Can we have a "VolumeSnapshotSource" field which is either PVC or content name and have a "SourceType" field that indicates whether it is PVC name or content name?
I'm assuming this would require a code change? I don't think this is possible currently from modifying types.go
.
It's probably more important to show the status content name since we expect them to be the same in valid cases
Don't we do this presently in the PR?
// +kubebuilder:printcolumn:name="SnapshotContent",type=string,JSONPath=`.status.boundVolumeSnapshotContentName`,description="The name of the VolumeSnapshotContent to which this VolumeSnapshot is bound."
dd2e943
to
c3de1b1
Compare
Since types.go is modified, should https://github.com/kubernetes-csi/external-snapshotter/blob/master/hack/update-generated-code.sh be called again to re-generate code? Note that this is getting complicated after we added v2 to the package path. See details here: #239 (comment) |
c3de1b1
to
96b7270
Compare
The following users are mentioned in OWNERS file(s) but are not members of the kubernetes-csi org. Once all users have been added as members of the org, you can trigger verification by writing
|
96b7270
to
c3de1b1
Compare
c3de1b1
to
c4b7ebb
Compare
Getting a "invalid-owners-file" label. |
The invalid owners should be corrected. It was an issue when attempting to rebase. I attempted to run the instructions in the #239 (comment) , but it doesn't generate anything under I'm working through these to see if I can generate this in a separate commit. |
I've reset the head of this branch to master and attempted following the instructions in the link, but nothing is generated. The commands complete without error, but there's nothing new created under Do these steps need to be performed for the master branch as well as the 2.x ones? |
@huffmanca you should only need to run it on master. Maybe it's because you didn't change the API itself, so there's no changes in the generated files. I'll give a try myself to make sure. |
The "invalid-owners-file" issue needs to be resolved though, otherwise this can't be merged. Maybe you need a rebase. |
/verify-owners |
I tried and all files under pkg/client are re-generated, however, the only change is the year.
So I think we don't need to do this code generation in this PR. We can do it later when there are more changes. |
c4b7ebb
to
ddd22a1
Compare
I think this is ready to go. In regards to the invalid owners - the owners file should be correct (it was modified by the rebase, but has since been reset to the original file), and it seems the Any advice on how to correct this label? |
@@ -4,19 +4,32 @@ apiVersion: apiextensions.k8s.io/v1beta1 | |||
kind: CustomResourceDefinition | |||
metadata: | |||
annotations: | |||
controller-gen.kubebuilder.io/version: (devel) | |||
api-approved.kubernetes.io: "https://github.com/kubernetes-csi/external-snapshotter/pull/139" | |||
controller-gen.kubebuilder.io/version: v0.2.4 |
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 see that the latest release is v0.2.5, which was released 23 days ago. Is there any reason not to use the latest release?
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's not - This was the automatically generated version. I've updated this to be 0.2.5 in all the CRDs.
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.
Did you manually update them to 0.2.5? I think it is the version of controller-gen you installed on your system. Can you update controller-gen on your system to be 0.2.5 and have this generated automatically?
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 you answer my question?
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 did manually update it - to my knowledge, I haven't built controller-gen on my system. I can see it in my gopath modules, though, and am attempting to update it before re-creating the CRDs.
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 you have kubebuilder installed?
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 haven't installed or used it before.
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 tool are you using to generate the CRDs?
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'd been using hack/update-crd
. Checking this now I see:
go get sigs.k8s.io/controller-tools/cmd/[email protected];
Looks the repo defaults to v0.2.4 if controller-gen isn't detected. Let me update this and push again this evening.
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.
That makes sense. Thanks.
Can you change the release note to the following: |
ddd22a1
to
b3e3687
Compare
I've updated the release notes text. Now we just need to clear the |
To get the owners file issue resolved, maybe you need to submit a new PR with a new repo? I don't know if there's a better way. |
b3e3687
to
e1cb0d2
Compare
@huffmanca: PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@huffmanca: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
I'm going to close this PR out in favor of #260 . PR 260 should include the rebase, not adjust the owners file, and have the |
Instruction update
f40f0cc Merge pull request kubernetes-csi#256 from solumath/master cfa9210 Instruction update 379a1bb Merge pull request kubernetes-csi#255 from humblec/sidecar-md a5667bb fix typo in sidecar release process 4967685 Merge pull request kubernetes-csi#254 from bells17/add-github-actions d9bd160 Update skip list in codespell GitHub Action f5aebfc Add GitHub Actions workflows git-subtree-dir: release-tools git-subtree-split: f40f0cc
988496a1f Merge pull request kubernetes-csi#257 from jakobmoellerdev/csi-prow-sidecar-e2e-path 028f8c698 chore: bump to Go 1.22.5 69bd71e8a chore: add CSI_PROW_SIDECAR_E2E_PATH f40f0cc Merge pull request kubernetes-csi#256 from solumath/master cfa9210 Instruction update 379a1bb Merge pull request kubernetes-csi#255 from humblec/sidecar-md a5667bb fix typo in sidecar release process 4967685 Merge pull request kubernetes-csi#254 from bells17/add-github-actions d9bd160 Update skip list in codespell GitHub Action f5aebfc Add GitHub Actions workflows git-subtree-dir: release-tools git-subtree-split: 988496a1fc3849ed793e03012fdd56813d13d46c
What type of PR is this?
What this PR does / why we need it:
Includes additional information for the
get
command for the VolumeSnapshot* CRDs.Which issue(s) this PR fixes:
Fixes #247
Special notes for your reviewer:
Does this PR introduce a user-facing change?: