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

Generate clients #87

Merged
merged 11 commits into from
Mar 31, 2021
Merged

Generate clients #87

merged 11 commits into from
Mar 31, 2021

Conversation

vaikas
Copy link
Contributor

@vaikas vaikas commented Mar 26, 2021

This closes #

Note to reviewers: remember to look at the commits in this PR and consider if they can be squashed

Summary Of Changes

Add codegen generated clients so that these can be used from things like github.com/knative-sandbox/eventing-rabbitmq. While it seems like a lot of new code, it's all code generated. Also had to fix couple of tags / add methods in the api/v1alpha2 so the code-gen behaves properly.

Start of the usage can be seen here (by no means complete, just starting that work over there):

knative-extensions/eventing-rabbitmq#267

Additional Context

Copy link
Member

@MirahImage MirahImage left a comment

Choose a reason for hiding this comment

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

Does the script hack/update-codegen.sh need to be added to the make generate target?

@n3wscott
Copy link

Does the script hack/update-codegen.sh need to be added to the make generate target?

Does kubebuilder now encourage a Makefile? This has been seen as an anti-pattern in many projects, including Knative.

@vaikas
Copy link
Contributor Author

vaikas commented Mar 30, 2021

@MirahImage Thanks, PTAL. Added update-codegen.sh to make generate, and re-ran it to make sure it worked.

vaikas@villes-mbp messaging-topology-operator % make generate
go mod download
grep _ tools/tools.go | awk -F '"' '{print $2}' | xargs -t go install
go install github.com/elastic/crd-ref-docs github.com/onsi/ginkgo/ginkgo sigs.k8s.io/controller-tools/cmd/controller-gen sigs.k8s.io/kustomize/kustomize/v3
crd-ref-docs \
		--source-path ./api/v1alpha2 \
		--config ./docs/api/autogen/config.yaml \
		--templates-dir ./docs/api/autogen/templates \
		--output-path ./docs/api/rabbitmq.com.ref.asciidoc \
		--max-depth 30
2021-03-30T08:33:04.609-0700	INFO	crd-ref-docs	Loading configuration	{"path": "./docs/api/autogen/config.yaml"}
2021-03-30T08:33:04.609-0700	INFO	crd-ref-docs	Processing source directory	{"directory": "./api/v1alpha2", "depth": 30}
2021-03-30T08:33:05.149-0700	INFO	crd-ref-docs	Rendering output	{"path": "./docs/api/rabbitmq.com.ref.asciidoc"}
2021-03-30T08:33:05.153-0700	INFO	crd-ref-docs	CRD reference documentation generated
2021-03-30T08:33:05.153-0700	INFO	crd-ref-docs	Execution time: 543.754625ms
controller-gen object:headerFile="hack/NOTICE.go.txt" paths="./..."
./hack/update-codegen.sh
Generating clientset for rabbitmq.com:v1alpha2 at github.com/rabbitmq/messaging-topology-operator/pkg/generated/clientset
Generating listers for rabbitmq.com:v1alpha2 at github.com/rabbitmq/messaging-topology-operator/pkg/generated/listers
Generating informers for rabbitmq.com:v1alpha2 at github.com/rabbitmq/messaging-topology-operator/pkg/generated/informers

@MirahImage MirahImage merged commit 2ca4076 into rabbitmq:main Mar 31, 2021
@vaikas vaikas deleted the gen-clients branch March 31, 2021 15:10
gvmw added a commit that referenced this pull request Nov 10, 2021
This was introduced part of
#87, and in
the latest eventing-rabbitmq changes it became obvious that the versions
started to drift.

This discussion explains the problem best:
#256

This holds the rest of the context:
knative-extensions/eventing-rabbitmq#492 (comment)

This change lines up all versions, and the local unit & integration
tests pass. My next step is to check if CI remains green, and if the
change actually works in the context of eventing-rabbitmq, which is how
this started.

Signed-off-by: Gerhard Lazu <[email protected]>
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.

3 participants