k3s/pkg
Kubernetes Submit Queue bab312dbcf
Merge pull request #54660 from munnerz/namespaced-informer-factory
Automatic merge from submit-queue (batch tested with PRs 55403, 54660, 55165). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

code-generator: add NewFilteredSharedInformerFactory function

**What this PR does / why we need it**:

Adds a `namespace` option to the SharedInformerFactory constructor. This is useful when building controllers that may need to scope themselves to a namespace due to RBAC constraints.

Workarounds for this involve losing type safety if a user wants to use it for core APIs as well as a SharedInformerFactory type interface, as we have to deal with plain SharedIndexInformers (example here: https://github.com/jetstack-experimental/cert-manager/blob/master/pkg/util/kube/factory.go)

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

Fixes https://github.com/kubernetes/code-generator/issues/9

**Special notes for your reviewer**:

This will require updating all uses of SharedInformerFactory throughout the codebase. I'm going to follow up with later commits in this PR with these changes, but wanted to get this here to get some feedback on the way it's implemented.

**Release note**:

```release-note
NONE
```

/cc @sttts @nikhita @deads2k
2017-11-09 10:15:13 -08:00
..
api Update generated files 2017-11-09 12:14:08 +01:00
apimachinery/tests
apis Update generated files 2017-11-09 12:14:08 +01:00
auth move authorizers over to new interface 2017-11-03 13:46:28 -07:00
bootstrap/api
capabilities
client run hack/update-bazel.sh 2017-11-09 15:12:09 +00:00
cloudprovider Update generated files 2017-11-09 12:14:08 +01:00
controller Update generated files 2017-11-09 12:14:08 +01:00
credentialprovider
features wqFlag gate node exclusion for service load balancers. 2017-10-28 03:44:46 +00:00
fieldpath
generated auto generated files 2017-11-04 11:38:57 +08:00
hyperkube
kubeapiserver Update generated files 2017-11-09 12:14:08 +01:00
kubectl Merge pull request #55162 from deads2k/cli-06-tolerate-error 2017-11-09 08:36:44 -08:00
kubelet Update generated files 2017-11-09 12:14:08 +01:00
kubemark Update generated files 2017-11-09 12:14:08 +01:00
master Update generated files 2017-11-09 12:14:08 +01:00
printers Update generated files 2017-11-09 12:14:08 +01:00
probe
proxy Update generated files 2017-11-09 12:14:08 +01:00
quota Update generated files 2017-11-09 12:14:08 +01:00
registry Update generated files 2017-11-09 12:14:08 +01:00
routes
security Update generated files 2017-11-09 12:14:08 +01:00
securitycontext Update generated files 2017-11-09 12:14:08 +01:00
serviceaccount Update generated files 2017-11-09 12:14:08 +01:00
ssh
util Update generated files 2017-11-09 12:14:08 +01:00
version
volume Update generated files 2017-11-09 12:14:08 +01:00
watch
.import-restrictions
BUILD Update generated files 2017-11-09 12:14:08 +01:00
OWNERS