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

Rework the way eventing-autoscaler-keda does KEDA codegen #171

Merged
merged 1 commit into from
Aug 17, 2021

Conversation

mattmoor
Copy link
Contributor

@mattmoor mattmoor commented Aug 17, 2021

Today we rerun codegen for the KEDA clients to get injection, but because they use kubebuilder their layout is a bit strange. There's a hack to temporarily copy the api types into the right structure, and then undo it, which is a bit fragile (if codegen references that package, then it won't build!). We also try to contort so that we can use their existing client/informer/lister codegen, which isn't really necessary.

With this change, we instead permanently copy the types into a suitable structure under third_party/pkg/apis and generate all of the clients we need under third_party/pkg/client. This is a slight superset of what Istio and Contour are already doing (we don't need to copy those types), and feels a bit simpler (and less fragile) than what we are currently doing.

/kind cleanup
/assign @n3wscott

Ref (same for rabbitmq): knative-extensions/eventing-rabbitmq#378

Release Note


Docs


@knative-prow-robot knative-prow-robot added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Aug 17, 2021
@google-cla google-cla bot added the cla: yes Indicates the PR's author has signed the CLA. label Aug 17, 2021
@knative-prow-robot knative-prow-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Aug 17, 2021
Today we rerun codegen for the Rabbit clients to get injection, but because they use kubebuilder their layout is a bit strange. There's a hack to temporarily copy the api types into the right structure, and then undo it, which is a bit fragile (if codegen references that package, then it won't build!). We also try to contort so that we can use their existing client/informer/lister codegen, which isn't really necessary.

With this change, we instead permanently copy the types into a suitable structure under third_party/pkg/apis and generate all of the clients we need under third_party/pkg/client. This is a slight superset of what Istio and Contour are already doing (we don't need to copy those types), and feels a bit simpler (and less fragile) than what we are currently doing.

/kind cleanup

Ref (same for rabbitmq): knative-extensions/eventing-rabbitmq#378
@n3wscott
Copy link

/lgtm
/approve

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 17, 2021
@knative-prow-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mattmoor, n3wscott

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

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 17, 2021
@knative-prow-robot knative-prow-robot merged commit 2dc9ad3 into knative-extensions:main Aug 17, 2021
@mattmoor mattmoor deleted the rework-codegen branch August 17, 2021 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cla: yes Indicates the PR's author has signed the CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants