Skip to content
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

manifests: generate clientset/listers/informers into pkg/client package #1164

Closed
wants to merge 1 commit into from

Conversation

kidlj
Copy link

@kidlj kidlj commented Jun 19, 2024

What changes were proposed in this pull request?

Add scripts to generate ElasticJob/ScalePlan clientset, listers and informers into pkg/client package.

Why are the changes needed?

We need the clientset to build ElasticJob, and it fix #93

Does this PR introduce any user-facing change?

Yes. Users can use generated clientset/listers/informers to build and consume ElasticJob and ScalePlan CRD now.

How was this patch tested?

No need.

NOTE

I'm using the latest version k8s.io/code-generator(0.30.2), which requires go1.22. So now go.mod looks like this:

module github.com/intelligent-machine-learning/easydl/dlrover/go/operator

go 1.22.0

toolchain go1.22.4

Please consider if this is applicable.

@kidlj
Copy link
Author

kidlj commented Jun 19, 2024

Sorry, this might not work. I replaced github.com/intelligent-machine-learning/easydl/dlrover/go/operator to github.com/kidlj/dlrover/dlrover/go/operator in the go.mod of my project, but it's not working. It seems that dlrover-operator should have its own GitHub repo and revision tags, and so import path.

replace (
	github.com/intelligent-machine-learning/easydl/dlrover/go/operator => github.com/kidlj/dlrover/dlrover/go/operator v0.3.8
)
go get github.com/intelligent-machine-learning/easydl/dlrover/go/operator
go: downloading github.com/kidlj/dlrover/dlrover/go/operator v0.3.8
go: github.com/intelligent-machine-learning/easydl/dlrover/go/operator: reading github.com/kidlj/dlrover/dlrover/go/operator/go.mod at revision dlrover/go/operator/v0.3.8: unknown revision dlrover/go/operator/v0.3.8

If I'm missing something, please correct me. Thanks.

@kidlj
Copy link
Author

kidlj commented Jun 19, 2024

The generated fake clientset is not compatible with k8s.io/client version. So I'm closing this PR.

@kidlj kidlj closed this Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generate informer, client and lister for new CRD
1 participant