Skip to content

Conversation

jbhalodia-slack
Copy link
Contributor

@jbhalodia-slack jbhalodia-slack commented Jun 19, 2025

Purpose of this PR

Use kubernetes/code-generator tool to generate clientset, informers, and listers. These are used by the community to build tools that interface with SparkApplication resources. We're planning to open source a project that heavily depends on these packages.

Proposed changes:

  • Add hack/update-codegen.sh and hack/verify-codegen.sh to use code-generator's kube_codegen.sh
  • Add a placeholder api/v1beta2/types.go file, its required by code-generator
  • Add +k8s:deepcopy-gen and +genclient tags to properly generate client-go packages
  • Run hack/update-codegen.sh to generate packages in pkg/client
  • Update Makefile and Github Actions to run hack/verify-codegen.sh
  • Run make generate, make build-api-docs, and make go-fmt

Change Category

  • Bugfix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that could affect existing functionality)
  • Documentation update

Rationale

Checklist

  • I have conducted a self-review of my own code.
  • I have updated documentation accordingly.
  • I have added tests that prove my changes are effective or that my feature works.
  • Existing unit tests pass locally with my changes.

Additional Notes

@google-oss-prow google-oss-prow bot requested review from ImpSy and nabuskey June 19, 2025 03:50
Signed-off-by: jbhalodia-slack <[email protected]>
Signed-off-by: jbhalodia-slack <[email protected]>
Signed-off-by: jbhalodia-slack <[email protected]>
Signed-off-by: jbhalodia-slack <[email protected]>
Signed-off-by: jbhalodia-slack <[email protected]>
Signed-off-by: jbhalodia-slack <[email protected]>
Signed-off-by: jbhalodia-slack <[email protected]>
Signed-off-by: jbhalodia-slack <[email protected]>
Signed-off-by: jbhalodia-slack <[email protected]>
Signed-off-by: jbhalodia-slack <[email protected]>
@jbhalodia-slack jbhalodia-slack changed the title Use code-generator for clientset, informer, lister Use code-generator for clientset, informers, listers Jun 19, 2025
@jbhalodia-slack jbhalodia-slack force-pushed the setup-code-generator-for-client-code branch from 8d2ee0d to 46b994b Compare June 19, 2025 13:20
Signed-off-by: jbhalodia-slack <[email protected]>
@ChenYi015
Copy link
Member

@jbhalodia-slack Thanks for the contribution!
/lgtm
/approve

Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ChenYi015

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow google-oss-prow bot merged commit ca11a8f into kubeflow:master Jun 19, 2025
15 checks passed
ChenYi015 pushed a commit to ChenYi015/spark-operator that referenced this pull request Jun 25, 2025
* Use code-generator to for clientset, informer, lister

Signed-off-by: jbhalodia-slack <[email protected]>

* Add README in hack/ for code-generator

Signed-off-by: jbhalodia-slack <[email protected]>

* Run verify-codegen.sh in tests

Signed-off-by: jbhalodia-slack <[email protected]>

* make generate

Signed-off-by: jbhalodia-slack <[email protected]>

* make build-api-docs

Signed-off-by: jbhalodia-slack <[email protected]>

* update makefile

Signed-off-by: jbhalodia-slack <[email protected]>

* update makefile

Signed-off-by: jbhalodia-slack <[email protected]>

* make go-fmt

Signed-off-by: jbhalodia-slack <[email protected]>

* make generate

Signed-off-by: jbhalodia-slack <[email protected]>

* run tests

Signed-off-by: jbhalodia-slack <[email protected]>

* Remove deepcopy-gen since its conflicting with controller-gen

Signed-off-by: jbhalodia-slack <[email protected]>

* Revert some changes

Signed-off-by: jbhalodia-slack <[email protected]>

* Generate packages in pkg/client/

Signed-off-by: jbhalodia-slack <[email protected]>

* Update year to 2025 in boilerplate.go.txt

Signed-off-by: jbhalodia-slack <[email protected]>

* Update year to 2025 in types.go

Signed-off-by: jbhalodia-slack <[email protected]>

---------

Signed-off-by: jbhalodia-slack <[email protected]>
(cherry picked from commit ca11a8f)
@ChenYi015 ChenYi015 mentioned this pull request Jun 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants