Skip to content

[API] Move KubeObject to api module - #4767

Merged
efiacor merged 8 commits into
kptdev:mainfrom
nokia:kubeobject-move
Sep 23, 2026
Merged

efiacor merged 8 commits into
kptdev:mainfrom
nokia:kubeobject-move

Conversation

@mozesl-nokia

Copy link
Copy Markdown
Contributor

This PR moves the KubeObject, kptfileko and other related types and parsing methods into the kpt api module from the SDK. With this move, we can break the dependency between the main kpt module and the SDK.

This means the following import changes will be necessary (only for the moved types):

  • github.com/kptdev/krm-functions-sdk/go/fn -> github.com/kptdev/kpt/api/kubeobject
  • github.com/kptdev/krm-functions-sdk/go/fn/kptfileko -> github.com/kptdev/kpt/api/kubeobject/kptfile

I've reorganised quite a bit of the files so that they are not as large as before, as well as fixing linting issues.

The fnresultv1.ResultItem type was parctically duplicated (once again) amongs the KubeObject types, this was deduplicated, meaning a breaking API change for the consumers of the SDK types. It should not affect yaml/json, only the go types.

There is this comment on ResourceList:

// ResourceList is a Kubernetes list type used as the primary data interchange format
// in the Configuration Functions Specification:
// https://github.com/kubernetes-sigs/kustomize/blob/master/cmd/config/docs/api-conventions/functions-spec.md
// This framework facilitates building functions that receive and emit ResourceLists,
// as required by the specification.

and I am fairly certain the deduplication did not break this, but we may want to check (if we still care about this, the comment is from 2022).

For reviewers: As this is a massive change wholesale, I suggest looking at the changes commit-by-commit to see what has actually changed besides just copy-pasting.

AI disclosure:

  • Cursor's Composer 2.5 and Grok 4.7 were used mainly for analysis and menial tasks, such as rewriting imports.

@netlify

netlify Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for kptdocs ready!

Name Link
🔨 Latest commit 6b1d242
🔍 Latest deploy log https://app.netlify.com/projects/kptdocs/deploys/6ab3d02d18f57b0008e9f757
😎 Deploy Preview https://deploy-preview-4767--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.

@mozesl-nokia mozesl-nokia added enhancement New feature or request cleanup go Pull requests that update Go code area/api labels Sep 22, 2026
Assisted-by: Cursor:composer-2.5
Signed-off-by: Mózes László Máté 
Assisted-by: Cursor:composer-2.5
Signed-off-by: Mózes László Máté 
… possible

Assisted-by: Cursor:grok-4.7
Signed-off-by: Mózes László Máté 
Assisted-by: Cursor:grok-4.7
Signed-off-by: Mózes László Máté 
Signed-off-by: Mózes László Máté 
Assisted-by: Cursor:grok-4.7
Signed-off-by: Mózes László Máté 
Signed-off-by: Mózes László Máté 
Comment thread api/kubeobject/node/format.go
Comment thread api/kubeobject/io.go
Comment thread api/kubeobject/object.go
Comment thread api/kubeobject/subobject.go

@liamfallon liamfallon 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.

Looks good, thanks @mozesl-nokia

@mozesl-nokia
mozesl-nokia requested review from a team September 23, 2026 07:53

@efiacor efiacor 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.

I think we should add the api/kubeobject dir to the sonar.sources
https://github.com/kptdev/kpt/blob/main/sonar.properties#L10
I know it creates an onus on you to create some coverage for the node module but if it's going public then we prob need it.

Comment thread api/fnresult/v1/types.go Outdated
…o sonar.properties

Signed-off-by: Mózes László Máté 
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
30.4% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@efiacor
efiacor merged commit 358e25b into kptdev:main Sep 23, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/api cleanup enhancement New feature or request go Pull requests that update Go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants