Commit 556f81fc authored by Geoff Simmons's avatar Geoff Simmons

Update to client-go for k8s 1.16.4.

parent 12b3a8c3
......@@ -26,7 +26,7 @@
all: k8s-ingress
KUBEVER=kubernetes-1.9.11
KUBEVER=kubernetes-1.16.4
install-code-gen:
go get k8s.io/code-generator/cmd/client-gen@$(KUBEVER)
go get k8s.io/code-generator/cmd/deepcopy-gen@$(KUBEVER)
......
......@@ -2,36 +2,14 @@ module code.uplex.de/uplex-varnish/k8s-ingress
require (
code.uplex.de/uplex-varnish/varnishapi v0.0.0-20181209154204-43826850baae
github.com/emicklei/go-restful v2.8.0+incompatible // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/go-openapi/spec v0.18.0 // indirect
github.com/gogo/protobuf v1.2.0 // indirect
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
github.com/golang/groupcache v0.0.0-20181024230925-c65c006176ff // indirect
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c // indirect
github.com/google/go-cmp v0.2.0
github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf // indirect
github.com/google/go-cmp v0.3.0
github.com/googleapis/gnostic v0.2.0 // indirect
github.com/gregjones/httpcache v0.0.0-20181110185634-c63ab54fda8f // indirect
github.com/hashicorp/golang-lru v0.5.0 // indirect
github.com/howeyc/gopass v0.0.0-20170109162249-bf9dde6d0d2c // indirect
github.com/imdario/mergo v0.3.6 // indirect
github.com/json-iterator/go v1.1.5 // indirect
github.com/juju/ratelimit v1.0.1 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.1 // indirect
github.com/onsi/ginkgo v1.7.0 // indirect
github.com/onsi/gomega v1.4.3 // indirect
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
github.com/prometheus/client_golang v0.9.2
github.com/sirupsen/logrus v1.2.0
github.com/spf13/pflag v1.0.3 // indirect
golang.org/x/net v0.0.0-20190311183353-d8887717615a // indirect
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.2.2 // indirect
k8s.io/api v0.0.0-20181221193117-173ce66c1e39
k8s.io/apimachinery v0.0.0-20180925215425-1926e7bb5c13
k8s.io/client-go v6.0.1-0.20180515144434-1692bdde78a6+incompatible
k8s.io/kube-openapi v0.0.0-20181114233023-0317810137be // indirect
k8s.io/api v0.16.4
k8s.io/apimachinery v0.16.4
k8s.io/client-go v0.16.4
)
This diff is collapsed.
......@@ -145,7 +145,7 @@ func (in *BackendConfig) DeepCopyObject() runtime.Object {
func (in *BackendConfigList) DeepCopyInto(out *BackendConfigList) {
*out = *in
out.TypeMeta = in.TypeMeta
out.ListMeta = in.ListMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]BackendConfig, len(*in))
......@@ -501,7 +501,7 @@ func (in *VarnishConfig) DeepCopyObject() runtime.Object {
func (in *VarnishConfigList) DeepCopyInto(out *VarnishConfigList) {
*out = *in
out.TypeMeta = in.TypeMeta
out.ListMeta = in.ListMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]VarnishConfig, len(*in))
......
......@@ -29,8 +29,9 @@
package versioned
import (
"fmt"
ingressv1alpha1 "code.uplex.de/uplex-varnish/k8s-ingress/pkg/client/clientset/versioned/typed/varnishingress/v1alpha1"
glog "github.com/golang/glog"
discovery "k8s.io/client-go/discovery"
rest "k8s.io/client-go/rest"
flowcontrol "k8s.io/client-go/util/flowcontrol"
......@@ -39,8 +40,6 @@ import (
type Interface interface {
Discovery() discovery.DiscoveryInterface
IngressV1alpha1() ingressv1alpha1.IngressV1alpha1Interface
// Deprecated: please explicitly pick a version if possible.
Ingress() ingressv1alpha1.IngressV1alpha1Interface
}
// Clientset contains the clients for groups. Each group has exactly one
......@@ -55,12 +54,6 @@ func (c *Clientset) IngressV1alpha1() ingressv1alpha1.IngressV1alpha1Interface {
return c.ingressV1alpha1
}
// Deprecated: Ingress retrieves the default version of IngressClient.
// Please explicitly pick a version.
func (c *Clientset) Ingress() ingressv1alpha1.IngressV1alpha1Interface {
return c.ingressV1alpha1
}
// Discovery retrieves the DiscoveryClient
func (c *Clientset) Discovery() discovery.DiscoveryInterface {
if c == nil {
......@@ -70,9 +63,14 @@ func (c *Clientset) Discovery() discovery.DiscoveryInterface {
}
// NewForConfig creates a new Clientset for the given config.
// If config's RateLimiter is not set and QPS and Burst are acceptable,
// NewForConfig will generate a rate-limiter in configShallowCopy.
func NewForConfig(c *rest.Config) (*Clientset, error) {
configShallowCopy := *c
if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 {
if configShallowCopy.Burst <= 0 {
return nil, fmt.Errorf("Burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0")
}
configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst)
}
var cs Clientset
......@@ -84,7 +82,6 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy)
if err != nil {
glog.Errorf("failed to create the DiscoveryClient: %v", err)
return nil, err
}
return &cs, nil
......
......@@ -51,11 +51,20 @@ func NewSimpleClientset(objects ...runtime.Object) *Clientset {
}
}
fakePtr := testing.Fake{}
fakePtr.AddReactor("*", "*", testing.ObjectReaction(o))
fakePtr.AddWatchReactor("*", testing.DefaultWatchReactor(watch.NewFake(), nil))
cs := &Clientset{tracker: o}
cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake}
cs.AddReactor("*", "*", testing.ObjectReaction(o))
cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) {
gvr := action.GetResource()
ns := action.GetNamespace()
watch, err := o.Watch(gvr, ns)
if err != nil {
return false, nil, err
}
return true, watch, nil
})
return &Clientset{fakePtr, &fakediscovery.FakeDiscovery{Fake: &fakePtr}}
return cs
}
// Clientset implements clientset.Interface. Meant to be embedded into a
......@@ -64,20 +73,20 @@ func NewSimpleClientset(objects ...runtime.Object) *Clientset {
type Clientset struct {
testing.Fake
discovery *fakediscovery.FakeDiscovery
tracker testing.ObjectTracker
}
func (c *Clientset) Discovery() discovery.DiscoveryInterface {
return c.discovery
}
func (c *Clientset) Tracker() testing.ObjectTracker {
return c.tracker
}
var _ clientset.Interface = &Clientset{}
// IngressV1alpha1 retrieves the IngressV1alpha1Client
func (c *Clientset) IngressV1alpha1() ingressv1alpha1.IngressV1alpha1Interface {
return &fakeingressv1alpha1.FakeIngressV1alpha1{Fake: &c.Fake}
}
// Ingress retrieves the IngressV1alpha1Client
func (c *Clientset) Ingress() ingressv1alpha1.IngressV1alpha1Interface {
return &fakeingressv1alpha1.FakeIngressV1alpha1{Fake: &c.Fake}
}
......@@ -34,15 +34,14 @@ import (
runtime "k8s.io/apimachinery/pkg/runtime"
schema "k8s.io/apimachinery/pkg/runtime/schema"
serializer "k8s.io/apimachinery/pkg/runtime/serializer"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
)
var scheme = runtime.NewScheme()
var codecs = serializer.NewCodecFactory(scheme)
var parameterCodec = runtime.NewParameterCodec(scheme)
func init() {
v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"})
AddToScheme(scheme)
var localSchemeBuilder = runtime.SchemeBuilder{
ingressv1alpha1.AddToScheme,
}
// AddToScheme adds all types of this clientset into the given scheme. This allows composition
......@@ -50,16 +49,18 @@ func init() {
//
// import (
// "k8s.io/client-go/kubernetes"
// clientsetscheme "k8s.io/client-go/kuberentes/scheme"
// clientsetscheme "k8s.io/client-go/kubernetes/scheme"
// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
// )
//
// kclientset, _ := kubernetes.NewForConfig(c)
// aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
//
// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types
// correctly.
func AddToScheme(scheme *runtime.Scheme) {
ingressv1alpha1.AddToScheme(scheme)
var AddToScheme = localSchemeBuilder.AddToScheme
func init() {
v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"})
utilruntime.Must(AddToScheme(scheme))
}
......@@ -34,15 +34,14 @@ import (
runtime "k8s.io/apimachinery/pkg/runtime"
schema "k8s.io/apimachinery/pkg/runtime/schema"
serializer "k8s.io/apimachinery/pkg/runtime/serializer"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
)
var Scheme = runtime.NewScheme()
var Codecs = serializer.NewCodecFactory(Scheme)
var ParameterCodec = runtime.NewParameterCodec(Scheme)
func init() {
v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"})
AddToScheme(Scheme)
var localSchemeBuilder = runtime.SchemeBuilder{
ingressv1alpha1.AddToScheme,
}
// AddToScheme adds all types of this clientset into the given scheme. This allows composition
......@@ -50,16 +49,18 @@ func init() {
//
// import (
// "k8s.io/client-go/kubernetes"
// clientsetscheme "k8s.io/client-go/kuberentes/scheme"
// clientsetscheme "k8s.io/client-go/kubernetes/scheme"
// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
// )
//
// kclientset, _ := kubernetes.NewForConfig(c)
// aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
//
// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types
// correctly.
func AddToScheme(scheme *runtime.Scheme) {
ingressv1alpha1.AddToScheme(scheme)
var AddToScheme = localSchemeBuilder.AddToScheme
func init() {
v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"})
utilruntime.Must(AddToScheme(Scheme))
}
......@@ -29,6 +29,8 @@
package v1alpha1
import (
"time"
v1alpha1 "code.uplex.de/uplex-varnish/k8s-ingress/pkg/apis/varnishingress/v1alpha1"
scheme "code.uplex.de/uplex-varnish/k8s-ingress/pkg/client/clientset/versioned/scheme"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
......@@ -85,11 +87,16 @@ func (c *backendConfigs) Get(name string, options v1.GetOptions) (result *v1alph
// List takes label and field selectors, and returns the list of BackendConfigs that match those selectors.
func (c *backendConfigs) List(opts v1.ListOptions) (result *v1alpha1.BackendConfigList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.BackendConfigList{}
err = c.client.Get().
Namespace(c.ns).
Resource("backendconfigs").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Into(result)
return
......@@ -97,11 +104,16 @@ func (c *backendConfigs) List(opts v1.ListOptions) (result *v1alpha1.BackendConf
// Watch returns a watch.Interface that watches the requested backendConfigs.
func (c *backendConfigs) Watch(opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("backendconfigs").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
}
......@@ -143,10 +155,15 @@ func (c *backendConfigs) Delete(name string, options *v1.DeleteOptions) error {
// DeleteCollection deletes a collection of objects.
func (c *backendConfigs) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("backendconfigs").
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Error()
......
......@@ -72,7 +72,7 @@ func (c *FakeBackendConfigs) List(opts v1.ListOptions) (result *v1alpha1.Backend
if label == nil {
label = labels.Everything()
}
list := &v1alpha1.BackendConfigList{}
list := &v1alpha1.BackendConfigList{ListMeta: obj.(*v1alpha1.BackendConfigList).ListMeta}
for _, item := range obj.(*v1alpha1.BackendConfigList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
......@@ -129,7 +129,7 @@ func (c *FakeBackendConfigs) DeleteCollection(options *v1.DeleteOptions, listOpt
// Patch applies the patch and returns the patched backendConfig.
func (c *FakeBackendConfigs) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.BackendConfig, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(backendconfigsResource, c.ns, name, data, subresources...), &v1alpha1.BackendConfig{})
Invokes(testing.NewPatchSubresourceAction(backendconfigsResource, c.ns, name, pt, data, subresources...), &v1alpha1.BackendConfig{})
if obj == nil {
return nil, err
......
......@@ -72,7 +72,7 @@ func (c *FakeVarnishConfigs) List(opts v1.ListOptions) (result *v1alpha1.Varnish
if label == nil {
label = labels.Everything()
}
list := &v1alpha1.VarnishConfigList{}
list := &v1alpha1.VarnishConfigList{ListMeta: obj.(*v1alpha1.VarnishConfigList).ListMeta}
for _, item := range obj.(*v1alpha1.VarnishConfigList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
......@@ -129,7 +129,7 @@ func (c *FakeVarnishConfigs) DeleteCollection(options *v1.DeleteOptions, listOpt
// Patch applies the patch and returns the patched varnishConfig.
func (c *FakeVarnishConfigs) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.VarnishConfig, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(varnishconfigsResource, c.ns, name, data, subresources...), &v1alpha1.VarnishConfig{})
Invokes(testing.NewPatchSubresourceAction(varnishconfigsResource, c.ns, name, pt, data, subresources...), &v1alpha1.VarnishConfig{})
if obj == nil {
return nil, err
......
......@@ -29,6 +29,8 @@
package v1alpha1
import (
"time"
v1alpha1 "code.uplex.de/uplex-varnish/k8s-ingress/pkg/apis/varnishingress/v1alpha1"
scheme "code.uplex.de/uplex-varnish/k8s-ingress/pkg/client/clientset/versioned/scheme"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
......@@ -85,11 +87,16 @@ func (c *varnishConfigs) Get(name string, options v1.GetOptions) (result *v1alph
// List takes label and field selectors, and returns the list of VarnishConfigs that match those selectors.
func (c *varnishConfigs) List(opts v1.ListOptions) (result *v1alpha1.VarnishConfigList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.VarnishConfigList{}
err = c.client.Get().
Namespace(c.ns).
Resource("varnishconfigs").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Into(result)
return
......@@ -97,11 +104,16 @@ func (c *varnishConfigs) List(opts v1.ListOptions) (result *v1alpha1.VarnishConf
// Watch returns a watch.Interface that watches the requested varnishConfigs.
func (c *varnishConfigs) Watch(opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("varnishconfigs").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
}
......@@ -143,10 +155,15 @@ func (c *varnishConfigs) Delete(name string, options *v1.DeleteOptions) error {
// DeleteCollection deletes a collection of objects.
func (c *varnishConfigs) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("varnishconfigs").
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Error()
......
......@@ -31,7 +31,6 @@ package v1alpha1
import (
v1alpha1 "code.uplex.de/uplex-varnish/k8s-ingress/pkg/apis/varnishingress/v1alpha1"
"code.uplex.de/uplex-varnish/k8s-ingress/pkg/client/clientset/versioned/scheme"
serializer "k8s.io/apimachinery/pkg/runtime/serializer"
rest "k8s.io/client-go/rest"
)
......@@ -86,7 +85,7 @@ func setConfigDefaults(config *rest.Config) error {
gv := v1alpha1.SchemeGroupVersion
config.GroupVersion = &gv
config.APIPath = "/apis"
config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: scheme.Codecs}
config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
if config.UserAgent == "" {
config.UserAgent = rest.DefaultKubernetesUserAgent()
......
......@@ -26,8 +26,6 @@
// Code generated by informer-gen. DO NOT EDIT.
// This file was automatically generated by informer-gen
package externalversions
import (
......@@ -44,12 +42,16 @@ import (
cache "k8s.io/client-go/tools/cache"
)
// SharedInformerOption defines the functional option type for SharedInformerFactory.
type SharedInformerOption func(*sharedInformerFactory) *sharedInformerFactory
type sharedInformerFactory struct {
client versioned.Interface
namespace string
tweakListOptions internalinterfaces.TweakListOptionsFunc
lock sync.Mutex
defaultResync time.Duration
customResync map[reflect.Type]time.Duration
informers map[reflect.Type]cache.SharedIndexInformer
// startedInformers is used for tracking which informers have been started.
......@@ -57,23 +59,62 @@ type sharedInformerFactory struct {
startedInformers map[reflect.Type]bool
}
// NewSharedInformerFactory constructs a new instance of sharedInformerFactory
// WithCustomResyncConfig sets a custom resync period for the specified informer types.
func WithCustomResyncConfig(resyncConfig map[v1.Object]time.Duration) SharedInformerOption {
return func(factory *sharedInformerFactory) *sharedInformerFactory {
for k, v := range resyncConfig {
factory.customResync[reflect.TypeOf(k)] = v
}
return factory
}
}
// WithTweakListOptions sets a custom filter on all listers of the configured SharedInformerFactory.
func WithTweakListOptions(tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerOption {
return func(factory *sharedInformerFactory) *sharedInformerFactory {
factory.tweakListOptions = tweakListOptions
return factory
}
}
// WithNamespace limits the SharedInformerFactory to the specified namespace.
func WithNamespace(namespace string) SharedInformerOption {
return func(factory *sharedInformerFactory) *sharedInformerFactory {
factory.namespace = namespace
return factory
}
}
// NewSharedInformerFactory constructs a new instance of sharedInformerFactory for all namespaces.
func NewSharedInformerFactory(client versioned.Interface, defaultResync time.Duration) SharedInformerFactory {
return NewFilteredSharedInformerFactory(client, defaultResync, v1.NamespaceAll, nil)
return NewSharedInformerFactoryWithOptions(client, defaultResync)
}
// NewFilteredSharedInformerFactory constructs a new instance of sharedInformerFactory.
// Listers obtained via this SharedInformerFactory will be subject to the same filters
// as specified here.
// Deprecated: Please use NewSharedInformerFactoryWithOptions instead
func NewFilteredSharedInformerFactory(client versioned.Interface, defaultResync time.Duration, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerFactory {
return &sharedInformerFactory{
return NewSharedInformerFactoryWithOptions(client, defaultResync, WithNamespace(namespace), WithTweakListOptions(tweakListOptions))
}
// NewSharedInformerFactoryWithOptions constructs a new instance of a SharedInformerFactory with additional options.
func NewSharedInformerFactoryWithOptions(client versioned.Interface, defaultResync time.Duration, options ...SharedInformerOption) SharedInformerFactory {
factory := &sharedInformerFactory{
client: client,
namespace: namespace,
tweakListOptions: tweakListOptions,
namespace: v1.NamespaceAll,
defaultResync: defaultResync,
informers: make(map[reflect.Type]cache.SharedIndexInformer),
startedInformers: make(map[reflect.Type]bool),
customResync: make(map[reflect.Type]time.Duration),
}
// Apply all options
for _, opt := range options {
factory = opt(factory)
}
return factory
}
// Start initializes all requested informers.
......@@ -122,7 +163,13 @@ func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internal
if exists {
return informer
}
informer = newFunc(f.client, f.defaultResync)
resyncPeriod, exists := f.customResync[informerType]
if !exists {
resyncPeriod = f.defaultResync
}
informer = newFunc(f.client, resyncPeriod)
f.informers[informerType] = informer
return informer
......
......@@ -26,8 +26,6 @@
// Code generated by informer-gen. DO NOT EDIT.
// This file was automatically generated by informer-gen
package externalversions
import (
......
......@@ -26,8 +26,6 @@
// Code generated by informer-gen. DO NOT EDIT.
// This file was automatically generated by informer-gen
package internalinterfaces
import (
......@@ -39,6 +37,7 @@ import (
cache "k8s.io/client-go/tools/cache"
)
// NewInformerFunc takes versioned.Interface and time.Duration to return a SharedIndexInformer.
type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer
// SharedInformerFactory a small interface to allow for adding an informer without an import cycle
......@@ -47,4 +46,5 @@ type SharedInformerFactory interface {
InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer
}
// TweakListOptionsFunc is a function that transforms a v1.ListOptions.
type TweakListOptionsFunc func(*v1.ListOptions)
......@@ -26,9 +26,7 @@
// Code generated by informer-gen. DO NOT EDIT.
// This file was automatically generated by informer-gen
package ingress
package varnishingress
import (
internalinterfaces "code.uplex.de/uplex-varnish/k8s-ingress/pkg/client/informers/externalversions/internalinterfaces"
......
......@@ -26,8 +26,6 @@
// Code generated by informer-gen. DO NOT EDIT.
// This file was automatically generated by informer-gen
package v1alpha1
import (
......
......@@ -26,8 +26,6 @@
// Code generated by informer-gen. DO NOT EDIT.
// This file was automatically generated by informer-gen
package v1alpha1
import (
......
......@@ -26,8 +26,6 @@
// Code generated by informer-gen. DO NOT EDIT.
// This file was automatically generated by informer-gen
package v1alpha1
import (
......
......@@ -26,8 +26,6 @@
// Code generated by lister-gen. DO NOT EDIT.
// This file was automatically generated by lister-gen
package v1alpha1
import (
......
......@@ -26,8 +26,6 @@
// Code generated by lister-gen. DO NOT EDIT.
// This file was automatically generated by lister-gen
package v1alpha1
// BackendConfigListerExpansion allows custom methods to be added to
......
......@@ -26,8 +26,6 @@
// Code generated by lister-gen. DO NOT EDIT.
// This file was automatically generated by lister-gen
package v1alpha1
import (
......
......@@ -75,7 +75,7 @@ func (promProvider) NewAddsMetric(name string) workqueue.CounterMetric {
return adds
}
func (promProvider) NewLatencyMetric(name string) workqueue.SummaryMetric {
func (promProvider) NewLatencyMetric(name string) workqueue.HistogramMetric {
label := make(map[string]string)
label["namespace"] = name
latency := prometheus.NewSummary(prometheus.SummaryOpts{
......@@ -90,7 +90,9 @@ func (promProvider) NewLatencyMetric(name string) workqueue.SummaryMetric {
return latency
}
func (promProvider) NewWorkDurationMetric(name string) workqueue.SummaryMetric {
func (promProvider) NewWorkDurationMetric(
name string) workqueue.HistogramMetric {
label := make(map[string]string)
label["namespace"] = name
workDuration := prometheus.NewSummary(prometheus.SummaryOpts{
......@@ -119,6 +121,40 @@ func (promProvider) NewRetriesMetric(name string) workqueue.CounterMetric {
return retries
}
func (promProvider) NewLongestRunningProcessorSecondsMetric(
name string) workqueue.SettableGaugeMetric {
label := make(map[string]string)
label["namespace"] = name
longest := prometheus.NewGauge(prometheus.GaugeOpts{
Subsystem: workqSubsystem,
Namespace: namespace,
Name: "longest_running_seconds",
Help: "Time (in secs) spent by the longest running " +
"processor in the workqueue",
ConstLabels: label,
})
prometheus.Register(longest)
return longest
}
func (promProvider) NewUnfinishedWorkSecondsMetric(
name string) workqueue.SettableGaugeMetric {
label := make(map[string]string)
label["namespace"] = name
unfinished := prometheus.NewGauge(prometheus.GaugeOpts{
Subsystem: workqSubsystem,
Namespace: namespace,
Name: "unfinished_work_seconds",
Help: "Time (in secs) for work in the workqueue that is not " +
"yet observed by work_duration_useconds",
ConstLabels: label,
})
prometheus.Register(unfinished)
return unfinished
}
var (
watchCounters = prometheus.NewCounterVec(prometheus.CounterOpts{
Subsystem: "watcher",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment