bump knative.dev/pkg (#94)

changes to knative.dev/pkg modify the generated injection code
This commit is contained in:
Dave Protasowski 2019-09-09 17:08:11 -04:00 committed by Knative Prow Robot
parent 81f2ca0e6e
commit 20b5480da3
103 changed files with 1710 additions and 545 deletions

4
Gopkg.lock generated
View File

@ -927,7 +927,7 @@
[[projects]]
branch = "master"
digest = "1:38226cb742766a4f78effcbbae38ce0c83ff696529553356c908467a1871fdd8"
digest = "1:0dca180a6449f2cd457f8efea003336352c5a412212fce072cad9661d5a71b61"
name = "knative.dev/pkg"
packages = [
"apis",
@ -946,7 +946,7 @@
"metrics/metricskey",
]
pruneopts = "T"
revision = "5f0515d33675c298c4054ac52268700bae3ceaa7"
revision = "528ad1c1dd627059b95aef17ccf27f9ab0f46c10"
[[projects]]
branch = "master"

View File

@ -42,8 +42,8 @@ func withClient(ctx context.Context, cfg *rest.Config) context.Context {
func Get(ctx context.Context) versioned.Interface {
untyped := ctx.Value(Key{})
if untyped == nil {
logging.FromContext(ctx).Fatalf(
"Unable to fetch %T from context.", (versioned.Interface)(nil))
logging.FromContext(ctx).Panic(
"Unable to fetch knative.dev/caching/pkg/client/clientset/versioned.Interface from context.")
}
return untyped.(versioned.Interface)
}

View File

@ -47,8 +47,8 @@ func With(ctx context.Context, objects ...runtime.Object) (context.Context, *fak
func Get(ctx context.Context) *fake.Clientset {
untyped := ctx.Value(client.Key{})
if untyped == nil {
logging.FromContext(ctx).Fatalf(
"Unable to fetch %T from context.", (*fake.Clientset)(nil))
logging.FromContext(ctx).Panic(
"Unable to fetch knative.dev/caching/pkg/client/clientset/versioned/fake.Clientset from context.")
}
return untyped.(*fake.Clientset)
}

View File

@ -21,8 +21,8 @@ package fake
import (
"context"
fake "knative.dev/caching/pkg/client/injection/informers/caching/factory/fake"
image "knative.dev/caching/pkg/client/injection/informers/caching/v1alpha1/image"
fake "knative.dev/caching/pkg/client/injection/informers/factory/fake"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
)

View File

@ -22,7 +22,7 @@ import (
"context"
v1alpha1 "knative.dev/caching/pkg/client/informers/externalversions/caching/v1alpha1"
factory "knative.dev/caching/pkg/client/injection/informers/caching/factory"
factory "knative.dev/caching/pkg/client/injection/informers/factory"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
logging "knative.dev/pkg/logging"
@ -45,8 +45,8 @@ func withInformer(ctx context.Context) (context.Context, controller.Informer) {
func Get(ctx context.Context) v1alpha1.ImageInformer {
untyped := ctx.Value(Key{})
if untyped == nil {
logging.FromContext(ctx).Fatalf(
"Unable to fetch %T from context.", (v1alpha1.ImageInformer)(nil))
logging.FromContext(ctx).Panic(
"Unable to fetch knative.dev/caching/pkg/client/informers/externalversions/caching/v1alpha1.ImageInformer from context.")
}
return untyped.(v1alpha1.ImageInformer)
}

View File

@ -16,7 +16,7 @@ limitations under the License.
// Code generated by injection-gen. DO NOT EDIT.
package cachingfactory
package factory
import (
"context"
@ -49,8 +49,8 @@ func withInformerFactory(ctx context.Context) context.Context {
func Get(ctx context.Context) externalversions.SharedInformerFactory {
untyped := ctx.Value(Key{})
if untyped == nil {
logging.FromContext(ctx).Fatalf(
"Unable to fetch %T from context.", (externalversions.SharedInformerFactory)(nil))
logging.FromContext(ctx).Panic(
"Unable to fetch knative.dev/caching/pkg/client/informers/externalversions.SharedInformerFactory from context.")
}
return untyped.(externalversions.SharedInformerFactory)
}

View File

@ -23,7 +23,7 @@ import (
externalversions "knative.dev/caching/pkg/client/informers/externalversions"
fake "knative.dev/caching/pkg/client/injection/client/fake"
factory "knative.dev/caching/pkg/client/injection/informers/caching/factory"
factory "knative.dev/caching/pkg/client/injection/informers/factory"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
)

View File

@ -53,7 +53,7 @@ const (
)
// Conditions defines a readiness condition for a Knative resource.
// See: https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#typical-status-properties
// See: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties
// +k8s:deepcopy-gen=true
// +k8s:openapi-gen=true
type Condition struct {

View File

@ -25,7 +25,7 @@ import (
"knative.dev/pkg/apis"
"knative.dev/pkg/apis/duck"
"knative.dev/pkg/apis/duck/v1"
v1 "knative.dev/pkg/apis/duck/v1"
"knative.dev/pkg/apis/duck/v1beta1"
)

View File

@ -60,7 +60,7 @@ const (
)
// Conditions defines a readiness condition for a Knative resource.
// See: https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#typical-status-properties
// See: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties
// +k8s:deepcopy-gen=true
type Condition struct {
// Type of condition.

View File

@ -25,7 +25,7 @@ import (
"knative.dev/pkg/apis"
"knative.dev/pkg/apis/duck"
"knative.dev/pkg/apis/duck/v1"
v1 "knative.dev/pkg/apis/duck/v1"
)
// Addressable provides a generic mechanism for a custom resource

View File

@ -14,36 +14,36 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package apiextclient
// Code generated by injection-gen. DO NOT EDIT.
package client
import (
"context"
"k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset"
"k8s.io/client-go/rest"
"knative.dev/pkg/injection"
"knative.dev/pkg/logging"
clientset "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset"
rest "k8s.io/client-go/rest"
injection "knative.dev/pkg/injection"
logging "knative.dev/pkg/logging"
)
func init() {
injection.Default.RegisterClient(withClient)
}
// Key is used as the key for associating information
// with a context.Context.
// Key is used as the key for associating information with a context.Context.
type Key struct{}
func withClient(ctx context.Context, cfg *rest.Config) context.Context {
return context.WithValue(ctx, Key{}, clientset.NewForConfigOrDie(cfg))
}
// Get extracts the Kubernetes Api Extensions client from the context.
// Get extracts the clientset.Interface client from the context.
func Get(ctx context.Context) clientset.Interface {
untyped := ctx.Value(Key{})
if untyped == nil {
logging.FromContext(ctx).Panicf(
"Unable to fetch %T from context.", (clientset.Interface)(nil))
logging.FromContext(ctx).Panic(
"Unable to fetch k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset.Interface from context.")
}
return untyped.(clientset.Interface)
}

View File

@ -14,18 +14,19 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package fake
import (
"context"
"k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/fake"
fake "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/fake"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/rest"
"knative.dev/pkg/injection"
"knative.dev/pkg/injection/clients/apiextclient"
"knative.dev/pkg/logging"
client "knative.dev/pkg/client/injection/apiextensions/client"
injection "knative.dev/pkg/injection"
logging "knative.dev/pkg/logging"
)
func init() {
@ -39,15 +40,15 @@ func withClient(ctx context.Context, cfg *rest.Config) context.Context {
func With(ctx context.Context, objects ...runtime.Object) (context.Context, *fake.Clientset) {
cs := fake.NewSimpleClientset(objects...)
return context.WithValue(ctx, apiextclient.Key{}, cs), cs
return context.WithValue(ctx, client.Key{}, cs), cs
}
// Get extracts the Kubernetes Api Extensions client from the context.
// Get extracts the Kubernetes client from the context.
func Get(ctx context.Context) *fake.Clientset {
untyped := ctx.Value(apiextclient.Key{})
untyped := ctx.Value(client.Key{})
if untyped == nil {
logging.FromContext(ctx).Panicf(
"Unable to fetch %T from context.", (*fake.Clientset)(nil))
logging.FromContext(ctx).Panic(
"Unable to fetch k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/fake.Clientset from context.")
}
return untyped.(*fake.Clientset)
}

View File

@ -14,25 +14,25 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package crd
// Code generated by injection-gen. DO NOT EDIT.
package customresourcedefinition
import (
"context"
apiextv1beta1 "k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions/apiextensions/v1beta1"
"knative.dev/pkg/controller"
"knative.dev/pkg/injection"
"knative.dev/pkg/injection/informers/apiextinformers/factory"
"knative.dev/pkg/logging"
v1beta1 "k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions/apiextensions/v1beta1"
factory "knative.dev/pkg/client/injection/apiextensions/informers/factory"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
logging "knative.dev/pkg/logging"
)
func init() {
injection.Default.RegisterInformer(withInformer)
}
// Key is used as the key for associating information
// with a context.Context.
// Key is used for associating the Informer inside the context.Context.
type Key struct{}
func withInformer(ctx context.Context) (context.Context, controller.Informer) {
@ -41,12 +41,12 @@ func withInformer(ctx context.Context) (context.Context, controller.Informer) {
return context.WithValue(ctx, Key{}, inf), inf.Informer()
}
// Get extracts the Kubernetes Deployment informer from the context.
func Get(ctx context.Context) apiextv1beta1.CustomResourceDefinitionInformer {
// Get extracts the typed informer from the context.
func Get(ctx context.Context) v1beta1.CustomResourceDefinitionInformer {
untyped := ctx.Value(Key{})
if untyped == nil {
logging.FromContext(ctx).Panicf(
"Unable to fetch %T from context.", (apiextv1beta1.CustomResourceDefinitionInformer)(nil))
logging.FromContext(ctx).Panic(
"Unable to fetch k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions/apiextensions/v1beta1.CustomResourceDefinitionInformer from context.")
}
return untyped.(apiextv1beta1.CustomResourceDefinitionInformer)
return untyped.(v1beta1.CustomResourceDefinitionInformer)
}

View File

@ -0,0 +1,40 @@
/*
Copyright 2019 The Knative Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package fake
import (
"context"
customresourcedefinition "knative.dev/pkg/client/injection/apiextensions/informers/apiextensions/v1beta1/customresourcedefinition"
fake "knative.dev/pkg/client/injection/apiextensions/informers/factory/fake"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
)
var Get = customresourcedefinition.Get
func init() {
injection.Fake.RegisterInformer(withInformer)
}
func withInformer(ctx context.Context) (context.Context, controller.Informer) {
f := fake.Get(ctx)
inf := f.Apiextensions().V1beta1().CustomResourceDefinitions()
return context.WithValue(ctx, customresourcedefinition.Key{}, inf), inf.Informer()
}

View File

@ -16,13 +16,13 @@ limitations under the License.
// Code generated by injection-gen. DO NOT EDIT.
package authenticationfactory
package factory
import (
"context"
externalversions "knative.dev/pkg/client/informers/externalversions"
client "knative.dev/pkg/client/injection/client"
externalversions "k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions"
client "knative.dev/pkg/client/injection/apiextensions/client"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
logging "knative.dev/pkg/logging"
@ -49,8 +49,8 @@ func withInformerFactory(ctx context.Context) context.Context {
func Get(ctx context.Context) externalversions.SharedInformerFactory {
untyped := ctx.Value(Key{})
if untyped == nil {
logging.FromContext(ctx).Fatalf(
"Unable to fetch %T from context.", (externalversions.SharedInformerFactory)(nil))
logging.FromContext(ctx).Panic(
"Unable to fetch k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions.SharedInformerFactory from context.")
}
return untyped.(externalversions.SharedInformerFactory)
}

View File

@ -21,9 +21,9 @@ package fake
import (
"context"
externalversions "knative.dev/pkg/client/informers/externalversions"
fake "knative.dev/pkg/client/injection/client/fake"
factory "knative.dev/pkg/client/injection/informers/authentication/factory"
externalversions "k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions"
fake "knative.dev/pkg/client/injection/apiextensions/client/fake"
factory "knative.dev/pkg/client/injection/apiextensions/informers/factory"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
)

View File

@ -42,8 +42,8 @@ func withClient(ctx context.Context, cfg *rest.Config) context.Context {
func Get(ctx context.Context) versioned.Interface {
untyped := ctx.Value(Key{})
if untyped == nil {
logging.FromContext(ctx).Fatalf(
"Unable to fetch %T from context.", (versioned.Interface)(nil))
logging.FromContext(ctx).Panic(
"Unable to fetch knative.dev/pkg/client/clientset/versioned.Interface from context.")
}
return untyped.(versioned.Interface)
}

View File

@ -47,8 +47,8 @@ func With(ctx context.Context, objects ...runtime.Object) (context.Context, *fak
func Get(ctx context.Context) *fake.Clientset {
untyped := ctx.Value(client.Key{})
if untyped == nil {
logging.FromContext(ctx).Fatalf(
"Unable to fetch %T from context.", (*fake.Clientset)(nil))
logging.FromContext(ctx).Panic(
"Unable to fetch knative.dev/pkg/client/clientset/versioned/fake.Clientset from context.")
}
return untyped.(*fake.Clientset)
}

View File

@ -21,8 +21,8 @@ package fake
import (
"context"
fake "knative.dev/pkg/client/injection/informers/authentication/factory/fake"
policy "knative.dev/pkg/client/injection/informers/authentication/v1alpha1/policy"
fake "knative.dev/pkg/client/injection/informers/factory/fake"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
)

View File

@ -22,7 +22,7 @@ import (
"context"
v1alpha1 "knative.dev/pkg/client/informers/externalversions/authentication/v1alpha1"
factory "knative.dev/pkg/client/injection/informers/authentication/factory"
factory "knative.dev/pkg/client/injection/informers/factory"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
logging "knative.dev/pkg/logging"
@ -45,8 +45,8 @@ func withInformer(ctx context.Context) (context.Context, controller.Informer) {
func Get(ctx context.Context) v1alpha1.PolicyInformer {
untyped := ctx.Value(Key{})
if untyped == nil {
logging.FromContext(ctx).Fatalf(
"Unable to fetch %T from context.", (v1alpha1.PolicyInformer)(nil))
logging.FromContext(ctx).Panic(
"Unable to fetch knative.dev/pkg/client/informers/externalversions/authentication/v1alpha1.PolicyInformer from context.")
}
return untyped.(v1alpha1.PolicyInformer)
}

View File

@ -16,7 +16,7 @@ limitations under the License.
// Code generated by injection-gen. DO NOT EDIT.
package istiofactory
package factory
import (
"context"
@ -49,8 +49,8 @@ func withInformerFactory(ctx context.Context) context.Context {
func Get(ctx context.Context) externalversions.SharedInformerFactory {
untyped := ctx.Value(Key{})
if untyped == nil {
logging.FromContext(ctx).Fatalf(
"Unable to fetch %T from context.", (externalversions.SharedInformerFactory)(nil))
logging.FromContext(ctx).Panic(
"Unable to fetch knative.dev/pkg/client/informers/externalversions.SharedInformerFactory from context.")
}
return untyped.(externalversions.SharedInformerFactory)
}

View File

@ -23,7 +23,7 @@ import (
externalversions "knative.dev/pkg/client/informers/externalversions"
fake "knative.dev/pkg/client/injection/client/fake"
factory "knative.dev/pkg/client/injection/informers/istio/factory"
factory "knative.dev/pkg/client/injection/informers/factory"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
)

View File

@ -22,7 +22,7 @@ import (
"context"
v1alpha3 "knative.dev/pkg/client/informers/externalversions/istio/v1alpha3"
factory "knative.dev/pkg/client/injection/informers/istio/factory"
factory "knative.dev/pkg/client/injection/informers/factory"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
logging "knative.dev/pkg/logging"
@ -45,8 +45,8 @@ func withInformer(ctx context.Context) (context.Context, controller.Informer) {
func Get(ctx context.Context) v1alpha3.DestinationRuleInformer {
untyped := ctx.Value(Key{})
if untyped == nil {
logging.FromContext(ctx).Fatalf(
"Unable to fetch %T from context.", (v1alpha3.DestinationRuleInformer)(nil))
logging.FromContext(ctx).Panic(
"Unable to fetch knative.dev/pkg/client/informers/externalversions/istio/v1alpha3.DestinationRuleInformer from context.")
}
return untyped.(v1alpha3.DestinationRuleInformer)
}

View File

@ -21,7 +21,7 @@ package fake
import (
"context"
fake "knative.dev/pkg/client/injection/informers/istio/factory/fake"
fake "knative.dev/pkg/client/injection/informers/factory/fake"
destinationrule "knative.dev/pkg/client/injection/informers/istio/v1alpha3/destinationrule"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"

View File

@ -21,7 +21,7 @@ package fake
import (
"context"
fake "knative.dev/pkg/client/injection/informers/istio/factory/fake"
fake "knative.dev/pkg/client/injection/informers/factory/fake"
gateway "knative.dev/pkg/client/injection/informers/istio/v1alpha3/gateway"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"

View File

@ -22,7 +22,7 @@ import (
"context"
v1alpha3 "knative.dev/pkg/client/informers/externalversions/istio/v1alpha3"
factory "knative.dev/pkg/client/injection/informers/istio/factory"
factory "knative.dev/pkg/client/injection/informers/factory"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
logging "knative.dev/pkg/logging"
@ -45,8 +45,8 @@ func withInformer(ctx context.Context) (context.Context, controller.Informer) {
func Get(ctx context.Context) v1alpha3.GatewayInformer {
untyped := ctx.Value(Key{})
if untyped == nil {
logging.FromContext(ctx).Fatalf(
"Unable to fetch %T from context.", (v1alpha3.GatewayInformer)(nil))
logging.FromContext(ctx).Panic(
"Unable to fetch knative.dev/pkg/client/informers/externalversions/istio/v1alpha3.GatewayInformer from context.")
}
return untyped.(v1alpha3.GatewayInformer)
}

View File

@ -21,7 +21,7 @@ package fake
import (
"context"
fake "knative.dev/pkg/client/injection/informers/istio/factory/fake"
fake "knative.dev/pkg/client/injection/informers/factory/fake"
virtualservice "knative.dev/pkg/client/injection/informers/istio/v1alpha3/virtualservice"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"

View File

@ -22,7 +22,7 @@ import (
"context"
v1alpha3 "knative.dev/pkg/client/informers/externalversions/istio/v1alpha3"
factory "knative.dev/pkg/client/injection/informers/istio/factory"
factory "knative.dev/pkg/client/injection/informers/factory"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
logging "knative.dev/pkg/logging"
@ -45,8 +45,8 @@ func withInformer(ctx context.Context) (context.Context, controller.Informer) {
func Get(ctx context.Context) v1alpha3.VirtualServiceInformer {
untyped := ctx.Value(Key{})
if untyped == nil {
logging.FromContext(ctx).Fatalf(
"Unable to fetch %T from context.", (v1alpha3.VirtualServiceInformer)(nil))
logging.FromContext(ctx).Panic(
"Unable to fetch knative.dev/pkg/client/informers/externalversions/istio/v1alpha3.VirtualServiceInformer from context.")
}
return untyped.(v1alpha3.VirtualServiceInformer)
}

View File

@ -14,36 +14,36 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package kubeclient
// Code generated by injection-gen. DO NOT EDIT.
package client
import (
"context"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
"knative.dev/pkg/injection"
"knative.dev/pkg/logging"
kubernetes "k8s.io/client-go/kubernetes"
rest "k8s.io/client-go/rest"
injection "knative.dev/pkg/injection"
logging "knative.dev/pkg/logging"
)
func init() {
injection.Default.RegisterClient(withClient)
}
// Key is used as the key for associating information
// with a context.Context.
// Key is used as the key for associating information with a context.Context.
type Key struct{}
func withClient(ctx context.Context, cfg *rest.Config) context.Context {
return context.WithValue(ctx, Key{}, kubernetes.NewForConfigOrDie(cfg))
}
// Get extracts the Kubernetes client from the context.
// Get extracts the kubernetes.Interface client from the context.
func Get(ctx context.Context) kubernetes.Interface {
untyped := ctx.Value(Key{})
if untyped == nil {
logging.FromContext(ctx).Panicf(
"Unable to fetch %T from context.", (kubernetes.Interface)(nil))
logging.FromContext(ctx).Panic(
"Unable to fetch k8s.io/client-go/kubernetes.Interface from context.")
}
return untyped.(kubernetes.Interface)
}

View File

@ -14,18 +14,19 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package fake
import (
"context"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/kubernetes/fake"
fake "k8s.io/client-go/kubernetes/fake"
"k8s.io/client-go/rest"
"knative.dev/pkg/injection"
"knative.dev/pkg/injection/clients/kubeclient"
"knative.dev/pkg/logging"
client "knative.dev/pkg/client/injection/kube/client"
injection "knative.dev/pkg/injection"
logging "knative.dev/pkg/logging"
)
func init() {
@ -39,15 +40,15 @@ func withClient(ctx context.Context, cfg *rest.Config) context.Context {
func With(ctx context.Context, objects ...runtime.Object) (context.Context, *fake.Clientset) {
cs := fake.NewSimpleClientset(objects...)
return context.WithValue(ctx, kubeclient.Key{}, cs), cs
return context.WithValue(ctx, client.Key{}, cs), cs
}
// Get extracts the Kubernetes client from the context.
func Get(ctx context.Context) *fake.Clientset {
untyped := ctx.Value(kubeclient.Key{})
untyped := ctx.Value(client.Key{})
if untyped == nil {
logging.FromContext(ctx).Panicf(
"Unable to fetch %T from context.", (*fake.Clientset)(nil))
logging.FromContext(ctx).Panic(
"Unable to fetch k8s.io/client-go/kubernetes/fake.Clientset from context.")
}
return untyped.(*fake.Clientset)
}

View File

@ -0,0 +1,52 @@
/*
Copyright 2019 The Knative Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package controllerrevision
import (
"context"
v1 "k8s.io/client-go/informers/apps/v1"
factory "knative.dev/pkg/client/injection/kube/informers/factory"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
logging "knative.dev/pkg/logging"
)
func init() {
injection.Default.RegisterInformer(withInformer)
}
// Key is used for associating the Informer inside the context.Context.
type Key struct{}
func withInformer(ctx context.Context) (context.Context, controller.Informer) {
f := factory.Get(ctx)
inf := f.Apps().V1().ControllerRevisions()
return context.WithValue(ctx, Key{}, inf), inf.Informer()
}
// Get extracts the typed informer from the context.
func Get(ctx context.Context) v1.ControllerRevisionInformer {
untyped := ctx.Value(Key{})
if untyped == nil {
logging.FromContext(ctx).Panic(
"Unable to fetch k8s.io/client-go/informers/apps/v1.ControllerRevisionInformer from context.")
}
return untyped.(v1.ControllerRevisionInformer)
}

View File

@ -0,0 +1,40 @@
/*
Copyright 2019 The Knative Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package fake
import (
"context"
controllerrevision "knative.dev/pkg/client/injection/kube/informers/apps/v1/controllerrevision"
fake "knative.dev/pkg/client/injection/kube/informers/factory/fake"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
)
var Get = controllerrevision.Get
func init() {
injection.Fake.RegisterInformer(withInformer)
}
func withInformer(ctx context.Context) (context.Context, controller.Informer) {
f := fake.Get(ctx)
inf := f.Apps().V1().ControllerRevisions()
return context.WithValue(ctx, controllerrevision.Key{}, inf), inf.Informer()
}

View File

@ -0,0 +1,52 @@
/*
Copyright 2019 The Knative Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package daemonset
import (
"context"
v1 "k8s.io/client-go/informers/apps/v1"
factory "knative.dev/pkg/client/injection/kube/informers/factory"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
logging "knative.dev/pkg/logging"
)
func init() {
injection.Default.RegisterInformer(withInformer)
}
// Key is used for associating the Informer inside the context.Context.
type Key struct{}
func withInformer(ctx context.Context) (context.Context, controller.Informer) {
f := factory.Get(ctx)
inf := f.Apps().V1().DaemonSets()
return context.WithValue(ctx, Key{}, inf), inf.Informer()
}
// Get extracts the typed informer from the context.
func Get(ctx context.Context) v1.DaemonSetInformer {
untyped := ctx.Value(Key{})
if untyped == nil {
logging.FromContext(ctx).Panic(
"Unable to fetch k8s.io/client-go/informers/apps/v1.DaemonSetInformer from context.")
}
return untyped.(v1.DaemonSetInformer)
}

View File

@ -0,0 +1,40 @@
/*
Copyright 2019 The Knative Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package fake
import (
"context"
daemonset "knative.dev/pkg/client/injection/kube/informers/apps/v1/daemonset"
fake "knative.dev/pkg/client/injection/kube/informers/factory/fake"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
)
var Get = daemonset.Get
func init() {
injection.Fake.RegisterInformer(withInformer)
}
func withInformer(ctx context.Context) (context.Context, controller.Informer) {
f := fake.Get(ctx)
inf := f.Apps().V1().DaemonSets()
return context.WithValue(ctx, daemonset.Key{}, inf), inf.Informer()
}

View File

@ -14,25 +14,25 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package deployment
import (
"context"
appsv1 "k8s.io/client-go/informers/apps/v1"
"knative.dev/pkg/controller"
"knative.dev/pkg/injection"
"knative.dev/pkg/injection/informers/kubeinformers/factory"
"knative.dev/pkg/logging"
v1 "k8s.io/client-go/informers/apps/v1"
factory "knative.dev/pkg/client/injection/kube/informers/factory"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
logging "knative.dev/pkg/logging"
)
func init() {
injection.Default.RegisterInformer(withInformer)
}
// Key is used as the key for associating information
// with a context.Context.
// Key is used for associating the Informer inside the context.Context.
type Key struct{}
func withInformer(ctx context.Context) (context.Context, controller.Informer) {
@ -41,12 +41,12 @@ func withInformer(ctx context.Context) (context.Context, controller.Informer) {
return context.WithValue(ctx, Key{}, inf), inf.Informer()
}
// Get extracts the Kubernetes Deployment informer from the context.
func Get(ctx context.Context) appsv1.DeploymentInformer {
// Get extracts the typed informer from the context.
func Get(ctx context.Context) v1.DeploymentInformer {
untyped := ctx.Value(Key{})
if untyped == nil {
logging.FromContext(ctx).Panicf(
"Unable to fetch %T from context.", (appsv1.DeploymentInformer)(nil))
logging.FromContext(ctx).Panic(
"Unable to fetch k8s.io/client-go/informers/apps/v1.DeploymentInformer from context.")
}
return untyped.(appsv1.DeploymentInformer)
return untyped.(v1.DeploymentInformer)
}

View File

@ -14,15 +14,17 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package fake
import (
"context"
"knative.dev/pkg/controller"
"knative.dev/pkg/injection"
"knative.dev/pkg/injection/informers/kubeinformers/appsv1/deployment"
"knative.dev/pkg/injection/informers/kubeinformers/factory/fake"
deployment "knative.dev/pkg/client/injection/kube/informers/apps/v1/deployment"
fake "knative.dev/pkg/client/injection/kube/informers/factory/fake"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
)
var Get = deployment.Get

View File

@ -0,0 +1,40 @@
/*
Copyright 2019 The Knative Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package fake
import (
"context"
replicaset "knative.dev/pkg/client/injection/kube/informers/apps/v1/replicaset"
fake "knative.dev/pkg/client/injection/kube/informers/factory/fake"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
)
var Get = replicaset.Get
func init() {
injection.Fake.RegisterInformer(withInformer)
}
func withInformer(ctx context.Context) (context.Context, controller.Informer) {
f := fake.Get(ctx)
inf := f.Apps().V1().ReplicaSets()
return context.WithValue(ctx, replicaset.Key{}, inf), inf.Informer()
}

View File

@ -0,0 +1,52 @@
/*
Copyright 2019 The Knative Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package replicaset
import (
"context"
v1 "k8s.io/client-go/informers/apps/v1"
factory "knative.dev/pkg/client/injection/kube/informers/factory"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
logging "knative.dev/pkg/logging"
)
func init() {
injection.Default.RegisterInformer(withInformer)
}
// Key is used for associating the Informer inside the context.Context.
type Key struct{}
func withInformer(ctx context.Context) (context.Context, controller.Informer) {
f := factory.Get(ctx)
inf := f.Apps().V1().ReplicaSets()
return context.WithValue(ctx, Key{}, inf), inf.Informer()
}
// Get extracts the typed informer from the context.
func Get(ctx context.Context) v1.ReplicaSetInformer {
untyped := ctx.Value(Key{})
if untyped == nil {
logging.FromContext(ctx).Panic(
"Unable to fetch k8s.io/client-go/informers/apps/v1.ReplicaSetInformer from context.")
}
return untyped.(v1.ReplicaSetInformer)
}

View File

@ -0,0 +1,40 @@
/*
Copyright 2019 The Knative Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package fake
import (
"context"
statefulset "knative.dev/pkg/client/injection/kube/informers/apps/v1/statefulset"
fake "knative.dev/pkg/client/injection/kube/informers/factory/fake"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
)
var Get = statefulset.Get
func init() {
injection.Fake.RegisterInformer(withInformer)
}
func withInformer(ctx context.Context) (context.Context, controller.Informer) {
f := fake.Get(ctx)
inf := f.Apps().V1().StatefulSets()
return context.WithValue(ctx, statefulset.Key{}, inf), inf.Informer()
}

View File

@ -0,0 +1,52 @@
/*
Copyright 2019 The Knative Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package statefulset
import (
"context"
v1 "k8s.io/client-go/informers/apps/v1"
factory "knative.dev/pkg/client/injection/kube/informers/factory"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
logging "knative.dev/pkg/logging"
)
func init() {
injection.Default.RegisterInformer(withInformer)
}
// Key is used for associating the Informer inside the context.Context.
type Key struct{}
func withInformer(ctx context.Context) (context.Context, controller.Informer) {
f := factory.Get(ctx)
inf := f.Apps().V1().StatefulSets()
return context.WithValue(ctx, Key{}, inf), inf.Informer()
}
// Get extracts the typed informer from the context.
func Get(ctx context.Context) v1.StatefulSetInformer {
untyped := ctx.Value(Key{})
if untyped == nil {
logging.FromContext(ctx).Panic(
"Unable to fetch k8s.io/client-go/informers/apps/v1.StatefulSetInformer from context.")
}
return untyped.(v1.StatefulSetInformer)
}

View File

@ -0,0 +1,40 @@
/*
Copyright 2019 The Knative Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package fake
import (
"context"
horizontalpodautoscaler "knative.dev/pkg/client/injection/kube/informers/autoscaling/v1/horizontalpodautoscaler"
fake "knative.dev/pkg/client/injection/kube/informers/factory/fake"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
)
var Get = horizontalpodautoscaler.Get
func init() {
injection.Fake.RegisterInformer(withInformer)
}
func withInformer(ctx context.Context) (context.Context, controller.Informer) {
f := fake.Get(ctx)
inf := f.Autoscaling().V1().HorizontalPodAutoscalers()
return context.WithValue(ctx, horizontalpodautoscaler.Key{}, inf), inf.Informer()
}

View File

@ -14,25 +14,25 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package hpa
// Code generated by injection-gen. DO NOT EDIT.
package horizontalpodautoscaler
import (
"context"
autoscalingv1 "k8s.io/client-go/informers/autoscaling/v1"
"knative.dev/pkg/controller"
"knative.dev/pkg/injection"
"knative.dev/pkg/injection/informers/kubeinformers/factory"
"knative.dev/pkg/logging"
v1 "k8s.io/client-go/informers/autoscaling/v1"
factory "knative.dev/pkg/client/injection/kube/informers/factory"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
logging "knative.dev/pkg/logging"
)
func init() {
injection.Default.RegisterInformer(withInformer)
}
// Key is used as the key for associating information
// with a context.Context.
// Key is used for associating the Informer inside the context.Context.
type Key struct{}
func withInformer(ctx context.Context) (context.Context, controller.Informer) {
@ -41,12 +41,12 @@ func withInformer(ctx context.Context) (context.Context, controller.Informer) {
return context.WithValue(ctx, Key{}, inf), inf.Informer()
}
// Get extracts the Kubernetes Hpa informer from the context.
func Get(ctx context.Context) autoscalingv1.HorizontalPodAutoscalerInformer {
// Get extracts the typed informer from the context.
func Get(ctx context.Context) v1.HorizontalPodAutoscalerInformer {
untyped := ctx.Value(Key{})
if untyped == nil {
logging.FromContext(ctx).Panicf(
"Unable to fetch %T from context.", (autoscalingv1.HorizontalPodAutoscalerInformer)(nil))
logging.FromContext(ctx).Panic(
"Unable to fetch k8s.io/client-go/informers/autoscaling/v1.HorizontalPodAutoscalerInformer from context.")
}
return untyped.(autoscalingv1.HorizontalPodAutoscalerInformer)
return untyped.(v1.HorizontalPodAutoscalerInformer)
}

View File

@ -14,18 +14,20 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package fake
import (
"context"
"knative.dev/pkg/controller"
"knative.dev/pkg/injection"
"knative.dev/pkg/injection/informers/kubeinformers/autoscalingv2beta1/hpa"
"knative.dev/pkg/injection/informers/kubeinformers/factory/fake"
horizontalpodautoscaler "knative.dev/pkg/client/injection/kube/informers/autoscaling/v2beta1/horizontalpodautoscaler"
fake "knative.dev/pkg/client/injection/kube/informers/factory/fake"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
)
var Get = hpa.Get
var Get = horizontalpodautoscaler.Get
func init() {
injection.Fake.RegisterInformer(withInformer)
@ -34,5 +36,5 @@ func init() {
func withInformer(ctx context.Context) (context.Context, controller.Informer) {
f := fake.Get(ctx)
inf := f.Autoscaling().V2beta1().HorizontalPodAutoscalers()
return context.WithValue(ctx, hpa.Key{}, inf), inf.Informer()
return context.WithValue(ctx, horizontalpodautoscaler.Key{}, inf), inf.Informer()
}

View File

@ -14,25 +14,25 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package hpa
// Code generated by injection-gen. DO NOT EDIT.
package horizontalpodautoscaler
import (
"context"
autoscalingv2beta1 "k8s.io/client-go/informers/autoscaling/v2beta1"
"knative.dev/pkg/controller"
"knative.dev/pkg/injection"
"knative.dev/pkg/injection/informers/kubeinformers/factory"
"knative.dev/pkg/logging"
v2beta1 "k8s.io/client-go/informers/autoscaling/v2beta1"
factory "knative.dev/pkg/client/injection/kube/informers/factory"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
logging "knative.dev/pkg/logging"
)
func init() {
injection.Default.RegisterInformer(withInformer)
}
// Key is used as the key for associating information
// with a context.Context.
// Key is used for associating the Informer inside the context.Context.
type Key struct{}
func withInformer(ctx context.Context) (context.Context, controller.Informer) {
@ -41,12 +41,12 @@ func withInformer(ctx context.Context) (context.Context, controller.Informer) {
return context.WithValue(ctx, Key{}, inf), inf.Informer()
}
// Get extracts the Kubernetes Hpa informer from the context.
func Get(ctx context.Context) autoscalingv2beta1.HorizontalPodAutoscalerInformer {
// Get extracts the typed informer from the context.
func Get(ctx context.Context) v2beta1.HorizontalPodAutoscalerInformer {
untyped := ctx.Value(Key{})
if untyped == nil {
logging.FromContext(ctx).Panicf(
"Unable to fetch %T from context.", (autoscalingv2beta1.HorizontalPodAutoscalerInformer)(nil))
logging.FromContext(ctx).Panic(
"Unable to fetch k8s.io/client-go/informers/autoscaling/v2beta1.HorizontalPodAutoscalerInformer from context.")
}
return untyped.(autoscalingv2beta1.HorizontalPodAutoscalerInformer)
return untyped.(v2beta1.HorizontalPodAutoscalerInformer)
}

View File

@ -14,15 +14,17 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package fake
import (
"context"
"knative.dev/pkg/controller"
"knative.dev/pkg/injection"
"knative.dev/pkg/injection/informers/kubeinformers/batchv1/job"
"knative.dev/pkg/injection/informers/kubeinformers/factory/fake"
job "knative.dev/pkg/client/injection/kube/informers/batch/v1/job"
fake "knative.dev/pkg/client/injection/kube/informers/factory/fake"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
)
var Get = job.Get

View File

@ -14,25 +14,25 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package job
import (
"context"
batchv1 "k8s.io/client-go/informers/batch/v1"
"knative.dev/pkg/controller"
"knative.dev/pkg/injection"
"knative.dev/pkg/injection/informers/kubeinformers/factory"
"knative.dev/pkg/logging"
v1 "k8s.io/client-go/informers/batch/v1"
factory "knative.dev/pkg/client/injection/kube/informers/factory"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
logging "knative.dev/pkg/logging"
)
func init() {
injection.Default.RegisterInformer(withInformer)
}
// Key is used as the key for associating information
// with a context.Context.
// Key is used for associating the Informer inside the context.Context.
type Key struct{}
func withInformer(ctx context.Context) (context.Context, controller.Informer) {
@ -41,12 +41,12 @@ func withInformer(ctx context.Context) (context.Context, controller.Informer) {
return context.WithValue(ctx, Key{}, inf), inf.Informer()
}
// Get extracts the Kubernetes Job informer from the context.
func Get(ctx context.Context) batchv1.JobInformer {
// Get extracts the typed informer from the context.
func Get(ctx context.Context) v1.JobInformer {
untyped := ctx.Value(Key{})
if untyped == nil {
logging.FromContext(ctx).Panicf(
"Unable to fetch %T from context.", (batchv1.JobInformer)(nil))
logging.FromContext(ctx).Panic(
"Unable to fetch k8s.io/client-go/informers/batch/v1.JobInformer from context.")
}
return untyped.(batchv1.JobInformer)
return untyped.(v1.JobInformer)
}

View File

@ -14,25 +14,25 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package cronjob
import (
"context"
batchv1beta1 "k8s.io/client-go/informers/batch/v1beta1"
"knative.dev/pkg/controller"
"knative.dev/pkg/injection"
"knative.dev/pkg/injection/informers/kubeinformers/factory"
"knative.dev/pkg/logging"
v1beta1 "k8s.io/client-go/informers/batch/v1beta1"
factory "knative.dev/pkg/client/injection/kube/informers/factory"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
logging "knative.dev/pkg/logging"
)
func init() {
injection.Default.RegisterInformer(withInformer)
}
// Key is used as the key for associating information
// with a context.Context.
// Key is used for associating the Informer inside the context.Context.
type Key struct{}
func withInformer(ctx context.Context) (context.Context, controller.Informer) {
@ -41,12 +41,12 @@ func withInformer(ctx context.Context) (context.Context, controller.Informer) {
return context.WithValue(ctx, Key{}, inf), inf.Informer()
}
// Get extracts the Kubernetes Job informer from the context.
func Get(ctx context.Context) batchv1beta1.CronJobInformer {
// Get extracts the typed informer from the context.
func Get(ctx context.Context) v1beta1.CronJobInformer {
untyped := ctx.Value(Key{})
if untyped == nil {
logging.FromContext(ctx).Panicf(
"Unable to fetch %T from context.", (batchv1beta1.CronJobInformer)(nil))
logging.FromContext(ctx).Panic(
"Unable to fetch k8s.io/client-go/informers/batch/v1beta1.CronJobInformer from context.")
}
return untyped.(batchv1beta1.CronJobInformer)
return untyped.(v1beta1.CronJobInformer)
}

View File

@ -14,15 +14,17 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package fake
import (
"context"
"knative.dev/pkg/controller"
"knative.dev/pkg/injection"
"knative.dev/pkg/injection/informers/kubeinformers/batchv1beta1/cronjob"
"knative.dev/pkg/injection/informers/kubeinformers/factory/fake"
cronjob "knative.dev/pkg/client/injection/kube/informers/batch/v1beta1/cronjob"
fake "knative.dev/pkg/client/injection/kube/informers/factory/fake"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
)
var Get = cronjob.Get

View File

@ -0,0 +1,52 @@
/*
Copyright 2019 The Knative Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package componentstatus
import (
"context"
v1 "k8s.io/client-go/informers/core/v1"
factory "knative.dev/pkg/client/injection/kube/informers/factory"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
logging "knative.dev/pkg/logging"
)
func init() {
injection.Default.RegisterInformer(withInformer)
}
// Key is used for associating the Informer inside the context.Context.
type Key struct{}
func withInformer(ctx context.Context) (context.Context, controller.Informer) {
f := factory.Get(ctx)
inf := f.Core().V1().ComponentStatuses()
return context.WithValue(ctx, Key{}, inf), inf.Informer()
}
// Get extracts the typed informer from the context.
func Get(ctx context.Context) v1.ComponentStatusInformer {
untyped := ctx.Value(Key{})
if untyped == nil {
logging.FromContext(ctx).Panic(
"Unable to fetch k8s.io/client-go/informers/core/v1.ComponentStatusInformer from context.")
}
return untyped.(v1.ComponentStatusInformer)
}

View File

@ -0,0 +1,40 @@
/*
Copyright 2019 The Knative Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package fake
import (
"context"
componentstatus "knative.dev/pkg/client/injection/kube/informers/core/v1/componentstatus"
fake "knative.dev/pkg/client/injection/kube/informers/factory/fake"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
)
var Get = componentstatus.Get
func init() {
injection.Fake.RegisterInformer(withInformer)
}
func withInformer(ctx context.Context) (context.Context, controller.Informer) {
f := fake.Get(ctx)
inf := f.Core().V1().ComponentStatuses()
return context.WithValue(ctx, componentstatus.Key{}, inf), inf.Informer()
}

View File

@ -14,25 +14,25 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package configmap
import (
"context"
corev1 "k8s.io/client-go/informers/core/v1"
"knative.dev/pkg/controller"
"knative.dev/pkg/injection"
"knative.dev/pkg/injection/informers/kubeinformers/factory"
"knative.dev/pkg/logging"
v1 "k8s.io/client-go/informers/core/v1"
factory "knative.dev/pkg/client/injection/kube/informers/factory"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
logging "knative.dev/pkg/logging"
)
func init() {
injection.Default.RegisterInformer(withInformer)
}
// Key is used as the key for associating information
// with a context.Context.
// Key is used for associating the Informer inside the context.Context.
type Key struct{}
func withInformer(ctx context.Context) (context.Context, controller.Informer) {
@ -41,12 +41,12 @@ func withInformer(ctx context.Context) (context.Context, controller.Informer) {
return context.WithValue(ctx, Key{}, inf), inf.Informer()
}
// Get extracts the Kubernetes ConfigMap informer from the context.
func Get(ctx context.Context) corev1.ConfigMapInformer {
// Get extracts the typed informer from the context.
func Get(ctx context.Context) v1.ConfigMapInformer {
untyped := ctx.Value(Key{})
if untyped == nil {
logging.FromContext(ctx).Panicf(
"Unable to fetch %T from context.", (corev1.ConfigMapInformer)(nil))
logging.FromContext(ctx).Panic(
"Unable to fetch k8s.io/client-go/informers/core/v1.ConfigMapInformer from context.")
}
return untyped.(corev1.ConfigMapInformer)
return untyped.(v1.ConfigMapInformer)
}

View File

@ -14,15 +14,17 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package fake
import (
"context"
"knative.dev/pkg/controller"
"knative.dev/pkg/injection"
"knative.dev/pkg/injection/informers/kubeinformers/corev1/configmap"
"knative.dev/pkg/injection/informers/kubeinformers/factory/fake"
configmap "knative.dev/pkg/client/injection/kube/informers/core/v1/configmap"
fake "knative.dev/pkg/client/injection/kube/informers/factory/fake"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
)
var Get = configmap.Get

View File

@ -14,25 +14,25 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package endpoints
import (
"context"
corev1 "k8s.io/client-go/informers/core/v1"
"knative.dev/pkg/controller"
"knative.dev/pkg/injection"
"knative.dev/pkg/injection/informers/kubeinformers/factory"
"knative.dev/pkg/logging"
v1 "k8s.io/client-go/informers/core/v1"
factory "knative.dev/pkg/client/injection/kube/informers/factory"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
logging "knative.dev/pkg/logging"
)
func init() {
injection.Default.RegisterInformer(withInformer)
}
// Key is used as the key for associating information
// with a context.Context.
// Key is used for associating the Informer inside the context.Context.
type Key struct{}
func withInformer(ctx context.Context) (context.Context, controller.Informer) {
@ -41,12 +41,12 @@ func withInformer(ctx context.Context) (context.Context, controller.Informer) {
return context.WithValue(ctx, Key{}, inf), inf.Informer()
}
// Get extracts the Kubernetes Endpoints informer from the context.
func Get(ctx context.Context) corev1.EndpointsInformer {
// Get extracts the typed informer from the context.
func Get(ctx context.Context) v1.EndpointsInformer {
untyped := ctx.Value(Key{})
if untyped == nil {
logging.FromContext(ctx).Panicf(
"Unable to fetch %T from context.", (corev1.EndpointsInformer)(nil))
logging.FromContext(ctx).Panic(
"Unable to fetch k8s.io/client-go/informers/core/v1.EndpointsInformer from context.")
}
return untyped.(corev1.EndpointsInformer)
return untyped.(v1.EndpointsInformer)
}

View File

@ -14,15 +14,17 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package fake
import (
"context"
"knative.dev/pkg/controller"
"knative.dev/pkg/injection"
"knative.dev/pkg/injection/informers/kubeinformers/corev1/endpoints"
"knative.dev/pkg/injection/informers/kubeinformers/factory/fake"
endpoints "knative.dev/pkg/client/injection/kube/informers/core/v1/endpoints"
fake "knative.dev/pkg/client/injection/kube/informers/factory/fake"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
)
var Get = endpoints.Get

View File

@ -0,0 +1,52 @@
/*
Copyright 2019 The Knative Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package event
import (
"context"
v1 "k8s.io/client-go/informers/core/v1"
factory "knative.dev/pkg/client/injection/kube/informers/factory"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
logging "knative.dev/pkg/logging"
)
func init() {
injection.Default.RegisterInformer(withInformer)
}
// Key is used for associating the Informer inside the context.Context.
type Key struct{}
func withInformer(ctx context.Context) (context.Context, controller.Informer) {
f := factory.Get(ctx)
inf := f.Core().V1().Events()
return context.WithValue(ctx, Key{}, inf), inf.Informer()
}
// Get extracts the typed informer from the context.
func Get(ctx context.Context) v1.EventInformer {
untyped := ctx.Value(Key{})
if untyped == nil {
logging.FromContext(ctx).Panic(
"Unable to fetch k8s.io/client-go/informers/core/v1.EventInformer from context.")
}
return untyped.(v1.EventInformer)
}

View File

@ -14,18 +14,20 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package fake
import (
"context"
"knative.dev/pkg/controller"
"knative.dev/pkg/injection"
"knative.dev/pkg/injection/informers/kubeinformers/autoscalingv1/hpa"
"knative.dev/pkg/injection/informers/kubeinformers/factory/fake"
event "knative.dev/pkg/client/injection/kube/informers/core/v1/event"
fake "knative.dev/pkg/client/injection/kube/informers/factory/fake"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
)
var Get = hpa.Get
var Get = event.Get
func init() {
injection.Fake.RegisterInformer(withInformer)
@ -33,6 +35,6 @@ func init() {
func withInformer(ctx context.Context) (context.Context, controller.Informer) {
f := fake.Get(ctx)
inf := f.Autoscaling().V1().HorizontalPodAutoscalers()
return context.WithValue(ctx, hpa.Key{}, inf), inf.Informer()
inf := f.Core().V1().Events()
return context.WithValue(ctx, event.Key{}, inf), inf.Informer()
}

View File

@ -14,15 +14,17 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package fake
import (
"context"
"knative.dev/pkg/controller"
"knative.dev/pkg/injection"
"knative.dev/pkg/injection/informers/kubeinformers/corev1/limitrange"
"knative.dev/pkg/injection/informers/kubeinformers/factory/fake"
limitrange "knative.dev/pkg/client/injection/kube/informers/core/v1/limitrange"
fake "knative.dev/pkg/client/injection/kube/informers/factory/fake"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
)
var Get = limitrange.Get

View File

@ -14,25 +14,25 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package limitrange
import (
"context"
corev1 "k8s.io/client-go/informers/core/v1"
"knative.dev/pkg/controller"
"knative.dev/pkg/injection"
"knative.dev/pkg/injection/informers/kubeinformers/factory"
"knative.dev/pkg/logging"
v1 "k8s.io/client-go/informers/core/v1"
factory "knative.dev/pkg/client/injection/kube/informers/factory"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
logging "knative.dev/pkg/logging"
)
func init() {
injection.Default.RegisterInformer(withInformer)
}
// Key is used as the key for associating information
// with a context.Context.
// Key is used for associating the Informer inside the context.Context.
type Key struct{}
func withInformer(ctx context.Context) (context.Context, controller.Informer) {
@ -41,12 +41,12 @@ func withInformer(ctx context.Context) (context.Context, controller.Informer) {
return context.WithValue(ctx, Key{}, inf), inf.Informer()
}
// Get extracts the Kubernetes ConfigMap informer from the context.
func Get(ctx context.Context) corev1.LimitRangeInformer {
// Get extracts the typed informer from the context.
func Get(ctx context.Context) v1.LimitRangeInformer {
untyped := ctx.Value(Key{})
if untyped == nil {
logging.FromContext(ctx).Panicf(
"Unable to fetch %T from context.", (corev1.LimitRangeInformer)(nil))
logging.FromContext(ctx).Panic(
"Unable to fetch k8s.io/client-go/informers/core/v1.LimitRangeInformer from context.")
}
return untyped.(corev1.LimitRangeInformer)
return untyped.(v1.LimitRangeInformer)
}

View File

@ -14,15 +14,17 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package fake
import (
"context"
"knative.dev/pkg/controller"
"knative.dev/pkg/injection"
"knative.dev/pkg/injection/informers/kubeinformers/corev1/namespace"
"knative.dev/pkg/injection/informers/kubeinformers/factory/fake"
namespace "knative.dev/pkg/client/injection/kube/informers/core/v1/namespace"
fake "knative.dev/pkg/client/injection/kube/informers/factory/fake"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
)
var Get = namespace.Get

View File

@ -14,25 +14,25 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package namespace
import (
"context"
corev1 "k8s.io/client-go/informers/core/v1"
"knative.dev/pkg/controller"
"knative.dev/pkg/injection"
"knative.dev/pkg/injection/informers/kubeinformers/factory"
"knative.dev/pkg/logging"
v1 "k8s.io/client-go/informers/core/v1"
factory "knative.dev/pkg/client/injection/kube/informers/factory"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
logging "knative.dev/pkg/logging"
)
func init() {
injection.Default.RegisterInformer(withInformer)
}
// Key is used as the key for associating information
// with a context.Context.
// Key is used for associating the Informer inside the context.Context.
type Key struct{}
func withInformer(ctx context.Context) (context.Context, controller.Informer) {
@ -41,12 +41,12 @@ func withInformer(ctx context.Context) (context.Context, controller.Informer) {
return context.WithValue(ctx, Key{}, inf), inf.Informer()
}
// Get extracts the Kubernetes Namespace informer from the context.
func Get(ctx context.Context) corev1.NamespaceInformer {
// Get extracts the typed informer from the context.
func Get(ctx context.Context) v1.NamespaceInformer {
untyped := ctx.Value(Key{})
if untyped == nil {
logging.FromContext(ctx).Panicf(
"Unable to fetch %T from context.", (corev1.NamespaceInformer)(nil))
logging.FromContext(ctx).Panic(
"Unable to fetch k8s.io/client-go/informers/core/v1.NamespaceInformer from context.")
}
return untyped.(corev1.NamespaceInformer)
return untyped.(v1.NamespaceInformer)
}

View File

@ -14,18 +14,20 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package fake
import (
"context"
"knative.dev/pkg/controller"
"knative.dev/pkg/injection"
"knative.dev/pkg/injection/informers/apiextinformers/apiextensionsv1beta1/crd"
"knative.dev/pkg/injection/informers/apiextinformers/factory/fake"
node "knative.dev/pkg/client/injection/kube/informers/core/v1/node"
fake "knative.dev/pkg/client/injection/kube/informers/factory/fake"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
)
var Get = crd.Get
var Get = node.Get
func init() {
injection.Fake.RegisterInformer(withInformer)
@ -33,6 +35,6 @@ func init() {
func withInformer(ctx context.Context) (context.Context, controller.Informer) {
f := fake.Get(ctx)
inf := f.Apiextensions().V1beta1().CustomResourceDefinitions()
return context.WithValue(ctx, crd.Key{}, inf), inf.Informer()
inf := f.Core().V1().Nodes()
return context.WithValue(ctx, node.Key{}, inf), inf.Informer()
}

View File

@ -0,0 +1,52 @@
/*
Copyright 2019 The Knative Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package node
import (
"context"
v1 "k8s.io/client-go/informers/core/v1"
factory "knative.dev/pkg/client/injection/kube/informers/factory"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
logging "knative.dev/pkg/logging"
)
func init() {
injection.Default.RegisterInformer(withInformer)
}
// Key is used for associating the Informer inside the context.Context.
type Key struct{}
func withInformer(ctx context.Context) (context.Context, controller.Informer) {
f := factory.Get(ctx)
inf := f.Core().V1().Nodes()
return context.WithValue(ctx, Key{}, inf), inf.Informer()
}
// Get extracts the typed informer from the context.
func Get(ctx context.Context) v1.NodeInformer {
untyped := ctx.Value(Key{})
if untyped == nil {
logging.FromContext(ctx).Panic(
"Unable to fetch k8s.io/client-go/informers/core/v1.NodeInformer from context.")
}
return untyped.(v1.NodeInformer)
}

View File

@ -0,0 +1,40 @@
/*
Copyright 2019 The Knative Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package fake
import (
"context"
persistentvolume "knative.dev/pkg/client/injection/kube/informers/core/v1/persistentvolume"
fake "knative.dev/pkg/client/injection/kube/informers/factory/fake"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
)
var Get = persistentvolume.Get
func init() {
injection.Fake.RegisterInformer(withInformer)
}
func withInformer(ctx context.Context) (context.Context, controller.Informer) {
f := fake.Get(ctx)
inf := f.Core().V1().PersistentVolumes()
return context.WithValue(ctx, persistentvolume.Key{}, inf), inf.Informer()
}

View File

@ -0,0 +1,52 @@
/*
Copyright 2019 The Knative Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package persistentvolume
import (
"context"
v1 "k8s.io/client-go/informers/core/v1"
factory "knative.dev/pkg/client/injection/kube/informers/factory"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
logging "knative.dev/pkg/logging"
)
func init() {
injection.Default.RegisterInformer(withInformer)
}
// Key is used for associating the Informer inside the context.Context.
type Key struct{}
func withInformer(ctx context.Context) (context.Context, controller.Informer) {
f := factory.Get(ctx)
inf := f.Core().V1().PersistentVolumes()
return context.WithValue(ctx, Key{}, inf), inf.Informer()
}
// Get extracts the typed informer from the context.
func Get(ctx context.Context) v1.PersistentVolumeInformer {
untyped := ctx.Value(Key{})
if untyped == nil {
logging.FromContext(ctx).Panic(
"Unable to fetch k8s.io/client-go/informers/core/v1.PersistentVolumeInformer from context.")
}
return untyped.(v1.PersistentVolumeInformer)
}

View File

@ -0,0 +1,40 @@
/*
Copyright 2019 The Knative Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package fake
import (
"context"
persistentvolumeclaim "knative.dev/pkg/client/injection/kube/informers/core/v1/persistentvolumeclaim"
fake "knative.dev/pkg/client/injection/kube/informers/factory/fake"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
)
var Get = persistentvolumeclaim.Get
func init() {
injection.Fake.RegisterInformer(withInformer)
}
func withInformer(ctx context.Context) (context.Context, controller.Informer) {
f := fake.Get(ctx)
inf := f.Core().V1().PersistentVolumeClaims()
return context.WithValue(ctx, persistentvolumeclaim.Key{}, inf), inf.Informer()
}

View File

@ -0,0 +1,52 @@
/*
Copyright 2019 The Knative Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package persistentvolumeclaim
import (
"context"
v1 "k8s.io/client-go/informers/core/v1"
factory "knative.dev/pkg/client/injection/kube/informers/factory"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
logging "knative.dev/pkg/logging"
)
func init() {
injection.Default.RegisterInformer(withInformer)
}
// Key is used for associating the Informer inside the context.Context.
type Key struct{}
func withInformer(ctx context.Context) (context.Context, controller.Informer) {
f := factory.Get(ctx)
inf := f.Core().V1().PersistentVolumeClaims()
return context.WithValue(ctx, Key{}, inf), inf.Informer()
}
// Get extracts the typed informer from the context.
func Get(ctx context.Context) v1.PersistentVolumeClaimInformer {
untyped := ctx.Value(Key{})
if untyped == nil {
logging.FromContext(ctx).Panic(
"Unable to fetch k8s.io/client-go/informers/core/v1.PersistentVolumeClaimInformer from context.")
}
return untyped.(v1.PersistentVolumeClaimInformer)
}

View File

@ -14,15 +14,17 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package fake
import (
"context"
"knative.dev/pkg/controller"
"knative.dev/pkg/injection"
"knative.dev/pkg/injection/informers/kubeinformers/corev1/pod"
"knative.dev/pkg/injection/informers/kubeinformers/factory/fake"
pod "knative.dev/pkg/client/injection/kube/informers/core/v1/pod"
fake "knative.dev/pkg/client/injection/kube/informers/factory/fake"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
)
var Get = pod.Get

View File

@ -14,25 +14,25 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package pod
import (
"context"
corev1 "k8s.io/client-go/informers/core/v1"
"knative.dev/pkg/controller"
"knative.dev/pkg/injection"
"knative.dev/pkg/injection/informers/kubeinformers/factory"
"knative.dev/pkg/logging"
v1 "k8s.io/client-go/informers/core/v1"
factory "knative.dev/pkg/client/injection/kube/informers/factory"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
logging "knative.dev/pkg/logging"
)
func init() {
injection.Default.RegisterInformer(withInformer)
}
// Key is used as the key for associating information
// with a context.Context.
// Key is used for associating the Informer inside the context.Context.
type Key struct{}
func withInformer(ctx context.Context) (context.Context, controller.Informer) {
@ -41,12 +41,12 @@ func withInformer(ctx context.Context) (context.Context, controller.Informer) {
return context.WithValue(ctx, Key{}, inf), inf.Informer()
}
// Get extracts the Kubernetes Pod informer from the context.
func Get(ctx context.Context) corev1.PodInformer {
// Get extracts the typed informer from the context.
func Get(ctx context.Context) v1.PodInformer {
untyped := ctx.Value(Key{})
if untyped == nil {
logging.FromContext(ctx).Panicf(
"Unable to fetch %T from context.", (corev1.PodInformer)(nil))
logging.FromContext(ctx).Panic(
"Unable to fetch k8s.io/client-go/informers/core/v1.PodInformer from context.")
}
return untyped.(corev1.PodInformer)
return untyped.(v1.PodInformer)
}

View File

@ -0,0 +1,40 @@
/*
Copyright 2019 The Knative Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package fake
import (
"context"
podtemplate "knative.dev/pkg/client/injection/kube/informers/core/v1/podtemplate"
fake "knative.dev/pkg/client/injection/kube/informers/factory/fake"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
)
var Get = podtemplate.Get
func init() {
injection.Fake.RegisterInformer(withInformer)
}
func withInformer(ctx context.Context) (context.Context, controller.Informer) {
f := fake.Get(ctx)
inf := f.Core().V1().PodTemplates()
return context.WithValue(ctx, podtemplate.Key{}, inf), inf.Informer()
}

View File

@ -0,0 +1,52 @@
/*
Copyright 2019 The Knative Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package podtemplate
import (
"context"
v1 "k8s.io/client-go/informers/core/v1"
factory "knative.dev/pkg/client/injection/kube/informers/factory"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
logging "knative.dev/pkg/logging"
)
func init() {
injection.Default.RegisterInformer(withInformer)
}
// Key is used for associating the Informer inside the context.Context.
type Key struct{}
func withInformer(ctx context.Context) (context.Context, controller.Informer) {
f := factory.Get(ctx)
inf := f.Core().V1().PodTemplates()
return context.WithValue(ctx, Key{}, inf), inf.Informer()
}
// Get extracts the typed informer from the context.
func Get(ctx context.Context) v1.PodTemplateInformer {
untyped := ctx.Value(Key{})
if untyped == nil {
logging.FromContext(ctx).Panic(
"Unable to fetch k8s.io/client-go/informers/core/v1.PodTemplateInformer from context.")
}
return untyped.(v1.PodTemplateInformer)
}

View File

@ -0,0 +1,40 @@
/*
Copyright 2019 The Knative Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package fake
import (
"context"
replicationcontroller "knative.dev/pkg/client/injection/kube/informers/core/v1/replicationcontroller"
fake "knative.dev/pkg/client/injection/kube/informers/factory/fake"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
)
var Get = replicationcontroller.Get
func init() {
injection.Fake.RegisterInformer(withInformer)
}
func withInformer(ctx context.Context) (context.Context, controller.Informer) {
f := fake.Get(ctx)
inf := f.Core().V1().ReplicationControllers()
return context.WithValue(ctx, replicationcontroller.Key{}, inf), inf.Informer()
}

View File

@ -0,0 +1,52 @@
/*
Copyright 2019 The Knative Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package replicationcontroller
import (
"context"
v1 "k8s.io/client-go/informers/core/v1"
factory "knative.dev/pkg/client/injection/kube/informers/factory"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
logging "knative.dev/pkg/logging"
)
func init() {
injection.Default.RegisterInformer(withInformer)
}
// Key is used for associating the Informer inside the context.Context.
type Key struct{}
func withInformer(ctx context.Context) (context.Context, controller.Informer) {
f := factory.Get(ctx)
inf := f.Core().V1().ReplicationControllers()
return context.WithValue(ctx, Key{}, inf), inf.Informer()
}
// Get extracts the typed informer from the context.
func Get(ctx context.Context) v1.ReplicationControllerInformer {
untyped := ctx.Value(Key{})
if untyped == nil {
logging.FromContext(ctx).Panic(
"Unable to fetch k8s.io/client-go/informers/core/v1.ReplicationControllerInformer from context.")
}
return untyped.(v1.ReplicationControllerInformer)
}

View File

@ -14,15 +14,17 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package fake
import (
"context"
"knative.dev/pkg/controller"
"knative.dev/pkg/injection"
"knative.dev/pkg/injection/informers/kubeinformers/corev1/resourcequota"
"knative.dev/pkg/injection/informers/kubeinformers/factory/fake"
resourcequota "knative.dev/pkg/client/injection/kube/informers/core/v1/resourcequota"
fake "knative.dev/pkg/client/injection/kube/informers/factory/fake"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
)
var Get = resourcequota.Get

View File

@ -14,25 +14,25 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package resourcequota
import (
"context"
corev1 "k8s.io/client-go/informers/core/v1"
"knative.dev/pkg/controller"
"knative.dev/pkg/injection"
"knative.dev/pkg/injection/informers/kubeinformers/factory"
"knative.dev/pkg/logging"
v1 "k8s.io/client-go/informers/core/v1"
factory "knative.dev/pkg/client/injection/kube/informers/factory"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
logging "knative.dev/pkg/logging"
)
func init() {
injection.Default.RegisterInformer(withInformer)
}
// Key is used as the key for associating information
// with a context.Context.
// Key is used for associating the Informer inside the context.Context.
type Key struct{}
func withInformer(ctx context.Context) (context.Context, controller.Informer) {
@ -41,12 +41,12 @@ func withInformer(ctx context.Context) (context.Context, controller.Informer) {
return context.WithValue(ctx, Key{}, inf), inf.Informer()
}
// Get extracts the Kubernetes ResourceQuota informer from the context.
func Get(ctx context.Context) corev1.ResourceQuotaInformer {
// Get extracts the typed informer from the context.
func Get(ctx context.Context) v1.ResourceQuotaInformer {
untyped := ctx.Value(Key{})
if untyped == nil {
logging.FromContext(ctx).Panicf(
"Unable to fetch %T from context.", (corev1.ResourceQuotaInformer)(nil))
logging.FromContext(ctx).Panic(
"Unable to fetch k8s.io/client-go/informers/core/v1.ResourceQuotaInformer from context.")
}
return untyped.(corev1.ResourceQuotaInformer)
return untyped.(v1.ResourceQuotaInformer)
}

View File

@ -14,15 +14,17 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package fake
import (
"context"
"knative.dev/pkg/controller"
"knative.dev/pkg/injection"
"knative.dev/pkg/injection/informers/kubeinformers/corev1/secret"
"knative.dev/pkg/injection/informers/kubeinformers/factory/fake"
secret "knative.dev/pkg/client/injection/kube/informers/core/v1/secret"
fake "knative.dev/pkg/client/injection/kube/informers/factory/fake"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
)
var Get = secret.Get

View File

@ -14,25 +14,25 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package secret
import (
"context"
corev1 "k8s.io/client-go/informers/core/v1"
"knative.dev/pkg/controller"
"knative.dev/pkg/injection"
"knative.dev/pkg/injection/informers/kubeinformers/factory"
"knative.dev/pkg/logging"
v1 "k8s.io/client-go/informers/core/v1"
factory "knative.dev/pkg/client/injection/kube/informers/factory"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
logging "knative.dev/pkg/logging"
)
func init() {
injection.Default.RegisterInformer(withInformer)
}
// Key is used as the key for associating information
// with a context.Context.
// Key is used for associating the Informer inside the context.Context.
type Key struct{}
func withInformer(ctx context.Context) (context.Context, controller.Informer) {
@ -41,12 +41,12 @@ func withInformer(ctx context.Context) (context.Context, controller.Informer) {
return context.WithValue(ctx, Key{}, inf), inf.Informer()
}
// Get extracts the Kubernetes Secret informer from the context.
func Get(ctx context.Context) corev1.SecretInformer {
// Get extracts the typed informer from the context.
func Get(ctx context.Context) v1.SecretInformer {
untyped := ctx.Value(Key{})
if untyped == nil {
logging.FromContext(ctx).Panicf(
"Unable to fetch %T from context.", (corev1.SecretInformer)(nil))
logging.FromContext(ctx).Panic(
"Unable to fetch k8s.io/client-go/informers/core/v1.SecretInformer from context.")
}
return untyped.(corev1.SecretInformer)
return untyped.(v1.SecretInformer)
}

View File

@ -14,15 +14,17 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package fake
import (
"context"
"knative.dev/pkg/controller"
"knative.dev/pkg/injection"
"knative.dev/pkg/injection/informers/kubeinformers/corev1/service"
"knative.dev/pkg/injection/informers/kubeinformers/factory/fake"
service "knative.dev/pkg/client/injection/kube/informers/core/v1/service"
fake "knative.dev/pkg/client/injection/kube/informers/factory/fake"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
)
var Get = service.Get

View File

@ -14,25 +14,25 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package service
import (
"context"
corev1 "k8s.io/client-go/informers/core/v1"
"knative.dev/pkg/controller"
"knative.dev/pkg/injection"
"knative.dev/pkg/injection/informers/kubeinformers/factory"
"knative.dev/pkg/logging"
v1 "k8s.io/client-go/informers/core/v1"
factory "knative.dev/pkg/client/injection/kube/informers/factory"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
logging "knative.dev/pkg/logging"
)
func init() {
injection.Default.RegisterInformer(withInformer)
}
// Key is used as the key for associating information
// with a context.Context.
// Key is used for associating the Informer inside the context.Context.
type Key struct{}
func withInformer(ctx context.Context) (context.Context, controller.Informer) {
@ -41,12 +41,12 @@ func withInformer(ctx context.Context) (context.Context, controller.Informer) {
return context.WithValue(ctx, Key{}, inf), inf.Informer()
}
// Get extracts the Kubernetes Service informer from the context.
func Get(ctx context.Context) corev1.ServiceInformer {
// Get extracts the typed informer from the context.
func Get(ctx context.Context) v1.ServiceInformer {
untyped := ctx.Value(Key{})
if untyped == nil {
logging.FromContext(ctx).Panicf(
"Unable to fetch %T from context.", (corev1.ServiceInformer)(nil))
logging.FromContext(ctx).Panic(
"Unable to fetch k8s.io/client-go/informers/core/v1.ServiceInformer from context.")
}
return untyped.(corev1.ServiceInformer)
return untyped.(v1.ServiceInformer)
}

View File

@ -14,15 +14,17 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package fake
import (
"context"
"knative.dev/pkg/controller"
"knative.dev/pkg/injection"
"knative.dev/pkg/injection/informers/kubeinformers/corev1/serviceaccount"
"knative.dev/pkg/injection/informers/kubeinformers/factory/fake"
serviceaccount "knative.dev/pkg/client/injection/kube/informers/core/v1/serviceaccount"
fake "knative.dev/pkg/client/injection/kube/informers/factory/fake"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
)
var Get = serviceaccount.Get

View File

@ -14,25 +14,25 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package serviceaccount
import (
"context"
corev1 "k8s.io/client-go/informers/core/v1"
"knative.dev/pkg/controller"
"knative.dev/pkg/injection"
"knative.dev/pkg/injection/informers/kubeinformers/factory"
"knative.dev/pkg/logging"
v1 "k8s.io/client-go/informers/core/v1"
factory "knative.dev/pkg/client/injection/kube/informers/factory"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
logging "knative.dev/pkg/logging"
)
func init() {
injection.Default.RegisterInformer(withInformer)
}
// Key is used as the key for associating information
// with a context.Context.
// Key is used for associating the Informer inside the context.Context.
type Key struct{}
func withInformer(ctx context.Context) (context.Context, controller.Informer) {
@ -41,12 +41,12 @@ func withInformer(ctx context.Context) (context.Context, controller.Informer) {
return context.WithValue(ctx, Key{}, inf), inf.Informer()
}
// Get extracts the Kubernetes Service Account informer from the context.
func Get(ctx context.Context) corev1.ServiceAccountInformer {
// Get extracts the typed informer from the context.
func Get(ctx context.Context) v1.ServiceAccountInformer {
untyped := ctx.Value(Key{})
if untyped == nil {
logging.FromContext(ctx).Panicf(
"Unable to fetch %T from context.", (corev1.ServiceAccountInformer)(nil))
logging.FromContext(ctx).Panic(
"Unable to fetch k8s.io/client-go/informers/core/v1.ServiceAccountInformer from context.")
}
return untyped.(corev1.ServiceAccountInformer)
return untyped.(v1.ServiceAccountInformer)
}

View File

@ -14,43 +14,43 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package factory
import (
"context"
"k8s.io/client-go/informers"
"knative.dev/pkg/controller"
"knative.dev/pkg/injection"
"knative.dev/pkg/injection/clients/kubeclient"
"knative.dev/pkg/logging"
informers "k8s.io/client-go/informers"
client "knative.dev/pkg/client/injection/kube/client"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
logging "knative.dev/pkg/logging"
)
func init() {
injection.Default.RegisterInformerFactory(withInformerFactory)
}
// Key is used as the key for associating information
// with a context.Context.
// Key is used as the key for associating information with a context.Context.
type Key struct{}
func withInformerFactory(ctx context.Context) context.Context {
kc := kubeclient.Get(ctx)
c := client.Get(ctx)
opts := make([]informers.SharedInformerOption, 0, 1)
if injection.HasNamespaceScope(ctx) {
opts = append(opts, informers.WithNamespace(injection.GetNamespaceScope(ctx)))
}
return context.WithValue(ctx, Key{},
informers.NewSharedInformerFactoryWithOptions(kc, controller.GetResyncPeriod(ctx), opts...))
informers.NewSharedInformerFactoryWithOptions(c, controller.GetResyncPeriod(ctx), opts...))
}
// Get extracts the Kubernetes InformerFactory from the context.
// Get extracts the InformerFactory from the context.
func Get(ctx context.Context) informers.SharedInformerFactory {
untyped := ctx.Value(Key{})
if untyped == nil {
logging.FromContext(ctx).Panicf(
"Unable to fetch %T from context.", (informers.SharedInformerFactory)(nil))
logging.FromContext(ctx).Panic(
"Unable to fetch k8s.io/client-go/informers.SharedInformerFactory from context.")
}
return untyped.(informers.SharedInformerFactory)
}

View File

@ -14,17 +14,18 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package fake
import (
"context"
"k8s.io/client-go/informers"
"knative.dev/pkg/controller"
"knative.dev/pkg/injection"
"knative.dev/pkg/injection/clients/kubeclient/fake"
"knative.dev/pkg/injection/informers/kubeinformers/factory"
informers "k8s.io/client-go/informers"
fake "knative.dev/pkg/client/injection/kube/client/fake"
factory "knative.dev/pkg/client/injection/kube/informers/factory"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
)
var Get = factory.Get
@ -34,11 +35,11 @@ func init() {
}
func withInformerFactory(ctx context.Context) context.Context {
kc := fake.Get(ctx)
c := fake.Get(ctx)
opts := make([]informers.SharedInformerOption, 0, 1)
if injection.HasNamespaceScope(ctx) {
opts = append(opts, informers.WithNamespace(injection.GetNamespaceScope(ctx)))
}
return context.WithValue(ctx, factory.Key{},
informers.NewSharedInformerFactoryWithOptions(kc, controller.GetResyncPeriod(ctx), opts...))
informers.NewSharedInformerFactoryWithOptions(c, controller.GetResyncPeriod(ctx), opts...))
}

View File

@ -0,0 +1,52 @@
/*
Copyright 2019 The Knative Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package clusterrole
import (
"context"
v1 "k8s.io/client-go/informers/rbac/v1"
factory "knative.dev/pkg/client/injection/kube/informers/factory"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
logging "knative.dev/pkg/logging"
)
func init() {
injection.Default.RegisterInformer(withInformer)
}
// Key is used for associating the Informer inside the context.Context.
type Key struct{}
func withInformer(ctx context.Context) (context.Context, controller.Informer) {
f := factory.Get(ctx)
inf := f.Rbac().V1().ClusterRoles()
return context.WithValue(ctx, Key{}, inf), inf.Informer()
}
// Get extracts the typed informer from the context.
func Get(ctx context.Context) v1.ClusterRoleInformer {
untyped := ctx.Value(Key{})
if untyped == nil {
logging.FromContext(ctx).Panic(
"Unable to fetch k8s.io/client-go/informers/rbac/v1.ClusterRoleInformer from context.")
}
return untyped.(v1.ClusterRoleInformer)
}

View File

@ -0,0 +1,40 @@
/*
Copyright 2019 The Knative Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package fake
import (
"context"
fake "knative.dev/pkg/client/injection/kube/informers/factory/fake"
clusterrole "knative.dev/pkg/client/injection/kube/informers/rbac/v1/clusterrole"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
)
var Get = clusterrole.Get
func init() {
injection.Fake.RegisterInformer(withInformer)
}
func withInformer(ctx context.Context) (context.Context, controller.Informer) {
f := fake.Get(ctx)
inf := f.Rbac().V1().ClusterRoles()
return context.WithValue(ctx, clusterrole.Key{}, inf), inf.Informer()
}

View File

@ -0,0 +1,52 @@
/*
Copyright 2019 The Knative Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package clusterrolebinding
import (
"context"
v1 "k8s.io/client-go/informers/rbac/v1"
factory "knative.dev/pkg/client/injection/kube/informers/factory"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
logging "knative.dev/pkg/logging"
)
func init() {
injection.Default.RegisterInformer(withInformer)
}
// Key is used for associating the Informer inside the context.Context.
type Key struct{}
func withInformer(ctx context.Context) (context.Context, controller.Informer) {
f := factory.Get(ctx)
inf := f.Rbac().V1().ClusterRoleBindings()
return context.WithValue(ctx, Key{}, inf), inf.Informer()
}
// Get extracts the typed informer from the context.
func Get(ctx context.Context) v1.ClusterRoleBindingInformer {
untyped := ctx.Value(Key{})
if untyped == nil {
logging.FromContext(ctx).Panic(
"Unable to fetch k8s.io/client-go/informers/rbac/v1.ClusterRoleBindingInformer from context.")
}
return untyped.(v1.ClusterRoleBindingInformer)
}

View File

@ -0,0 +1,40 @@
/*
Copyright 2019 The Knative Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package fake
import (
"context"
fake "knative.dev/pkg/client/injection/kube/informers/factory/fake"
clusterrolebinding "knative.dev/pkg/client/injection/kube/informers/rbac/v1/clusterrolebinding"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
)
var Get = clusterrolebinding.Get
func init() {
injection.Fake.RegisterInformer(withInformer)
}
func withInformer(ctx context.Context) (context.Context, controller.Informer) {
f := fake.Get(ctx)
inf := f.Rbac().V1().ClusterRoleBindings()
return context.WithValue(ctx, clusterrolebinding.Key{}, inf), inf.Informer()
}

View File

@ -14,15 +14,17 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package fake
import (
"context"
"knative.dev/pkg/controller"
"knative.dev/pkg/injection"
"knative.dev/pkg/injection/informers/kubeinformers/factory/fake"
"knative.dev/pkg/injection/informers/kubeinformers/rbacv1/role"
fake "knative.dev/pkg/client/injection/kube/informers/factory/fake"
role "knative.dev/pkg/client/injection/kube/informers/rbac/v1/role"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
)
var Get = role.Get

View File

@ -14,25 +14,25 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package role
import (
"context"
rbacv1 "k8s.io/client-go/informers/rbac/v1"
"knative.dev/pkg/controller"
"knative.dev/pkg/injection"
"knative.dev/pkg/injection/informers/kubeinformers/factory"
"knative.dev/pkg/logging"
v1 "k8s.io/client-go/informers/rbac/v1"
factory "knative.dev/pkg/client/injection/kube/informers/factory"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
logging "knative.dev/pkg/logging"
)
func init() {
injection.Default.RegisterInformer(withInformer)
}
// Key is used as the key for associating information
// with a context.Context.
// Key is used for associating the Informer inside the context.Context.
type Key struct{}
func withInformer(ctx context.Context) (context.Context, controller.Informer) {
@ -41,12 +41,12 @@ func withInformer(ctx context.Context) (context.Context, controller.Informer) {
return context.WithValue(ctx, Key{}, inf), inf.Informer()
}
// Get extracts the Kubernetes Role Binding informer from the context.
func Get(ctx context.Context) rbacv1.RoleInformer {
// Get extracts the typed informer from the context.
func Get(ctx context.Context) v1.RoleInformer {
untyped := ctx.Value(Key{})
if untyped == nil {
logging.FromContext(ctx).Panicf(
"Unable to fetch %T from context.", (rbacv1.RoleInformer)(nil))
logging.FromContext(ctx).Panic(
"Unable to fetch k8s.io/client-go/informers/rbac/v1.RoleInformer from context.")
}
return untyped.(rbacv1.RoleInformer)
return untyped.(v1.RoleInformer)
}

View File

@ -14,15 +14,17 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package fake
import (
"context"
"knative.dev/pkg/controller"
"knative.dev/pkg/injection"
"knative.dev/pkg/injection/informers/kubeinformers/factory/fake"
"knative.dev/pkg/injection/informers/kubeinformers/rbacv1/rolebinding"
fake "knative.dev/pkg/client/injection/kube/informers/factory/fake"
rolebinding "knative.dev/pkg/client/injection/kube/informers/rbac/v1/rolebinding"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
)
var Get = rolebinding.Get

View File

@ -14,25 +14,25 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package rolebinding
import (
"context"
rbacv1 "k8s.io/client-go/informers/rbac/v1"
"knative.dev/pkg/controller"
"knative.dev/pkg/injection"
"knative.dev/pkg/injection/informers/kubeinformers/factory"
"knative.dev/pkg/logging"
v1 "k8s.io/client-go/informers/rbac/v1"
factory "knative.dev/pkg/client/injection/kube/informers/factory"
controller "knative.dev/pkg/controller"
injection "knative.dev/pkg/injection"
logging "knative.dev/pkg/logging"
)
func init() {
injection.Default.RegisterInformer(withInformer)
}
// Key is used as the key for associating information
// with a context.Context.
// Key is used for associating the Informer inside the context.Context.
type Key struct{}
func withInformer(ctx context.Context) (context.Context, controller.Informer) {
@ -41,12 +41,12 @@ func withInformer(ctx context.Context) (context.Context, controller.Informer) {
return context.WithValue(ctx, Key{}, inf), inf.Informer()
}
// Get extracts the Kubernetes Role Binding informer from the context.
func Get(ctx context.Context) rbacv1.RoleBindingInformer {
// Get extracts the typed informer from the context.
func Get(ctx context.Context) v1.RoleBindingInformer {
untyped := ctx.Value(Key{})
if untyped == nil {
logging.FromContext(ctx).Panicf(
"Unable to fetch %T from context.", (rbacv1.RoleBindingInformer)(nil))
logging.FromContext(ctx).Panic(
"Unable to fetch k8s.io/client-go/informers/rbac/v1.RoleBindingInformer from context.")
}
return untyped.(rbacv1.RoleBindingInformer)
return untyped.(v1.RoleBindingInformer)
}

View File

@ -94,8 +94,8 @@ func withClient(ctx context.Context, cfg *{{.restConfig|raw}}) context.Context {
func Get(ctx context.Context) {{.clientSetInterface|raw}} {
untyped := ctx.Value(Key{})
if untyped == nil {
{{.loggingFromContext|raw}}(ctx).Fatalf(
"Unable to fetch %T from context.", ({{.clientSetInterface|raw}})(nil))
{{.loggingFromContext|raw}}(ctx).Panic(
"Unable to fetch {{.clientSetInterface}} from context.")
}
return untyped.({{.clientSetInterface|raw}})
}

View File

@ -106,8 +106,8 @@ func withInformerFactory(ctx context.Context) context.Context {
func Get(ctx context.Context) {{.informersSharedInformerFactory|raw}} {
untyped := ctx.Value(Key{})
if untyped == nil {
{{.loggingFromContext|raw}}(ctx).Fatalf(
"Unable to fetch %T from context.", ({{.informersSharedInformerFactory|raw}})(nil))
{{.loggingFromContext|raw}}(ctx).Panic(
"Unable to fetch {{.informersSharedInformerFactory}} from context.")
}
return untyped.({{.informersSharedInformerFactory|raw}})
}

View File

@ -101,8 +101,8 @@ func With(ctx context.Context, objects ...runtime.Object) (context.Context, *{{.
func Get(ctx context.Context) *{{.fakeClient|raw}} {
untyped := ctx.Value({{.clientKey|raw}}{})
if untyped == nil {
{{.loggingFromContext|raw}}(ctx).Fatalf(
"Unable to fetch %T from context.", (*{{.fakeClient|raw}})(nil))
{{.loggingFromContext|raw}}(ctx).Panic(
"Unable to fetch {{.fakeClient}} from context.")
}
return untyped.(*fake.Clientset)
}

View File

@ -115,8 +115,8 @@ func withInformer(ctx context.Context) (context.Context, {{.controllerInformer|r
func Get(ctx context.Context) {{.informersTypedInformer|raw}} {
untyped := ctx.Value(Key{})
if untyped == nil {
{{.loggingFromContext|raw}}(ctx).Fatalf(
"Unable to fetch %T from context.", ({{.informersTypedInformer|raw}})(nil))
{{.loggingFromContext|raw}}(ctx).Panic(
"Unable to fetch {{.informersTypedInformer}} from context.")
}
return untyped.({{.informersTypedInformer|raw}})
}

View File

@ -89,6 +89,12 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat
groupGoNames[groupPackageName] = namer.IC(override[0])
}
// Generate the client and fake.
packageList = append(packageList, versionClientsPackages(versionPackagePath, boilerplate, customArgs)...)
// Generate the informer factory and fake.
packageList = append(packageList, versionFactoryPackages(versionPackagePath, boilerplate, customArgs)...)
var typesToGenerate []*types.Type
for _, t := range p.Types {
tags := util.MustParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...))
@ -120,12 +126,6 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat
orderer := namer.Orderer{Namer: namer.NewPrivateNamer(0)}
typesToGenerate = orderer.OrderTypes(typesToGenerate)
// Generate the client and fake.
packageList = append(packageList, versionClientsPackages(versionPackagePath, groupPackageName, gv, groupGoNames[groupPackageName], boilerplate, typesToGenerate, customArgs)...)
// Generate the informer factory and fake.
packageList = append(packageList, versionFactoryPackages(versionPackagePath, groupPackageName, gv, groupGoNames[groupPackageName], boilerplate, typesToGenerate, customArgs)...)
// Generate the informer and fake, for each type.
packageList = append(packageList, versionInformerPackages(versionPackagePath, groupPackageName, gv, groupGoNames[groupPackageName], boilerplate, typesToGenerate, customArgs)...)
}
@ -169,7 +169,7 @@ func typedInformerPackage(groupPkgName string, gv clientgentypes.GroupVersion, e
return filepath.Join(externalVersionsInformersPackage, groupPkgName, gv.Version.String())
}
func versionClientsPackages(basePackage string, groupPkgName string, gv clientgentypes.GroupVersion, groupGoName string, boilerplate []byte, typesToGenerate []*types.Type, customArgs *informergenargs.CustomArgs) []generator.Package {
func versionClientsPackages(basePackage string, boilerplate []byte, customArgs *informergenargs.CustomArgs) []generator.Package {
packagePath := filepath.Join(basePackage, "client")
vers := make([]generator.Package, 0, 2)
@ -227,21 +227,21 @@ func versionClientsPackages(basePackage string, groupPkgName string, gv clientge
return vers
}
func versionFactoryPackages(basePackage string, groupPkgName string, gv clientgentypes.GroupVersion, groupGoName string, boilerplate []byte, typesToGenerate []*types.Type, customArgs *informergenargs.CustomArgs) []generator.Package {
packagePath := filepath.Join(basePackage, "informers", groupPkgName, "factory")
func versionFactoryPackages(basePackage string, boilerplate []byte, customArgs *informergenargs.CustomArgs) []generator.Package {
packagePath := filepath.Join(basePackage, "informers", "factory")
vers := make([]generator.Package, 0, 2)
// Impl
vers = append(vers, &generator.DefaultPackage{
PackageName: strings.ToLower(groupPkgName + "factory"),
PackageName: "factory",
PackagePath: packagePath,
HeaderText: boilerplate,
GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) {
// Impl
generators = append(generators, &factoryGenerator{
DefaultGen: generator.DefaultGen{
OptionalName: groupPkgName + "factory",
OptionalName: "factory",
},
outputPackage: packagePath,
cachingClientSetPackage: fmt.Sprintf("%s/client", basePackage),
@ -288,7 +288,7 @@ func versionFactoryPackages(basePackage string, groupPkgName string, gv clientge
}
func versionInformerPackages(basePackage string, groupPkgName string, gv clientgentypes.GroupVersion, groupGoName string, boilerplate []byte, typesToGenerate []*types.Type, customArgs *informergenargs.CustomArgs) []generator.Package {
factoryPackagePath := filepath.Join(basePackage, "informers", groupPkgName, "factory")
factoryPackagePath := filepath.Join(basePackage, "informers", "factory")
packagePath := filepath.Join(basePackage, "informers", groupPkgName, strings.ToLower(gv.Version.NonEmpty()))
vers := make([]generator.Package, 0, len(typesToGenerate))

View File

@ -23,10 +23,10 @@ set -o pipefail
if [ "$#" -lt 4 ] || [ "${1}" == "--help" ]; then
cat <<EOF
Usage: $(basename $0) <generators> <output-package> <apis-package> <groups-versions> ...
Usage: $(basename $0) <generators> <client-package> <apis-package> <groups-versions> ...
<generators> the generators comma separated to run (deepcopy,defaulter,client,lister,informer) or "all".
<output-package> the output package name (e.g. github.com/example/project/pkg/generated).
<client-package> the client package dir (e.g. github.com/example/project/pkg/clientset).
<apis-package> the external types dir (e.g. github.com/example/api or github.com/example/project/pkg/apis).
<groups-versions> the groups and their versions in the format "groupA:v1,v2 groupB:v1 groupC:v2", relative
to <api-package>.
@ -41,7 +41,7 @@ EOF
fi
GENS="$1"
OUTPUT_PKG="$2"
CLIENT_PKG="$2"
APIS_PKG="$3"
GROUPS_WITH_VERSIONS="$4"
shift 4
@ -66,13 +66,30 @@ for GVs in ${GROUPS_WITH_VERSIONS}; do
done
done
if grep -qw "injection" <<<"${GENS}"; then
echo "Generating injection for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/injection"
if [[ -z "${OUTPUT_PKG:-}" ]]; then
OUTPUT_PKG="${CLIENT_PKG}/injection"
fi
if [[ -z "${VERSIONED_CLIENTSET_PKG:-}" ]]; then
VERSIONED_CLIENTSET_PKG="${CLIENT_PKG}/clientset/versioned"
fi
if [[ -z "${EXTERNAL_INFORMER_PKG:-}" ]]; then
EXTERNAL_INFORMER_PKG="${CLIENT_PKG}/informers/externalversions"
fi
echo "Generating injection for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}"
# Clear old injection
rm -rf ${OUTPUT_PKG}
${GOPATH}/bin/injection-gen \
--input-dirs $(codegen::join , "${FQ_APIS[@]}") \
--versioned-clientset-package ${OUTPUT_PKG}/clientset/versioned \
--external-versions-informers-package ${OUTPUT_PKG}/informers/externalversions \
--output-package ${OUTPUT_PKG}/injection \
"$@"
--input-dirs $(codegen::join , "${FQ_APIS[@]}") \
--versioned-clientset-package ${VERSIONED_CLIENTSET_PKG} \
--external-versions-informers-package ${EXTERNAL_INFORMER_PKG} \
--output-package ${OUTPUT_PKG} \
"$@"
fi

View File

@ -39,6 +39,23 @@ ${REPO_ROOT_DIR}/hack/generate-knative.sh "injection" \
"istio:v1alpha3 istio/authentication:v1alpha1" \
--go-header-file ${REPO_ROOT_DIR}/hack/boilerplate/boilerplate.go.txt
OUTPUT_PKG="knative.dev/pkg/client/injection/kube" \
VERSIONED_CLIENTSET_PKG="k8s.io/client-go/kubernetes" \
EXTERNAL_INFORMER_PKG="k8s.io/client-go/informers" \
${REPO_ROOT_DIR}/hack/generate-knative.sh "injection" \
k8s.io/client-go \
k8s.io/api \
"apps:v1 autoscaling:v1,v2beta1 batch:v1,v1beta1 core:v1 rbac:v1" \
--go-header-file ${REPO_ROOT_DIR}/hack/boilerplate/boilerplate.go.txt
OUTPUT_PKG="knative.dev/pkg/client/injection/apiextensions" \
VERSIONED_CLIENTSET_PKG="k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" \
${REPO_ROOT_DIR}/hack/generate-knative.sh "injection" \
k8s.io/apiextensions-apiserver/pkg/client \
k8s.io/apiextensions-apiserver/pkg/apis \
"apiextensions:v1beta1" \
--go-header-file ${REPO_ROOT_DIR}/hack/boilerplate/boilerplate.go.txt
# Only deepcopy the Duck types, as they are not real resources.
${CODEGEN_PKG}/generate-groups.sh "deepcopy" \
knative.dev/pkg/client knative.dev/pkg/apis \

View File

@ -1,57 +0,0 @@
/*
Copyright 2019 The Knative Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package factory
import (
"context"
"knative.dev/pkg/logging"
informers "k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions"
"knative.dev/pkg/controller"
"knative.dev/pkg/injection"
"knative.dev/pkg/injection/clients/apiextclient"
)
func init() {
injection.Default.RegisterInformerFactory(withInformerFactory)
}
// Key is used as the key for associating information
// with a context.Context.
type Key struct{}
func withInformerFactory(ctx context.Context) context.Context {
axc := apiextclient.Get(ctx)
opts := make([]informers.SharedInformerOption, 0, 1)
if injection.HasNamespaceScope(ctx) {
opts = append(opts, informers.WithNamespace(injection.GetNamespaceScope(ctx)))
}
return context.WithValue(ctx, Key{},
informers.NewSharedInformerFactoryWithOptions(axc, controller.GetResyncPeriod(ctx), opts...))
}
// Get extracts the Kubernetes Api Extensions InformerFactory from the context.
func Get(ctx context.Context) informers.SharedInformerFactory {
untyped := ctx.Value(Key{})
if untyped == nil {
logging.FromContext(ctx).Panicf(
"Unable to fetch %T from context.", (informers.SharedInformerFactory)(nil))
}
return untyped.(informers.SharedInformerFactory)
}

View File

@ -1,44 +0,0 @@
/*
Copyright 2019 The Knative Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package fake
import (
"context"
informers "k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions"
"knative.dev/pkg/controller"
"knative.dev/pkg/injection"
"knative.dev/pkg/injection/clients/apiextclient/fake"
"knative.dev/pkg/injection/informers/apiextinformers/factory"
)
var Get = factory.Get
func init() {
injection.Fake.RegisterInformerFactory(withInformerFactory)
}
func withInformerFactory(ctx context.Context) context.Context {
kc := fake.Get(ctx)
opts := make([]informers.SharedInformerOption, 0, 1)
if injection.HasNamespaceScope(ctx) {
opts = append(opts, informers.WithNamespace(injection.GetNamespaceScope(ctx)))
}
return context.WithValue(ctx, factory.Key{},
informers.NewSharedInformerFactoryWithOptions(kc, controller.GetResyncPeriod(ctx), opts...))
}

Some files were not shown because too many files have changed in this diff Show More