-
Notifications
You must be signed in to change notification settings - Fork 31
Use custom informer-gen that supports filters #79
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@munnerz The plan makes sense.
A quick thougt. Could we instead maintain a Jetstack fork of the code-generator and point dep
at that.
That's how I've seen this done in Python world.
Or is that going to be a massive pain with GOPATH?
Yeah that is what I hoped to do originally. It'd be nice if there were some way to do it, but doesn't seem like it. I've actually just run into a new problem, which is that dep wipes out the |
Hey @munnerz I just read: https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md#constraint
Found via the response to this comment: golang/dep#248 (comment) |
Thanks @wallrj! Missed that!! |
fc82a71
to
aa785c6
Compare
fb94235
to
171370d
Compare
171370d
to
c24c663
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -45,6 +45,8 @@ required = [ | |||
name = "k8s.io/apiserver" | |||
branch = "release-1.8" | |||
|
|||
# Use munnerz/code-generator fork that includes the filter changes | |||
[[constraint]] | |||
name = "k8s.io/code-generator" | |||
branch = "release-1.8" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❓ I was going to ask if this is the correct branch in your forked repo, but it looks like you've applied the changes there too: https://github.com/munnerz/code-generator/tree/release-1.8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep - otherwise there were more changes to generated files that were unrelated. Thought it best to make this 1:1
--input-dirs "k8s.io/api/apps/v1beta1" \ | ||
--versioned-clientset-package "k8s.io/client-go/kubernetes" \ | ||
--listers-package "k8s.io/client-go/listers" \ | ||
--output-package "github.com/jetstack/navigator/third_party/k8s.io/client-go/informers" \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❓ Are we still using the third_party
sub-directory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, but not with any vendor hacks this time (symlinks).
This is just a place to store the generated filter-able informers from the main k8s codebase.
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: munnerz, wallrj The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
Automatic merge from submit-queue. |
Automatic merge from submit-queue. Use filtered SharedInformerFactories in controller context **What this PR does / why we need it**: Switches to using the new filtered SharedInformerFactories as part of kubernetes/kubernetes#54660 **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes # fixes #69 **Special notes for your reviewer**: Don't merge until #79 has been merged **Release note**: ```release-note NONE ``` /assign @wallrj
This PR switches us to use
munnerz/code-generator
temporarily, which includes the changes in kubernetes/kubernetes#54660. I've then updated our codegen scripts to also generate informers for internal kubernetes types (although not a client or lister, as we can re-use client-go for this).I'm hoping my PR will be merged soon, at which point we can remove the alternate repo source, but for now this lets us clear up the mess that is our SharedInformerFactory.