Skip to content

Remove unnecessary conversion functions, vendor in whole group_version.go#4633

Open
mozesl-nokia wants to merge 3 commits into
kptdev:mainfrom
nokia:remove-conversion
Open

Remove unnecessary conversion functions, vendor in whole group_version.go#4633
mozesl-nokia wants to merge 3 commits into
kptdev:mainfrom
nokia:remove-conversion

Conversation

@mozesl-nokia

Copy link
Copy Markdown
Contributor

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.

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>
@mozesl-nokia mozesl-nokia requested review from a team July 10, 2026 09:08
@mozesl-nokia mozesl-nokia added go Pull requests that update Go code area/api labels Jul 10, 2026
@netlify

netlify Bot commented Jul 10, 2026

Copy link
Copy Markdown

Deploy Preview for kptdocs ready!

Name Link
🔨 Latest commit cfaece5
🔍 Latest deploy log https://app.netlify.com/projects/kptdocs/deploys/6a50b67ac690ee00086657d8
😎 Deploy Preview https://deploy-preview-4633--kptdocs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jul 10, 2026
@mozesl-nokia mozesl-nokia requested a review from Copilot July 10, 2026 09:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 to api/schema/v1.GroupVersionKind.
  • Remove the unused ToKptGVK / FromKptGVK helper functions (file deleted).
  • Vendor in the full group_version.go implementation 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.

Comment thread api/schema/v1/zz_generated.deepcopy.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/api go Pull requests that update Go code size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants