Remove unnecessary conversion functions, vendor in whole group_version.go#4633
Open
mozesl-nokia wants to merge 3 commits into
Open
Remove unnecessary conversion functions, vendor in whole group_version.go#4633mozesl-nokia wants to merge 3 commits into
mozesl-nokia wants to merge 3 commits into
Conversation
Signed-off-by: Mózes László Máté <laszlo.mozes@nokia.com>
Signed-off-by: Mózes László Máté <laszlo.mozes@nokia.com>
Signed-off-by: Mózes László Máté <laszlo.mozes@nokia.com>
✅ Deploy Preview for kptdocs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR simplifies GroupVersionKind conversion usage by removing now-unnecessary helper functions, and completes vendoring of Kubernetes apimachinery’s group_version.go into api/schema/v1 while adding generated deepcopy support for the schema types.
Changes:
- Replace
kptfileutil.ToKptGVK(...)usage with direct type conversion toapi/schema/v1.GroupVersionKind. - Remove the unused
ToKptGVK/FromKptGVKhelper functions (file deleted). - Vendor in the full
group_version.goimplementation and add controller-gen generated deep-copies for the schema types.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| pkg/live/rgpath.go | Switch ResourceGroup GVK comparison to direct conversion into api/schema/v1. |
| pkg/kptfile/kptfileutil/gvk.go | Deletes no-longer-needed GVK conversion helpers. |
| api/schema/v1/zz_generated.deepcopy.go | Adds generated deepcopy methods for vendored schema types. |
| api/schema/v1/group_version.go | Vendors in the complete upstream group_version.go and adds generation markers. |
Files not reviewed (1)
- api/schema/v1/zz_generated.deepcopy.go: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When vendoring in part of apimachinery's group_version.go, I added 2 helper functions for conversion. These are unnecessary, as you can direct-cast between the types. These functions have been removed in this PR.
Additionally, now the entirity of group_version.go has been vendored in, because some essential things were still missing. I've also added deepcopy generation to these types.
No AI was used in the creation of this PR.