Commit 635df9e7 authored by Geoff Simmons's avatar Geoff Simmons

Add the VarnishConfig Custom Resource, now used to config self-sharding.

This adds the client API for the Custom Resource in the group
ingress.varnish-cache.org, with generated code for the API.

Also adds the pkg/ path to the project, and moves the Makefile up
to the root directory, so that code builds in pkg/ and cmd/.
parent 6fd77519
*~ *~
# Build artifacts # Build artifacts
/cmd/k8s-ingress /k8s-ingress
/cmd/main_version.go /cmd/main_version.go
...@@ -29,12 +29,43 @@ all: k8s-ingress ...@@ -29,12 +29,43 @@ all: k8s-ingress
vgo: vgo:
go get golang.org/x/vgo go get golang.org/x/vgo
k8s-ingress: vgo KUBEVER=kubernetes-1.9.11
vgo generate install-code-gen:
vgo get k8s.io/code-generator/cmd/client-gen@$(KUBEVER)
vgo get k8s.io/code-generator/cmd/deepcopy-gen@$(KUBEVER)
vgo get k8s.io/code-generator/cmd/lister-gen@$(KUBEVER)
vgo get k8s.io/code-generator/cmd/informer-gen@$(KUBEVER)
build: vgo
vgo fmt ./... vgo fmt ./...
CGO_ENABLED=0 GOOS=linux vgo build -o k8s-ingress *.go vgo generate ./...
vgo build ./...
GENVER=code.uplex.de/uplex-varnish/k8s-ingress/pkg/apis/varnishingress/v1alpha1
BOILERPLATE=hack/boilerplate.txt
CLIENTPKG=code.uplex.de/uplex-varnish/k8s-ingress/pkg/client
CLIENTSET=$(CLIENTPKG)/clientset
LISTERS=$(CLIENTPKG)/listers
PKGMACHINERY=k8s.io/apimachinery/pkg
INPUTDIRS=$(PKGMACHINERY)/fields,$(PKGMACHINERY)/labels,$(PKGMACHINERY)/watch
generate: install-code-gen
deepcopy-gen -i $(GENVER) -O zz_generated.deepcopy \
--bounding-dirs $(GENVER) -h $(BOILERPLATE)
lister-gen -i $(GENVER) --output-package $(LISTERS) \
-h $(BOILERPLATE)
client-gen --clientset-name versioned --input-base "" -i $(INPUTDIRS) \
--input $(GENVER) --output-package $(CLIENTSET) \
--clientset-path $(CLIENTSET) -h $(BOILERPLATE)
informer-gen -i $(GENVER) \
--versioned-clientset-package $(CLIENTSET)/versioned \
--listers-package $(LISTERS) \
--output-package $(CLIENTPKG)/informers -h $(BOILERPLATE)
k8s-ingress: build
CGO_ENABLED=0 GOOS=linux vgo build -o k8s-ingress cmd/*.go
check: k8s-ingress check: build
golint ./... golint ./...
vgo test -v ./... vgo test -v ./...
...@@ -42,5 +73,5 @@ test: check ...@@ -42,5 +73,5 @@ test: check
clean: clean:
vgo clean ./... vgo clean ./...
rm -f main_version.go rm -f cmd/main_version.go
rm -f k8s-ingress rm -f k8s-ingress
...@@ -33,6 +33,8 @@ import ( ...@@ -33,6 +33,8 @@ import (
"time" "time"
"code.uplex.de/uplex-varnish/k8s-ingress/cmd/varnish" "code.uplex.de/uplex-varnish/k8s-ingress/cmd/varnish"
vcr_informers "code.uplex.de/uplex-varnish/k8s-ingress/pkg/client/informers/externalversions"
vcr_listers "code.uplex.de/uplex-varnish/k8s-ingress/pkg/client/listers/varnishingress/v1alpha1"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
...@@ -57,6 +59,7 @@ type infrmrs struct { ...@@ -57,6 +59,7 @@ type infrmrs struct {
svc cache.SharedIndexInformer svc cache.SharedIndexInformer
endp cache.SharedIndexInformer endp cache.SharedIndexInformer
secr cache.SharedIndexInformer secr cache.SharedIndexInformer
vcfg cache.SharedIndexInformer
} }
type Listers struct { type Listers struct {
...@@ -64,6 +67,7 @@ type Listers struct { ...@@ -64,6 +67,7 @@ type Listers struct {
svc core_v1_listers.ServiceLister svc core_v1_listers.ServiceLister
endp core_v1_listers.EndpointsLister endp core_v1_listers.EndpointsLister
secr core_v1_listers.SecretLister secr core_v1_listers.SecretLister
vcfg vcr_listers.VarnishConfigLister
} }
// IngressController watches Kubernetes API and reconfigures Varnish // IngressController watches Kubernetes API and reconfigures Varnish
...@@ -84,7 +88,8 @@ func NewIngressController( ...@@ -84,7 +88,8 @@ func NewIngressController(
log *logrus.Logger, log *logrus.Logger,
kubeClient kubernetes.Interface, kubeClient kubernetes.Interface,
vc *varnish.VarnishController, vc *varnish.VarnishController,
infFactory informers.SharedInformerFactory) *IngressController { infFactory informers.SharedInformerFactory,
vcrInfFactory vcr_informers.SharedInformerFactory) *IngressController {
ingc := IngressController{ ingc := IngressController{
log: log, log: log,
...@@ -108,6 +113,8 @@ func NewIngressController( ...@@ -108,6 +113,8 @@ func NewIngressController(
svc: infFactory.Core().V1().Services().Informer(), svc: infFactory.Core().V1().Services().Informer(),
endp: infFactory.Core().V1().Endpoints().Informer(), endp: infFactory.Core().V1().Endpoints().Informer(),
secr: infFactory.Core().V1().Secrets().Informer(), secr: infFactory.Core().V1().Secrets().Informer(),
vcfg: vcrInfFactory.Ingress().V1alpha1().VarnishConfigs().
Informer(),
} }
evtFuncs := cache.ResourceEventHandlerFuncs{ evtFuncs := cache.ResourceEventHandlerFuncs{
...@@ -120,12 +127,15 @@ func NewIngressController( ...@@ -120,12 +127,15 @@ func NewIngressController(
ingc.informers.svc.AddEventHandler(evtFuncs) ingc.informers.svc.AddEventHandler(evtFuncs)
ingc.informers.endp.AddEventHandler(evtFuncs) ingc.informers.endp.AddEventHandler(evtFuncs)
ingc.informers.secr.AddEventHandler(evtFuncs) ingc.informers.secr.AddEventHandler(evtFuncs)
ingc.informers.vcfg.AddEventHandler(evtFuncs)
ingc.listers = &Listers{ ingc.listers = &Listers{
ing: infFactory.Extensions().V1beta1().Ingresses().Lister(), ing: infFactory.Extensions().V1beta1().Ingresses().Lister(),
svc: infFactory.Core().V1().Services().Lister(), svc: infFactory.Core().V1().Services().Lister(),
endp: infFactory.Core().V1().Endpoints().Lister(), endp: infFactory.Core().V1().Endpoints().Lister(),
secr: infFactory.Core().V1().Secrets().Lister(), secr: infFactory.Core().V1().Secrets().Lister(),
vcfg: vcrInfFactory.Ingress().V1alpha1().VarnishConfigs().
Lister(),
} }
ingc.nsQs = NewNamespaceQueues(ingc.log, ingc.vController, ingc.listers, ingc.nsQs = NewNamespaceQueues(ingc.log, ingc.vController, ingc.listers,
...@@ -198,12 +208,20 @@ func (ingc *IngressController) Run() { ...@@ -198,12 +208,20 @@ func (ingc *IngressController) Run() {
defer utilruntime.HandleCrash() defer utilruntime.HandleCrash()
defer ingc.nsQs.Stop() defer ingc.nsQs.Stop()
ingc.log.Info("Launching informers")
go ingc.informers.ing.Run(ingc.stopCh)
go ingc.informers.svc.Run(ingc.stopCh)
go ingc.informers.endp.Run(ingc.stopCh)
go ingc.informers.secr.Run(ingc.stopCh)
go ingc.informers.vcfg.Run(ingc.stopCh)
ingc.log.Info("Waiting for caches to sync") ingc.log.Info("Waiting for caches to sync")
if ok := cache.WaitForCacheSync(ingc.stopCh, if ok := cache.WaitForCacheSync(ingc.stopCh,
ingc.informers.ing.HasSynced, ingc.informers.ing.HasSynced,
ingc.informers.svc.HasSynced, ingc.informers.svc.HasSynced,
ingc.informers.endp.HasSynced, ingc.informers.endp.HasSynced,
ingc.informers.secr.HasSynced); !ok { ingc.informers.secr.HasSynced,
ingc.informers.vcfg.HasSynced); !ok {
err := fmt.Errorf("Failed waiting for caches to sync") err := fmt.Errorf("Failed waiting for caches to sync")
utilruntime.HandleError(err) utilruntime.HandleError(err)
......
...@@ -32,10 +32,12 @@ package controller ...@@ -32,10 +32,12 @@ package controller
import ( import (
"fmt" "fmt"
"strings" "strconv"
"code.uplex.de/uplex-varnish/k8s-ingress/cmd/varnish/vcl" "code.uplex.de/uplex-varnish/k8s-ingress/cmd/varnish/vcl"
vcr_v1alpha1 "code.uplex.de/uplex-varnish/k8s-ingress/pkg/apis/varnishingress/v1alpha1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/util/intstr" "k8s.io/apimachinery/pkg/util/intstr"
api_v1 "k8s.io/api/core/v1" api_v1 "k8s.io/api/core/v1"
...@@ -55,7 +57,6 @@ const ( ...@@ -55,7 +57,6 @@ const (
varnishSvcKey = annotationPrefix + "varnish-svc" varnishSvcKey = annotationPrefix + "varnish-svc"
) )
// XXX an annotation to identify the Service for an Ingress
func (worker *NamespaceWorker) getVarnishSvcForIng( func (worker *NamespaceWorker) getVarnishSvcForIng(
ing *extensions.Ingress) (*api_v1.Service, error) { ing *extensions.Ingress) (*api_v1.Service, error) {
...@@ -167,19 +168,33 @@ func (worker *NamespaceWorker) ing2VCLSpec( ...@@ -167,19 +168,33 @@ func (worker *NamespaceWorker) ing2VCLSpec(
} }
func (worker *NamespaceWorker) configSharding(spec *vcl.Spec, func (worker *NamespaceWorker) configSharding(spec *vcl.Spec,
ing *extensions.Ingress, svc *api_v1.Service) error { svc *api_v1.Service) error {
ann, exists := ing.Annotations[annotationPrefix+selfShardKey] var vcfg *vcr_v1alpha1.VarnishConfig
if !exists || vcfgs, err := worker.vcfg.List(labels.Everything())
(!strings.EqualFold(ann, "on") && if err != nil {
!strings.EqualFold(ann, "true")) { return err
worker.log.Debugf("No cluster shard configuration for Ingress "+ }
"%s/%s", ing.Namespace, ing.Name) worker.log.Debugf("Listing VarnishConfigs in namespace %s",
worker.namespace)
for _, v := range vcfgs {
worker.log.Debugf("VarnishConfig: %s/%s: %+v", v.Namespace,
v.Name, v)
for _, svcName := range v.Spec.Services {
if svcName == svc.Name {
vcfg = v
break
}
}
}
if vcfg == nil || vcfg.Spec.SelfSharding == nil {
worker.log.Debugf("No cluster shard configuration for Service "+
"%s/%s", svc.Namespace, svc.Name)
return nil return nil
} }
worker.log.Debugf("Set cluster shard configuration for Ingress %s/%s", worker.log.Debugf("Set cluster shard configuration for Service %s/%s",
ing.Namespace, ing.Name) svc.Namespace, svc.Name)
pods, err := worker.getPods(svc) pods, err := worker.getPods(svc)
if err != nil { if err != nil {
...@@ -230,36 +245,33 @@ func (worker *NamespaceWorker) configSharding(spec *vcl.Spec, ...@@ -230,36 +245,33 @@ func (worker *NamespaceWorker) configSharding(spec *vcl.Spec,
node.Addresses[0].Port = httpPort node.Addresses[0].Port = httpPort
spec.ShardCluster.Nodes = append(spec.ShardCluster.Nodes, node) spec.ShardCluster.Nodes = append(spec.ShardCluster.Nodes, node)
} }
worker.log.Debugf("Node configuration for self-sharding in Ingress "+ worker.log.Debugf("Node configuration for self-sharding in Service "+
"%s/%s: %+v", ing.Namespace, ing.Name, spec.ShardCluster.Nodes) "%s/%s: %+v", svc.Namespace, svc.Name, spec.ShardCluster.Nodes)
anns := ing.Annotations cfgSpec := vcfg.Spec.SelfSharding
ann, exists = anns[annotationPrefix+shardProbeTimeoutKey] if cfgSpec.Probe.Timeout != "" {
if exists { spec.ShardCluster.Probe.Timeout = cfgSpec.Probe.Timeout
spec.ShardCluster.Probe.Timeout = ann
} }
ann, exists = anns[annotationPrefix+shardProbeIntervalKey] if cfgSpec.Probe.Interval != "" {
if exists { spec.ShardCluster.Probe.Interval = cfgSpec.Probe.Interval
spec.ShardCluster.Probe.Interval = ann
} }
ann, exists = anns[annotationPrefix+shardProbeInitialKey] if cfgSpec.Probe.Initial != nil {
if exists { spec.ShardCluster.Probe.Initial =
spec.ShardCluster.Probe.Initial = ann strconv.Itoa((int(*cfgSpec.Probe.Initial)))
} }
ann, exists = anns[annotationPrefix+shardProbeWindowKey] if cfgSpec.Probe.Window != nil {
if exists { spec.ShardCluster.Probe.Window =
spec.ShardCluster.Probe.Window = ann strconv.Itoa((int(*cfgSpec.Probe.Window)))
} }
ann, exists = anns[annotationPrefix+shardProbeThresholdKey] if cfgSpec.Probe.Threshold != nil {
if exists { spec.ShardCluster.Probe.Threshold =
spec.ShardCluster.Probe.Threshold = ann strconv.Itoa((int(*cfgSpec.Probe.Threshold)))
} }
ann, exists = anns[annotationPrefix+shardMax2ndTTL] if cfgSpec.Max2ndTTL != "" {
if exists { spec.ShardCluster.MaxSecondaryTTL = cfgSpec.Max2ndTTL
spec.ShardCluster.MaxSecondaryTTL = ann
} }
worker.log.Debugf("Spec configuration for self-sharding in Ingress "+ worker.log.Debugf("Spec configuration for self-sharding in Service "+
"%s/%s: %+v", ing.Namespace, ing.Name, spec.ShardCluster) "%s/%s: %+v", svc.Namespace, svc.Name, spec.ShardCluster)
return nil return nil
} }
...@@ -294,7 +306,7 @@ func (worker *NamespaceWorker) addOrUpdateIng(ing *extensions.Ingress) error { ...@@ -294,7 +306,7 @@ func (worker *NamespaceWorker) addOrUpdateIng(ing *extensions.Ingress) error {
return err return err
} }
if err = worker.configSharding(&vclSpec, ing, svc); err != nil { if err = worker.configSharding(&vclSpec, svc); err != nil {
return err return err
} }
......
/*
* Copyright (c) 2018 UPLEX Nils Goroll Systemoptimierung
* All rights reserved
*
* Author: Geoffrey Simmons <geoffrey.simmons@uplex.de>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
package controller
import (
"fmt"
vcr_v1alpha1 "code.uplex.de/uplex-varnish/k8s-ingress/pkg/apis/varnishingress/v1alpha1"
)
// XXX a validation webhook should do this.
// Assume that validation for the CustomResource has already checked
// the Timeout, Interval and Initial fields, and that Window and
// Threshold have been checked for permitted ranges.
func validateSharding(spec *vcr_v1alpha1.SelfShardSpec) error {
if spec.Probe.Window != nil && spec.Probe.Threshold != nil &&
*spec.Probe.Threshold > *spec.Probe.Window {
return fmt.Errorf("Threshold (%d) may not be greater than "+
"Window (%d)", spec.Probe.Threshold, spec.Probe.Window)
}
return nil
}
func (worker *NamespaceWorker) syncVcfg(key string) error {
worker.log.Infof("Syncing VarnishConfig: %s/%s", worker.namespace, key)
vcfg, err := worker.vcfg.Get(key)
if err != nil {
return err
}
worker.log.Debugf("VarnishConfig %s/%s: %+v", vcfg.Namespace,
vcfg.Name, vcfg)
if len(vcfg.Spec.Services) == 0 {
// CRD validation should prevent this.
worker.log.Infof("VarnishConfig %s/%s: no services defined, "+
"ignoring", vcfg.Namespace, vcfg.Name)
return nil
}
if vcfg.Spec.SelfSharding == nil {
worker.log.Infof("VarnishConfig %s/%s: no config defined, "+
"ignoring", vcfg.Namespace, vcfg.Name)
return nil
}
if err = validateSharding(vcfg.Spec.SelfSharding); err != nil {
return fmt.Errorf("VarnishConfig %s/%s invalid sharding "+
"spec: %v", vcfg.Namespace, vcfg.Name, err)
}
svcSet := make(map[string]struct{})
for _, svc := range vcfg.Spec.Services {
if _, exists := svcSet[svc]; exists {
continue
}
svcSet[svc] = struct{}{}
svcObj, err := worker.svc.Get(svc)
if err != nil {
return err
}
worker.log.Infof("VarnishConfig %s/%s: enqueuing service %s/%s"+
" for update", vcfg.Namespace, vcfg.Name,
svcObj.Namespace, svcObj.Name)
worker.queue.Add(svcObj)
}
return nil
}
func (worker *NamespaceWorker) deleteVcfg(key string) error {
nsKey := worker.namespace + "/" + key
worker.log.Info("Deleting VarnishConfig:", nsKey)
vcfg, err := worker.vcfg.Get(key)
if err != nil {
worker.log.Warnf("Cannot get VarnishConfig %s, ignoring: %v",
nsKey, err)
return nil
}
for _, svc := range vcfg.Spec.Services {
worker.log.Infof("VarnishConfig %s/%s: enqueuing service %s/%s"+
" for update", vcfg.Namespace, vcfg.Name,
worker.namespace, svc)
worker.queue.Add(svc)
}
return nil
}
...@@ -42,6 +42,8 @@ import ( ...@@ -42,6 +42,8 @@ import (
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"code.uplex.de/uplex-varnish/k8s-ingress/cmd/varnish" "code.uplex.de/uplex-varnish/k8s-ingress/cmd/varnish"
ving_v1alpha1 "code.uplex.de/uplex-varnish/k8s-ingress/pkg/apis/varnishingress/v1alpha1"
vcr_listers "code.uplex.de/uplex-varnish/k8s-ingress/pkg/client/listers/varnishingress/v1alpha1"
) )
const ( const (
...@@ -60,6 +62,7 @@ type NamespaceWorker struct { ...@@ -60,6 +62,7 @@ type NamespaceWorker struct {
svc core_v1_listers.ServiceNamespaceLister svc core_v1_listers.ServiceNamespaceLister
endp core_v1_listers.EndpointsNamespaceLister endp core_v1_listers.EndpointsNamespaceLister
secr core_v1_listers.SecretNamespaceLister secr core_v1_listers.SecretNamespaceLister
vcfg vcr_listers.VarnishConfigNamespaceLister
client kubernetes.Interface client kubernetes.Interface
recorder record.EventRecorder recorder record.EventRecorder
} }
...@@ -84,6 +87,10 @@ func (worker *NamespaceWorker) infoEvent(obj interface{}, reason, msgFmt string, ...@@ -84,6 +87,10 @@ func (worker *NamespaceWorker) infoEvent(obj interface{}, reason, msgFmt string,
secr, _ := obj.(*api_v1.Secret) secr, _ := obj.(*api_v1.Secret)
worker.recorder.Eventf(secr, api_v1.EventTypeNormal, reason, worker.recorder.Eventf(secr, api_v1.EventTypeNormal, reason,
msgFmt, args...) msgFmt, args...)
case *ving_v1alpha1.VarnishConfig:
vcfg, _ := obj.(*ving_v1alpha1.VarnishConfig)
worker.recorder.Eventf(vcfg, api_v1.EventTypeNormal, reason,
msgFmt, args...)
default: default:
worker.log.Warnf("Unhandled type %T, no event generated", obj) worker.log.Warnf("Unhandled type %T, no event generated", obj)
} }
...@@ -109,6 +116,10 @@ func (worker *NamespaceWorker) warnEvent(obj interface{}, reason, msgFmt string, ...@@ -109,6 +116,10 @@ func (worker *NamespaceWorker) warnEvent(obj interface{}, reason, msgFmt string,
secr, _ := obj.(*api_v1.Secret) secr, _ := obj.(*api_v1.Secret)
worker.recorder.Eventf(secr, api_v1.EventTypeWarning, reason, worker.recorder.Eventf(secr, api_v1.EventTypeWarning, reason,
msgFmt, args...) msgFmt, args...)
case *ving_v1alpha1.VarnishConfig:
vcfg, _ := obj.(*ving_v1alpha1.VarnishConfig)
worker.recorder.Eventf(vcfg, api_v1.EventTypeWarning, reason,
msgFmt, args...)
default: default:
worker.log.Warnf("Unhandled type %T, no event generated", obj) worker.log.Warnf("Unhandled type %T, no event generated", obj)
} }
...@@ -144,6 +155,8 @@ func (worker *NamespaceWorker) dispatch(obj interface{}) error { ...@@ -144,6 +155,8 @@ func (worker *NamespaceWorker) dispatch(obj interface{}) error {
return worker.syncEndp(key) return worker.syncEndp(key)
case *api_v1.Secret: case *api_v1.Secret:
return worker.syncSecret(key) return worker.syncSecret(key)
case *ving_v1alpha1.VarnishConfig:
return worker.syncVcfg(key)
default: default:
deleted, ok := obj.(cache.DeletedFinalStateUnknown) deleted, ok := obj.(cache.DeletedFinalStateUnknown)
if !ok { if !ok {
...@@ -161,6 +174,8 @@ func (worker *NamespaceWorker) dispatch(obj interface{}) error { ...@@ -161,6 +174,8 @@ func (worker *NamespaceWorker) dispatch(obj interface{}) error {
return worker.syncEndp(key) return worker.syncEndp(key)
case *api_v1.Secret: case *api_v1.Secret:
return worker.deleteSecret(key) return worker.deleteSecret(key)
case *ving_v1alpha1.VarnishConfig:
return worker.deleteVcfg(key)
default: default:
worker.syncFailure(deleted, "Unhandled object type: %T", worker.syncFailure(deleted, "Unhandled object type: %T",
deleted) deleted)
...@@ -277,6 +292,7 @@ func (qs *NamespaceQueues) next() { ...@@ -277,6 +292,7 @@ func (qs *NamespaceQueues) next() {
svc: qs.listers.svc.Services(ns), svc: qs.listers.svc.Services(ns),
endp: qs.listers.endp.Endpoints(ns), endp: qs.listers.endp.Endpoints(ns),
secr: qs.listers.secr.Secrets(ns), secr: qs.listers.secr.Secrets(ns),
vcfg: qs.listers.vcfg.VarnishConfigs(ns),
client: qs.client, client: qs.client,
recorder: qs.recorder, recorder: qs.recorder,
} }
......
...@@ -40,6 +40,8 @@ import ( ...@@ -40,6 +40,8 @@ import (
"code.uplex.de/uplex-varnish/k8s-ingress/cmd/controller" "code.uplex.de/uplex-varnish/k8s-ingress/cmd/controller"
"code.uplex.de/uplex-varnish/k8s-ingress/cmd/varnish" "code.uplex.de/uplex-varnish/k8s-ingress/cmd/varnish"
clientset "code.uplex.de/uplex-varnish/k8s-ingress/pkg/client/clientset/versioned"
vcr_informers "code.uplex.de/uplex-varnish/k8s-ingress/pkg/client/informers/externalversions"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
...@@ -132,14 +134,24 @@ func main() { ...@@ -132,14 +134,24 @@ func main() {
if err != nil { if err != nil {
log.Fatal("Failed to create client:", err) log.Fatal("Failed to create client:", err)
} }
vingClient, err := clientset.NewForConfig(config)
if err != nil {
log.Fatal("Failed to create client:", err)
}
var informerFactory informers.SharedInformerFactory var informerFactory informers.SharedInformerFactory
var vcrInformerFactory vcr_informers.SharedInformerFactory
if *namespaceF == api_v1.NamespaceAll { if *namespaceF == api_v1.NamespaceAll {
informerFactory = informers.NewSharedInformerFactory( informerFactory = informers.NewSharedInformerFactory(
kubeClient, resyncPeriod) kubeClient, resyncPeriod)
vcrInformerFactory = vcr_informers.NewSharedInformerFactory(
vingClient, resyncPeriod)
} else { } else {
informerFactory = informers.NewFilteredSharedInformerFactory( informerFactory = informers.NewFilteredSharedInformerFactory(
kubeClient, resyncPeriod, *namespaceF, noop) kubeClient, resyncPeriod, *namespaceF, noop)
vcrInformerFactory =
vcr_informers.NewFilteredSharedInformerFactory(
vingClient, resyncPeriod, *namespaceF, noop)
// XXX this is prefered, but only available in newer // XXX this is prefered, but only available in newer
// versions of client-go. // versions of client-go.
...@@ -152,7 +164,7 @@ func main() { ...@@ -152,7 +164,7 @@ func main() {
vController.Start(varnishDone) vController.Start(varnishDone)
ingController := controller.NewIngressController(log, kubeClient, ingController := controller.NewIngressController(log, kubeClient,
vController, informerFactory) vController, informerFactory, vcrInformerFactory)
go handleTermination(log, ingController, vController, varnishDone) go handleTermination(log, ingController, vController, varnishDone)
informerFactory.Start(informerStop) informerFactory.Start(informerStop)
ingController.Run() ingController.Run()
......
...@@ -4,17 +4,18 @@ RUN go get -d -v github.com/slimhazard/gogitversion && \ ...@@ -4,17 +4,18 @@ RUN go get -d -v github.com/slimhazard/gogitversion && \
cd /go/src/github.com/slimhazard/gogitversion && \ cd /go/src/github.com/slimhazard/gogitversion && \
make install make install
RUN mkdir -p /go/src/code.uplex.de/uplex-varnish/k8s-ingress/cmd RUN mkdir -p /go/src/code.uplex.de/uplex-varnish/k8s-ingress
WORKDIR /go/src/code.uplex.de/uplex-varnish/k8s-ingress/cmd WORKDIR /go/src/code.uplex.de/uplex-varnish/k8s-ingress
COPY ./cmd/go.mod . COPY go.mod .
COPY ./cmd/go.sum . COPY go.sum .
RUN vgo mod download RUN vgo mod download
COPY . /go/src/code.uplex.de/uplex-varnish/k8s-ingress COPY . /go/src/code.uplex.de/uplex-varnish/k8s-ingress
RUN vgo generate && CGO_ENABLED=0 GOOS=linux vgo build -o k8s-ingress *.go RUN vgo generate ./... && vgo build ./... && \
CGO_ENABLED=0 GOOS=linux vgo build -o k8s-ingress cmd/*.go
FROM alpine:3.8 FROM alpine:3.8
COPY --from=builder /go/src/code.uplex.de/uplex-varnish/k8s-ingress/cmd/k8s-ingress /k8s-ingress COPY --from=builder /go/src/code.uplex.de/uplex-varnish/k8s-ingress/k8s-ingress /k8s-ingress
COPY --from=builder /go/src/code.uplex.de/uplex-varnish/k8s-ingress/cmd/varnish/vcl/*.tmpl / COPY --from=builder /go/src/code.uplex.de/uplex-varnish/k8s-ingress/cmd/varnish/vcl/*.tmpl /
ENTRYPOINT ["/k8s-ingress"] ENTRYPOINT ["/k8s-ingress"]
...@@ -47,6 +47,20 @@ rules: ...@@ -47,6 +47,20 @@ rules:
- ingresses/status - ingresses/status
verbs: verbs:
- update - update
- apiGroups:
- ingress.varnish-cache.org
resources:
- varnishconfigs
verbs:
- list
- watch
- get
- apiGroups:
- "ingress.varnish-cache.org"
resources:
- varnishconfigs/status
verbs:
- update
--- ---
kind: ClusterRoleBinding kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1 apiVersion: rbac.authorization.k8s.io/v1beta1
......
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: varnishconfigs.ingress.varnish-cache.org
spec:
group: ingress.varnish-cache.org
names:
kind: VarnishConfig
listKind: VarnishConfigList
plural: varnishconfigs
singular: varnishconfig
shortNames:
- vcfg
scope: Namespaced
version: v1alpha1
versions:
- name: v1alpha1
served: true
storage: true
validation:
openAPIV3Schema:
required:
- spec
properties:
spec:
required:
- services
properties:
services:
type: array
minItems: 1
items:
type: string
self-sharding:
type: object
properties:
max-secondary-ttl:
type: string
pattern: '^\d+(\.\d+)?(ms|[smhdwy])$'
probe:
type: object
properties:
timeout:
type: string
pattern: '^\d+(\.\d+)?(ms|[smhdwy])$'
interval:
type: string
pattern: '^\d+(\.\d+)?(ms|[smhdwy])$'
initial:
type: integer
minimum: 0
window:
type: integer
minimum: 0
maximum: 64
threshold:
type: integer
minimum: 0
maximum: 64
status:
acceptedNames:
kind: VarnishConfig
listKind: VarnishConfigList
plural: varnishconfigs
singular: varnishconfig
shortNames:
- vcfg
storedVersions:
- v1alphav1
conditions: []
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: cafe-ingress-varnish
annotations:
kubernetes.io/ingress.class: "varnish"
ingress.varnish-cache.org/self-sharding: "on"
ingress.varnish-cache.org/self-sharding-probe-timeout: "6s"
ingress.varnish-cache.org/self-sharding-probe-interval: "6s"
ingress.varnish-cache.org/self-sharding-probe-initial: "2"
ingress.varnish-cache.org/self-sharding-probe-window: "4"
ingress.varnish-cache.org/self-sharding-probe-threshold: "3"
ingress.varnish-cache.org/self-sharding-max-secondary-ttl: "1m"
namespace: varnish-ingress
spec:
rules:
- host: cafe.example.com
http:
paths:
- path: /tea
backend:
serviceName: tea-svc
servicePort: 80
- path: /coffee
backend:
serviceName: coffee-svc
servicePort: 80
# Sample configuration for a self-sharding Varnish cluster
apiVersion: "ingress.varnish-cache.org/v1alpha1"
kind: VarnishConfig
metadata:
name: self-sharding-cfg
spec:
# The services array is required and must have at least one element.
# Lists the Service names of Varnish services in the same namespace
# to which this config is to be applied.
services:
- varnish-ingress
# If the self-sharding object is present, then self-sharding will be
# implemented for the named service. All of its properties are
# optional, and defaults hold if they are left out. To just apply
# self-sharding with all default values, specify an empty object:
#
# self-sharding: {}
#
self-sharding:
max-secondary-ttl: 2m
probe:
timeout: 6s
interval: 6s
initial: 2
window: 4
threshold: 3
module code.uplex.de/uplex-varnish/k8s-ingress/cmd module code.uplex.de/uplex-varnish/k8s-ingress
require ( require (
code.uplex.de/uplex-varnish/varnishapi v0.0.0-20181209154204-43826850baae code.uplex.de/uplex-varnish/varnishapi v0.0.0-20181209154204-43826850baae
github.com/emicklei/go-restful v2.8.0+incompatible // indirect github.com/emicklei/go-restful v2.8.0+incompatible // indirect
github.com/ghodss/yaml v1.0.0 // indirect github.com/ghodss/yaml v1.0.0 // indirect
github.com/go-openapi/spec v0.17.2 // indirect github.com/go-openapi/spec v0.18.0 // indirect
github.com/gogo/protobuf v1.1.1 // indirect github.com/gogo/protobuf v1.2.0 // indirect
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b // indirect github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
github.com/golang/groupcache v0.0.0-20181024230925-c65c006176ff // indirect github.com/golang/groupcache v0.0.0-20181024230925-c65c006176ff // indirect
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c // indirect github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c // indirect
github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf // indirect github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf // indirect
github.com/googleapis/gnostic v0.2.0 // indirect github.com/googleapis/gnostic v0.2.0 // indirect
github.com/gregjones/httpcache v0.0.0-20181110185634-c63ab54fda8f // indirect github.com/gregjones/httpcache v0.0.0-20181110185634-c63ab54fda8f // indirect
github.com/hashicorp/golang-lru v0.5.0 // 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/json-iterator/go v1.1.5 // indirect
github.com/juju/ratelimit v1.0.1 // indirect github.com/juju/ratelimit v1.0.1 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
...@@ -22,13 +24,16 @@ require ( ...@@ -22,13 +24,16 @@ require (
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
github.com/sirupsen/logrus v1.2.0 github.com/sirupsen/logrus v1.2.0
github.com/spf13/pflag v1.0.3 // indirect github.com/spf13/pflag v1.0.3 // indirect
golang.org/x/net v0.0.0-20181201002055-351d144fa1fc // indirect golang.org/x/net v0.0.0-20181220203305-927f97764cc3 // indirect
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f // indirect golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 // indirect
golang.org/x/sys v0.0.0-20181128092732-4ed8d59d0b35 // indirect golang.org/x/tools v0.0.0-20181221235234-d00ac6d27372 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.2.2 // indirect gopkg.in/yaml.v2 v2.2.2 // indirect
k8s.io/api v0.0.0-20181130031204-d04500c8c3dd k8s.io/api v0.0.0-20181221193117-173ce66c1e39
k8s.io/apimachinery v0.0.0-20180925215425-1926e7bb5c13 k8s.io/apimachinery v0.0.0-20180925215425-1926e7bb5c13
k8s.io/client-go v6.0.0+incompatible k8s.io/client-go v6.0.0+incompatible
k8s.io/code-generator v0.0.0-20180510141822-0ab89e584187 // indirect
k8s.io/gengo v0.0.0-20181113154421-fd15ee9cc2f7 // indirect
k8s.io/klog v0.1.0 // indirect
k8s.io/kube-openapi v0.0.0-20181114233023-0317810137be // indirect k8s.io/kube-openapi v0.0.0-20181114233023-0317810137be // indirect
) )
...@@ -16,12 +16,12 @@ github.com/go-openapi/jsonpointer v0.17.0 h1:nH6xp8XdXHx8dqveo0ZuJBluCO2qGrPbDNZ ...@@ -16,12 +16,12 @@ github.com/go-openapi/jsonpointer v0.17.0 h1:nH6xp8XdXHx8dqveo0ZuJBluCO2qGrPbDNZ
github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M=
github.com/go-openapi/jsonreference v0.17.0 h1:yJW3HCkTHg7NOA+gZ83IPHzUSnUzGXhGmsdiCcMexbA= github.com/go-openapi/jsonreference v0.17.0 h1:yJW3HCkTHg7NOA+gZ83IPHzUSnUzGXhGmsdiCcMexbA=
github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I=
github.com/go-openapi/spec v0.17.2 h1:eb2NbuCnoe8cWAxhtK6CfMWUYmiFEZJ9Hx3Z2WRwJ5M= github.com/go-openapi/spec v0.18.0 h1:aIjeyG5mo5/FrvDkpKKEGZPmF9MPHahS72mzfVqeQXQ=
github.com/go-openapi/spec v0.17.2/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI=
github.com/go-openapi/swag v0.17.0 h1:iqrgMg7Q7SvtbWLlltPrkMs0UBJI6oTSs79JFRUi880= github.com/go-openapi/swag v0.17.0 h1:iqrgMg7Q7SvtbWLlltPrkMs0UBJI6oTSs79JFRUi880=
github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg=
github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.2.0 h1:xU6/SpYbvkNYiptHJYEDRseDLvYE7wSqhYYNy0QSUzI=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/groupcache v0.0.0-20181024230925-c65c006176ff h1:kOkM9whyQYodu09SJ6W3NCsHG7crFaJILQ22Gozp3lg= github.com/golang/groupcache v0.0.0-20181024230925-c65c006176ff h1:kOkM9whyQYodu09SJ6W3NCsHG7crFaJILQ22Gozp3lg=
...@@ -38,8 +38,12 @@ github.com/gregjones/httpcache v0.0.0-20181110185634-c63ab54fda8f h1:ShTPMJQes6t ...@@ -38,8 +38,12 @@ github.com/gregjones/httpcache v0.0.0-20181110185634-c63ab54fda8f h1:ShTPMJQes6t
github.com/gregjones/httpcache v0.0.0-20181110185634-c63ab54fda8f/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/gregjones/httpcache v0.0.0-20181110185634-c63ab54fda8f/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCOH9wdo= github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCOH9wdo=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/howeyc/gopass v0.0.0-20170109162249-bf9dde6d0d2c h1:kQWxfPIHVLbgLzphqk3QUflDy9QdksZR4ygR807bpy0=
github.com/howeyc/gopass v0.0.0-20170109162249-bf9dde6d0d2c/go.mod h1:lADxMC39cJJqL93Duh1xhAs4I2Zs8mKS89XWXFGp9cs=
github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/imdario/mergo v0.3.6 h1:xTNEAn+kxVO7dTZGu0CegyqKZmoWFI0rF8UxjlB2d28=
github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/json-iterator/go v1.1.5 h1:gL2yXlmiIo4+t+y32d4WGwOjKGYcGOuyrg46vadswDE= github.com/json-iterator/go v1.1.5 h1:gL2yXlmiIo4+t+y32d4WGwOjKGYcGOuyrg46vadswDE=
github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/juju/ratelimit v1.0.1 h1:+7AIFJVQ0EQgq/K9+0Krm7m530Du7tIz0METWzN0RgY= github.com/juju/ratelimit v1.0.1 h1:+7AIFJVQ0EQgq/K9+0Krm7m530Du7tIz0METWzN0RgY=
...@@ -72,17 +76,19 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793 h1:u+LnwYTOOW7Ukr/fppxEb1 ...@@ -72,17 +76,19 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793 h1:u+LnwYTOOW7Ukr/fppxEb1
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181201002055-351d144fa1fc h1:a3CU5tJYVj92DY2LaA1kUkrsqD5/3mLDhx2NcNqyW+0= golang.org/x/net v0.0.0-20181220203305-927f97764cc3 h1:eH6Eip3UpmR+yM/qI9Ijluzb1bNv/cAU/n+6l8tRSis=
golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f h1:Bl/8QSvNqXvPGPGXa2z5xUTmV7VDcZyvRZ+QQXkXTZQ= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33 h1:I6FyU15t786LL7oL/hn43zqTuEGr4PN7F4XJ1p4E3Y8=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e h1:o3PsSEY8E4eXWkXrIP9YJALUkVZqzHJT5DOasTyn8Vs=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181128092732-4ed8d59d0b35 h1:YAFjXN64LMvktoUZH9zgY4lGc/msGN7HQfoSuKCgaDU=
golang.org/x/sys v0.0.0-20181128092732-4ed8d59d0b35/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/tools v0.0.0-20181221235234-d00ac6d27372 h1:zWPUEY/PjVHT+zO3L8OfkjrtIjf55joTxn/RQP/AjOI=
golang.org/x/tools v0.0.0-20181221235234-d00ac6d27372/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=
...@@ -94,11 +100,18 @@ gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWD ...@@ -94,11 +100,18 @@ gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWD
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
k8s.io/api v0.0.0-20181130031204-d04500c8c3dd h1:5aHsneN62ehs/tdtS9tWZlhVk68V7yms/Qw7nsGmvCA= k8s.io/api v0.0.0-20181221193117-173ce66c1e39 h1:iGq7zEPXFb0IeXAQK5RiYT1SVKX/af9F9Wv0M+yudPY=
k8s.io/api v0.0.0-20181130031204-d04500c8c3dd/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= k8s.io/api v0.0.0-20181221193117-173ce66c1e39/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA=
k8s.io/apimachinery v0.0.0-20180925215425-1926e7bb5c13 h1:XhNQCG3WplXZqDfte+QiEYqa6BrV3j81XdFy3jxNI1k= k8s.io/apimachinery v0.0.0-20180925215425-1926e7bb5c13 h1:XhNQCG3WplXZqDfte+QiEYqa6BrV3j81XdFy3jxNI1k=
k8s.io/apimachinery v0.0.0-20180925215425-1926e7bb5c13/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0= k8s.io/apimachinery v0.0.0-20180925215425-1926e7bb5c13/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0=
k8s.io/apimachinery v0.0.0-20181222072933-b814ad55d7c5 h1:96AWA6L4KjeldDMhG9639vpZ8VBQll1CgSAjCfEdFGI=
k8s.io/client-go v6.0.0+incompatible h1:kskJ2eeKafKUmOhH9xa02lGTs96aoQi3ZKyzIo62sJg= k8s.io/client-go v6.0.0+incompatible h1:kskJ2eeKafKUmOhH9xa02lGTs96aoQi3ZKyzIo62sJg=
k8s.io/client-go v6.0.0+incompatible/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s= k8s.io/client-go v6.0.0+incompatible/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s=
k8s.io/code-generator v0.0.0-20180510141822-0ab89e584187 h1:9okhnIBEqdPBTimd5LOenYh+TLynwjIZ/znXMKXM3RA=
k8s.io/code-generator v0.0.0-20180510141822-0ab89e584187/go.mod h1:MYiN+ZJZ9HkETbgVZdWw2AsuAi9PZ4V80cwfuf2axe8=
k8s.io/gengo v0.0.0-20181113154421-fd15ee9cc2f7 h1:zjNgw2qqBQmKd0S59lGZBQqFxJqUZroVbDphfnVm5do=
k8s.io/gengo v0.0.0-20181113154421-fd15ee9cc2f7/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
k8s.io/klog v0.1.0 h1:I5HMfc/DtuVaGR1KPwUrTc476K8NCqNBldC7H4dYEzk=
k8s.io/klog v0.1.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
k8s.io/kube-openapi v0.0.0-20181114233023-0317810137be h1:aWEq4nbj7HRJ0mtKYjNSk/7X28Tl6TI6FeG8gKF+r7Q= k8s.io/kube-openapi v0.0.0-20181114233023-0317810137be h1:aWEq4nbj7HRJ0mtKYjNSk/7X28Tl6TI6FeG8gKF+r7Q=
k8s.io/kube-openapi v0.0.0-20181114233023-0317810137be/go.mod h1:BXM9ceUBTj2QnfH2MK1odQs778ajze1RxcmP6S8RVVc= k8s.io/kube-openapi v0.0.0-20181114233023-0317810137be/go.mod h1:BXM9ceUBTj2QnfH2MK1odQs778ajze1RxcmP6S8RVVc=
/*
* Copyright (c) YEAR UPLEX Nils Goroll Systemoptimierung
* All rights reserved
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Copyright (c) 2018 UPLEX Nils Goroll Systemoptimierung
* All rights reserved
*
* Author: Geoffrey Simmons <geoffrey.simmons@uplex.de>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
// varnishingress is the client API for the API group
// ingress.varnish-cache.org, used to define Custom Resources for the
// Varnish ingress project.
//
// see: https://code.uplex.de/uplex-varnish/k8s-ingress
package varnishingress
const (
GroupName = "ingress.varnish-cache.org"
)
/*
* Copyright (c) 2018 UPLEX Nils Goroll Systemoptimierung
* All rights reserved
*
* Author: Geoffrey Simmons <geoffrey.simmons@uplex.de>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
// varnishingress is the client API for the API group
// ingress.varnish-cache.org, used to define Custom Resources for the
// Varnish ingress project.
//
// see: https://code.uplex.de/uplex-varnish/k8s-ingress
package varnishingress
const (
GroupName = "ingress.varnish-cache.org"
)
/*
* Copyright (c) 2018 UPLEX Nils Goroll Systemoptimierung
* All rights reserved
*
* Author: Geoffrey Simmons <geoffrey.simmons@uplex.de>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
// +k8s:deepcopy-gen=package
// +groupName=ingress.varnish-cache.org
// v1alpha1 is a version of the client API for CustomResource types
// defined for the Varnish Ingress project. Most of the code in the API
// is generated by k8s code generators (see: k8s.io/code-generator).
//
// See: https://code.uplex.de/uplex-varnish/k8s-ingress
//
// Currently there is one CustomResource named VarnishConfig.
//
//
// Most of the code in the API is generated by k8s code generators
// (see: k8s.io/code-generator).
package v1alpha1
/*
* Copyright (c) 2018 UPLEX Nils Goroll Systemoptimierung
* All rights reserved
*
* Author: Geoffrey Simmons <geoffrey.simmons@uplex.de>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
ving "code.uplex.de/uplex-varnish/k8s-ingress/pkg/apis/varnishingress"
)
// SchemeGroupVersion is group version used to register these objects
var SchemeGroupVersion = schema.GroupVersion{
Group: ving.GroupName,
Version: "v1alpha1",
}
// Kind takes an unqualified kind and returns back a Group qualified GroupKind
func Kind(kind string) schema.GroupKind {
return SchemeGroupVersion.WithKind(kind).GroupKind()
}
// Resource takes an unqualified resource and returns a Group qualified GroupResource
func Resource(resource string) schema.GroupResource {
return SchemeGroupVersion.WithResource(resource).GroupResource()
}
var (
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
AddToScheme = SchemeBuilder.AddToScheme
)
// Adds the list of known types to Scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&VarnishConfig{},
&VarnishConfigList{},
)
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
return nil
}
/*
* Copyright (c) 2018 UPLEX Nils Goroll Systemoptimierung
* All rights reserved
*
* Author: Geoffrey Simmons <geoffrey.simmons@uplex.de>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// VarnishConfig is the client API for the VarnishConfig Custom
// Resource, which specifies additional configuration and features for
// Services running Varnish as an implementation of Ingress.
type VarnishConfig struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec VarnishConfigSpec `json:"spec"`
// Status VarnishConfigStatus `json:"status"`
}
// VarnishConfigSpec corresponds to the spec section of a
// VarnishConfig Custom Resource.
type VarnishConfigSpec struct {
Services []string `json:"services,omitempty"`
SelfSharding *SelfShardSpec `json:"self-sharding,omitempty"`
}
// SelfShardSpec specifies self-sharding in a Varnish cluster.
// see: https://code.uplex.de/uplex-varnish/k8s-ingress/blob/master/docs/self-sharding.md
type SelfShardSpec struct {
Max2ndTTL string `json:"max-secondary-ttl,omitempty"`
Probe ProbeSpec `json:"probe,omitempty"`
}
// ProbeSpec specifies health probes in use for self-sharding.
// see: https://code.uplex.de/uplex-varnish/k8s-ingress/blob/master/docs/self-sharding.md
type ProbeSpec struct {
Timeout string `json:"timeout,omitempty"`
Interval string `json:"interval,omitempty"`
Initial *int32 `json:"initial,omitempty"`
Window *int32 `json:"window,omitempty"`
Threshold *int32 `json:"threshold,omitempty"`
}
// VarnishConfigStatus is the status for a VarnishConfig resource
// type VarnishConfigStatus struct {
// AvailableReplicas int32 `json:"availableReplicas"`
// }
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// VarnishConfigList is a list of VarnishConfig Custom Resources.
type VarnishConfigList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []VarnishConfig `json:"items"`
}
// +build !ignore_autogenerated
/*
* Copyright (c) 2018 UPLEX Nils Goroll Systemoptimierung
* All rights reserved
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
// Code generated by deepcopy-gen. DO NOT EDIT.
package v1alpha1
import (
runtime "k8s.io/apimachinery/pkg/runtime"
)
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ProbeSpec) DeepCopyInto(out *ProbeSpec) {
*out = *in
if in.Initial != nil {
in, out := &in.Initial, &out.Initial
*out = new(int32)
**out = **in
}
if in.Window != nil {
in, out := &in.Window, &out.Window
*out = new(int32)
**out = **in
}
if in.Threshold != nil {
in, out := &in.Threshold, &out.Threshold
*out = new(int32)
**out = **in
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProbeSpec.
func (in *ProbeSpec) DeepCopy() *ProbeSpec {
if in == nil {
return nil
}
out := new(ProbeSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *SelfShardSpec) DeepCopyInto(out *SelfShardSpec) {
*out = *in
in.Probe.DeepCopyInto(&out.Probe)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SelfShardSpec.
func (in *SelfShardSpec) DeepCopy() *SelfShardSpec {
if in == nil {
return nil
}
out := new(SelfShardSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *VarnishConfig) DeepCopyInto(out *VarnishConfig) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VarnishConfig.
func (in *VarnishConfig) DeepCopy() *VarnishConfig {
if in == nil {
return nil
}
out := new(VarnishConfig)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *VarnishConfig) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *VarnishConfigList) DeepCopyInto(out *VarnishConfigList) {
*out = *in
out.TypeMeta = in.TypeMeta
out.ListMeta = in.ListMeta
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]VarnishConfig, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VarnishConfigList.
func (in *VarnishConfigList) DeepCopy() *VarnishConfigList {
if in == nil {
return nil
}
out := new(VarnishConfigList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *VarnishConfigList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *VarnishConfigSpec) DeepCopyInto(out *VarnishConfigSpec) {
*out = *in
if in.Services != nil {
in, out := &in.Services, &out.Services
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.SelfSharding != nil {
in, out := &in.SelfSharding, &out.SelfSharding
*out = new(SelfShardSpec)
(*in).DeepCopyInto(*out)
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VarnishConfigSpec.
func (in *VarnishConfigSpec) DeepCopy() *VarnishConfigSpec {
if in == nil {
return nil
}
out := new(VarnishConfigSpec)
in.DeepCopyInto(out)
return out
}
/*
* Copyright (c) 2018 UPLEX Nils Goroll Systemoptimierung
* All rights reserved
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
// Code generated by client-gen. DO NOT EDIT.
package versioned
import (
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"
)
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
// version included in a Clientset.
type Clientset struct {
*discovery.DiscoveryClient
ingressV1alpha1 *ingressv1alpha1.IngressV1alpha1Client
}
// IngressV1alpha1 retrieves the IngressV1alpha1Client
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 {
return nil
}
return c.DiscoveryClient
}
// NewForConfig creates a new Clientset for the given config.
func NewForConfig(c *rest.Config) (*Clientset, error) {
configShallowCopy := *c
if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 {
configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst)
}
var cs Clientset
var err error
cs.ingressV1alpha1, err = ingressv1alpha1.NewForConfig(&configShallowCopy)
if err != nil {
return nil, err
}
cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy)
if err != nil {
glog.Errorf("failed to create the DiscoveryClient: %v", err)
return nil, err
}
return &cs, nil
}
// NewForConfigOrDie creates a new Clientset for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *Clientset {
var cs Clientset
cs.ingressV1alpha1 = ingressv1alpha1.NewForConfigOrDie(c)
cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c)
return &cs
}
// New creates a new Clientset for the given RESTClient.
func New(c rest.Interface) *Clientset {
var cs Clientset
cs.ingressV1alpha1 = ingressv1alpha1.New(c)
cs.DiscoveryClient = discovery.NewDiscoveryClient(c)
return &cs
}
/*
* Copyright (c) 2018 UPLEX Nils Goroll Systemoptimierung
* All rights reserved
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
// Code generated by client-gen. DO NOT EDIT.
// This package has the automatically generated clientset.
package versioned
/*
* Copyright (c) 2018 UPLEX Nils Goroll Systemoptimierung
* All rights reserved
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
clientset "code.uplex.de/uplex-varnish/k8s-ingress/pkg/client/clientset/versioned"
ingressv1alpha1 "code.uplex.de/uplex-varnish/k8s-ingress/pkg/client/clientset/versioned/typed/varnishingress/v1alpha1"
fakeingressv1alpha1 "code.uplex.de/uplex-varnish/k8s-ingress/pkg/client/clientset/versioned/typed/varnishingress/v1alpha1/fake"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/watch"
"k8s.io/client-go/discovery"
fakediscovery "k8s.io/client-go/discovery/fake"
"k8s.io/client-go/testing"
)
// NewSimpleClientset returns a clientset that will respond with the provided objects.
// It's backed by a very simple object tracker that processes creates, updates and deletions as-is,
// without applying any validations and/or defaults. It shouldn't be considered a replacement
// for a real clientset and is mostly useful in simple unit tests.
func NewSimpleClientset(objects ...runtime.Object) *Clientset {
o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder())
for _, obj := range objects {
if err := o.Add(obj); err != nil {
panic(err)
}
}
fakePtr := testing.Fake{}
fakePtr.AddReactor("*", "*", testing.ObjectReaction(o))
fakePtr.AddWatchReactor("*", testing.DefaultWatchReactor(watch.NewFake(), nil))
return &Clientset{fakePtr, &fakediscovery.FakeDiscovery{Fake: &fakePtr}}
}
// Clientset implements clientset.Interface. Meant to be embedded into a
// struct to get a default implementation. This makes faking out just the method
// you want to test easier.
type Clientset struct {
testing.Fake
discovery *fakediscovery.FakeDiscovery
}
func (c *Clientset) Discovery() discovery.DiscoveryInterface {
return c.discovery
}
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}
}
/*
* Copyright (c) 2018 UPLEX Nils Goroll Systemoptimierung
* All rights reserved
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
// Code generated by client-gen. DO NOT EDIT.
// This package has the automatically generated fake clientset.
package fake
/*
* Copyright (c) 2018 UPLEX Nils Goroll Systemoptimierung
* All rights reserved
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
ingressv1alpha1 "code.uplex.de/uplex-varnish/k8s-ingress/pkg/apis/varnishingress/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
schema "k8s.io/apimachinery/pkg/runtime/schema"
serializer "k8s.io/apimachinery/pkg/runtime/serializer"
)
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)
}
// AddToScheme adds all types of this clientset into the given scheme. This allows composition
// of clientsets, like in:
//
// import (
// "k8s.io/client-go/kubernetes"
// clientsetscheme "k8s.io/client-go/kuberentes/scheme"
// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
// )
//
// kclientset, _ := kubernetes.NewForConfig(c)
// aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
//
// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types
// correctly.
func AddToScheme(scheme *runtime.Scheme) {
ingressv1alpha1.AddToScheme(scheme)
}
/*
* Copyright (c) 2018 UPLEX Nils Goroll Systemoptimierung
* All rights reserved
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
// Code generated by client-gen. DO NOT EDIT.
// This package contains the scheme of the automatically generated clientset.
package scheme
/*
* Copyright (c) 2018 UPLEX Nils Goroll Systemoptimierung
* All rights reserved
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
// Code generated by client-gen. DO NOT EDIT.
package scheme
import (
ingressv1alpha1 "code.uplex.de/uplex-varnish/k8s-ingress/pkg/apis/varnishingress/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
schema "k8s.io/apimachinery/pkg/runtime/schema"
serializer "k8s.io/apimachinery/pkg/runtime/serializer"
)
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)
}
// AddToScheme adds all types of this clientset into the given scheme. This allows composition
// of clientsets, like in:
//
// import (
// "k8s.io/client-go/kubernetes"
// clientsetscheme "k8s.io/client-go/kuberentes/scheme"
// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
// )
//
// kclientset, _ := kubernetes.NewForConfig(c)
// aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
//
// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types
// correctly.
func AddToScheme(scheme *runtime.Scheme) {
ingressv1alpha1.AddToScheme(scheme)
}
/*
* Copyright (c) 2018 UPLEX Nils Goroll Systemoptimierung
* All rights reserved
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
// Code generated by client-gen. DO NOT EDIT.
// This package has the automatically generated typed clients.
package v1alpha1
/*
* Copyright (c) 2018 UPLEX Nils Goroll Systemoptimierung
* All rights reserved
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
// Code generated by client-gen. DO NOT EDIT.
// Package fake has the automatically generated clients.
package fake
/*
* Copyright (c) 2018 UPLEX Nils Goroll Systemoptimierung
* All rights reserved
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
v1alpha1 "code.uplex.de/uplex-varnish/k8s-ingress/pkg/apis/varnishingress/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
)
// FakeVarnishConfigs implements VarnishConfigInterface
type FakeVarnishConfigs struct {
Fake *FakeIngressV1alpha1
ns string
}
var varnishconfigsResource = schema.GroupVersionResource{Group: "ingress.varnish-cache.org", Version: "v1alpha1", Resource: "varnishconfigs"}
var varnishconfigsKind = schema.GroupVersionKind{Group: "ingress.varnish-cache.org", Version: "v1alpha1", Kind: "VarnishConfig"}
// Get takes name of the varnishConfig, and returns the corresponding varnishConfig object, and an error if there is any.
func (c *FakeVarnishConfigs) Get(name string, options v1.GetOptions) (result *v1alpha1.VarnishConfig, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(varnishconfigsResource, c.ns, name), &v1alpha1.VarnishConfig{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.VarnishConfig), err
}
// List takes label and field selectors, and returns the list of VarnishConfigs that match those selectors.
func (c *FakeVarnishConfigs) List(opts v1.ListOptions) (result *v1alpha1.VarnishConfigList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(varnishconfigsResource, varnishconfigsKind, c.ns, opts), &v1alpha1.VarnishConfigList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1alpha1.VarnishConfigList{}
for _, item := range obj.(*v1alpha1.VarnishConfigList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested varnishConfigs.
func (c *FakeVarnishConfigs) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(varnishconfigsResource, c.ns, opts))
}
// Create takes the representation of a varnishConfig and creates it. Returns the server's representation of the varnishConfig, and an error, if there is any.
func (c *FakeVarnishConfigs) Create(varnishConfig *v1alpha1.VarnishConfig) (result *v1alpha1.VarnishConfig, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(varnishconfigsResource, c.ns, varnishConfig), &v1alpha1.VarnishConfig{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.VarnishConfig), err
}
// Update takes the representation of a varnishConfig and updates it. Returns the server's representation of the varnishConfig, and an error, if there is any.
func (c *FakeVarnishConfigs) Update(varnishConfig *v1alpha1.VarnishConfig) (result *v1alpha1.VarnishConfig, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(varnishconfigsResource, c.ns, varnishConfig), &v1alpha1.VarnishConfig{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.VarnishConfig), err
}
// Delete takes name of the varnishConfig and deletes it. Returns an error if one occurs.
func (c *FakeVarnishConfigs) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(varnishconfigsResource, c.ns, name), &v1alpha1.VarnishConfig{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeVarnishConfigs) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(varnishconfigsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &v1alpha1.VarnishConfigList{})
return err
}
// 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{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.VarnishConfig), err
}
/*
* Copyright (c) 2018 UPLEX Nils Goroll Systemoptimierung
* All rights reserved
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
v1alpha1 "code.uplex.de/uplex-varnish/k8s-ingress/pkg/client/clientset/versioned/typed/varnishingress/v1alpha1"
rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing"
)
type FakeIngressV1alpha1 struct {
*testing.Fake
}
func (c *FakeIngressV1alpha1) VarnishConfigs(namespace string) v1alpha1.VarnishConfigInterface {
return &FakeVarnishConfigs{c, namespace}
}
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *FakeIngressV1alpha1) RESTClient() rest.Interface {
var ret *rest.RESTClient
return ret
}
/*
* Copyright (c) 2018 UPLEX Nils Goroll Systemoptimierung
* All rights reserved
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
type VarnishConfigExpansion interface{}
/*
* Copyright (c) 2018 UPLEX Nils Goroll Systemoptimierung
* All rights reserved
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
import (
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"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
)
// VarnishConfigsGetter has a method to return a VarnishConfigInterface.
// A group's client should implement this interface.
type VarnishConfigsGetter interface {
VarnishConfigs(namespace string) VarnishConfigInterface
}
// VarnishConfigInterface has methods to work with VarnishConfig resources.
type VarnishConfigInterface interface {
Create(*v1alpha1.VarnishConfig) (*v1alpha1.VarnishConfig, error)
Update(*v1alpha1.VarnishConfig) (*v1alpha1.VarnishConfig, error)
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string, options v1.GetOptions) (*v1alpha1.VarnishConfig, error)
List(opts v1.ListOptions) (*v1alpha1.VarnishConfigList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.VarnishConfig, err error)
VarnishConfigExpansion
}
// varnishConfigs implements VarnishConfigInterface
type varnishConfigs struct {
client rest.Interface
ns string
}
// newVarnishConfigs returns a VarnishConfigs
func newVarnishConfigs(c *IngressV1alpha1Client, namespace string) *varnishConfigs {
return &varnishConfigs{
client: c.RESTClient(),
ns: namespace,
}
}
// Get takes name of the varnishConfig, and returns the corresponding varnishConfig object, and an error if there is any.
func (c *varnishConfigs) Get(name string, options v1.GetOptions) (result *v1alpha1.VarnishConfig, err error) {
result = &v1alpha1.VarnishConfig{}
err = c.client.Get().
Namespace(c.ns).
Resource("varnishconfigs").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Into(result)
return
}
// 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) {
result = &v1alpha1.VarnishConfigList{}
err = c.client.Get().
Namespace(c.ns).
Resource("varnishconfigs").
VersionedParams(&opts, scheme.ParameterCodec).
Do().
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested varnishConfigs.
func (c *varnishConfigs) Watch(opts v1.ListOptions) (watch.Interface, error) {
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("varnishconfigs").
VersionedParams(&opts, scheme.ParameterCodec).
Watch()
}
// Create takes the representation of a varnishConfig and creates it. Returns the server's representation of the varnishConfig, and an error, if there is any.
func (c *varnishConfigs) Create(varnishConfig *v1alpha1.VarnishConfig) (result *v1alpha1.VarnishConfig, err error) {
result = &v1alpha1.VarnishConfig{}
err = c.client.Post().
Namespace(c.ns).
Resource("varnishconfigs").
Body(varnishConfig).
Do().
Into(result)
return
}
// Update takes the representation of a varnishConfig and updates it. Returns the server's representation of the varnishConfig, and an error, if there is any.
func (c *varnishConfigs) Update(varnishConfig *v1alpha1.VarnishConfig) (result *v1alpha1.VarnishConfig, err error) {
result = &v1alpha1.VarnishConfig{}
err = c.client.Put().
Namespace(c.ns).
Resource("varnishconfigs").
Name(varnishConfig.Name).
Body(varnishConfig).
Do().
Into(result)
return
}
// Delete takes name of the varnishConfig and deletes it. Returns an error if one occurs.
func (c *varnishConfigs) Delete(name string, options *v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("varnishconfigs").
Name(name).
Body(options).
Do().
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *varnishConfigs) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("varnishconfigs").
VersionedParams(&listOptions, scheme.ParameterCodec).
Body(options).
Do().
Error()
}
// Patch applies the patch and returns the patched varnishConfig.
func (c *varnishConfigs) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.VarnishConfig, err error) {
result = &v1alpha1.VarnishConfig{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("varnishconfigs").
SubResource(subresources...).
Name(name).
Body(data).
Do().
Into(result)
return
}
/*
* Copyright (c) 2018 UPLEX Nils Goroll Systemoptimierung
* All rights reserved
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
// Code generated by client-gen. DO NOT EDIT.
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"
)
type IngressV1alpha1Interface interface {
RESTClient() rest.Interface
VarnishConfigsGetter
}
// IngressV1alpha1Client is used to interact with features provided by the ingress.varnish-cache.org group.
type IngressV1alpha1Client struct {
restClient rest.Interface
}
func (c *IngressV1alpha1Client) VarnishConfigs(namespace string) VarnishConfigInterface {
return newVarnishConfigs(c, namespace)
}
// NewForConfig creates a new IngressV1alpha1Client for the given config.
func NewForConfig(c *rest.Config) (*IngressV1alpha1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientFor(&config)
if err != nil {
return nil, err
}
return &IngressV1alpha1Client{client}, nil
}
// NewForConfigOrDie creates a new IngressV1alpha1Client for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *IngressV1alpha1Client {
client, err := NewForConfig(c)
if err != nil {
panic(err)
}
return client
}
// New creates a new IngressV1alpha1Client for the given RESTClient.
func New(c rest.Interface) *IngressV1alpha1Client {
return &IngressV1alpha1Client{c}
}
func setConfigDefaults(config *rest.Config) error {
gv := v1alpha1.SchemeGroupVersion
config.GroupVersion = &gv
config.APIPath = "/apis"
config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: scheme.Codecs}
if config.UserAgent == "" {
config.UserAgent = rest.DefaultKubernetesUserAgent()
}
return nil
}
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *IngressV1alpha1Client) RESTClient() rest.Interface {
if c == nil {
return nil
}
return c.restClient
}
/*
* Copyright (c) 2018 UPLEX Nils Goroll Systemoptimierung
* All rights reserved
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
// Code generated by informer-gen. DO NOT EDIT.
// This file was automatically generated by informer-gen
package externalversions
import (
reflect "reflect"
sync "sync"
time "time"
versioned "code.uplex.de/uplex-varnish/k8s-ingress/pkg/client/clientset/versioned"
internalinterfaces "code.uplex.de/uplex-varnish/k8s-ingress/pkg/client/informers/externalversions/internalinterfaces"
varnishingress "code.uplex.de/uplex-varnish/k8s-ingress/pkg/client/informers/externalversions/varnishingress"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
schema "k8s.io/apimachinery/pkg/runtime/schema"
cache "k8s.io/client-go/tools/cache"
)
type sharedInformerFactory struct {
client versioned.Interface
namespace string
tweakListOptions internalinterfaces.TweakListOptionsFunc
lock sync.Mutex
defaultResync time.Duration
informers map[reflect.Type]cache.SharedIndexInformer
// startedInformers is used for tracking which informers have been started.
// This allows Start() to be called multiple times safely.
startedInformers map[reflect.Type]bool
}
// NewSharedInformerFactory constructs a new instance of sharedInformerFactory
func NewSharedInformerFactory(client versioned.Interface, defaultResync time.Duration) SharedInformerFactory {
return NewFilteredSharedInformerFactory(client, defaultResync, v1.NamespaceAll, nil)
}
// NewFilteredSharedInformerFactory constructs a new instance of sharedInformerFactory.
// Listers obtained via this SharedInformerFactory will be subject to the same filters
// as specified here.
func NewFilteredSharedInformerFactory(client versioned.Interface, defaultResync time.Duration, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerFactory {
return &sharedInformerFactory{
client: client,
namespace: namespace,
tweakListOptions: tweakListOptions,
defaultResync: defaultResync,
informers: make(map[reflect.Type]cache.SharedIndexInformer),
startedInformers: make(map[reflect.Type]bool),
}
}
// Start initializes all requested informers.
func (f *sharedInformerFactory) Start(stopCh <-chan struct{}) {
f.lock.Lock()
defer f.lock.Unlock()
for informerType, informer := range f.informers {
if !f.startedInformers[informerType] {
go informer.Run(stopCh)
f.startedInformers[informerType] = true
}
}
}
// WaitForCacheSync waits for all started informers' cache were synced.
func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool {
informers := func() map[reflect.Type]cache.SharedIndexInformer {
f.lock.Lock()
defer f.lock.Unlock()
informers := map[reflect.Type]cache.SharedIndexInformer{}
for informerType, informer := range f.informers {
if f.startedInformers[informerType] {
informers[informerType] = informer
}
}
return informers
}()
res := map[reflect.Type]bool{}
for informType, informer := range informers {
res[informType] = cache.WaitForCacheSync(stopCh, informer.HasSynced)
}
return res
}
// InternalInformerFor returns the SharedIndexInformer for obj using an internal
// client.
func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer {
f.lock.Lock()
defer f.lock.Unlock()
informerType := reflect.TypeOf(obj)
informer, exists := f.informers[informerType]
if exists {
return informer
}
informer = newFunc(f.client, f.defaultResync)
f.informers[informerType] = informer
return informer
}
// SharedInformerFactory provides shared informers for resources in all known
// API group versions.
type SharedInformerFactory interface {
internalinterfaces.SharedInformerFactory
ForResource(resource schema.GroupVersionResource) (GenericInformer, error)
WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool
Ingress() varnishingress.Interface
}
func (f *sharedInformerFactory) Ingress() varnishingress.Interface {
return varnishingress.New(f, f.namespace, f.tweakListOptions)
}
/*
* Copyright (c) 2018 UPLEX Nils Goroll Systemoptimierung
* All rights reserved
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
// Code generated by informer-gen. DO NOT EDIT.
// This file was automatically generated by informer-gen
package externalversions
import (
"fmt"
v1alpha1 "code.uplex.de/uplex-varnish/k8s-ingress/pkg/apis/varnishingress/v1alpha1"
schema "k8s.io/apimachinery/pkg/runtime/schema"
cache "k8s.io/client-go/tools/cache"
)
// GenericInformer is type of SharedIndexInformer which will locate and delegate to other
// sharedInformers based on type
type GenericInformer interface {
Informer() cache.SharedIndexInformer
Lister() cache.GenericLister
}
type genericInformer struct {
informer cache.SharedIndexInformer
resource schema.GroupResource
}
// Informer returns the SharedIndexInformer.
func (f *genericInformer) Informer() cache.SharedIndexInformer {
return f.informer
}
// Lister returns the GenericLister.
func (f *genericInformer) Lister() cache.GenericLister {
return cache.NewGenericLister(f.Informer().GetIndexer(), f.resource)
}
// ForResource gives generic access to a shared informer of the matching type
// TODO extend this to unknown resources with a client pool
func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) {
switch resource {
// Group=ingress.varnish-cache.org, Version=v1alpha1
case v1alpha1.SchemeGroupVersion.WithResource("varnishconfigs"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Ingress().V1alpha1().VarnishConfigs().Informer()}, nil
}
return nil, fmt.Errorf("no informer found for %v", resource)
}
/*
* Copyright (c) 2018 UPLEX Nils Goroll Systemoptimierung
* All rights reserved
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
// Code generated by informer-gen. DO NOT EDIT.
// This file was automatically generated by informer-gen
package internalinterfaces
import (
time "time"
versioned "code.uplex.de/uplex-varnish/k8s-ingress/pkg/client/clientset/versioned"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
cache "k8s.io/client-go/tools/cache"
)
type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer
// SharedInformerFactory a small interface to allow for adding an informer without an import cycle
type SharedInformerFactory interface {
Start(stopCh <-chan struct{})
InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer
}
type TweakListOptionsFunc func(*v1.ListOptions)
/*
* Copyright (c) 2018 UPLEX Nils Goroll Systemoptimierung
* All rights reserved
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
// Code generated by informer-gen. DO NOT EDIT.
// This file was automatically generated by informer-gen
package ingress
import (
internalinterfaces "code.uplex.de/uplex-varnish/k8s-ingress/pkg/client/informers/externalversions/internalinterfaces"
v1alpha1 "code.uplex.de/uplex-varnish/k8s-ingress/pkg/client/informers/externalversions/varnishingress/v1alpha1"
)
// Interface provides access to each of this group's versions.
type Interface interface {
// V1alpha1 provides access to shared informers for resources in V1alpha1.
V1alpha1() v1alpha1.Interface
}
type group struct {
factory internalinterfaces.SharedInformerFactory
namespace string
tweakListOptions internalinterfaces.TweakListOptionsFunc
}
// New returns a new Interface.
func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface {
return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions}
}
// V1alpha1 returns a new v1alpha1.Interface.
func (g *group) V1alpha1() v1alpha1.Interface {
return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions)
}
/*
* Copyright (c) 2018 UPLEX Nils Goroll Systemoptimierung
* All rights reserved
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
// Code generated by informer-gen. DO NOT EDIT.
// This file was automatically generated by informer-gen
package v1alpha1
import (
internalinterfaces "code.uplex.de/uplex-varnish/k8s-ingress/pkg/client/informers/externalversions/internalinterfaces"
)
// Interface provides access to all the informers in this group version.
type Interface interface {
// VarnishConfigs returns a VarnishConfigInformer.
VarnishConfigs() VarnishConfigInformer
}
type version struct {
factory internalinterfaces.SharedInformerFactory
namespace string
tweakListOptions internalinterfaces.TweakListOptionsFunc
}
// New returns a new Interface.
func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface {
return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions}
}
// VarnishConfigs returns a VarnishConfigInformer.
func (v *version) VarnishConfigs() VarnishConfigInformer {
return &varnishConfigInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
}
/*
* Copyright (c) 2018 UPLEX Nils Goroll Systemoptimierung
* All rights reserved
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
// Code generated by informer-gen. DO NOT EDIT.
// This file was automatically generated by informer-gen
package v1alpha1
import (
time "time"
varnishingressv1alpha1 "code.uplex.de/uplex-varnish/k8s-ingress/pkg/apis/varnishingress/v1alpha1"
versioned "code.uplex.de/uplex-varnish/k8s-ingress/pkg/client/clientset/versioned"
internalinterfaces "code.uplex.de/uplex-varnish/k8s-ingress/pkg/client/informers/externalversions/internalinterfaces"
v1alpha1 "code.uplex.de/uplex-varnish/k8s-ingress/pkg/client/listers/varnishingress/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache"
)
// VarnishConfigInformer provides access to a shared informer and lister for
// VarnishConfigs.
type VarnishConfigInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1alpha1.VarnishConfigLister
}
type varnishConfigInformer struct {
factory internalinterfaces.SharedInformerFactory
tweakListOptions internalinterfaces.TweakListOptionsFunc
namespace string
}
// NewVarnishConfigInformer constructs a new informer for VarnishConfig type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewVarnishConfigInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return NewFilteredVarnishConfigInformer(client, namespace, resyncPeriod, indexers, nil)
}
// NewFilteredVarnishConfigInformer constructs a new informer for VarnishConfig type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewFilteredVarnishConfigInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.IngressV1alpha1().VarnishConfigs(namespace).List(options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.IngressV1alpha1().VarnishConfigs(namespace).Watch(options)
},
},
&varnishingressv1alpha1.VarnishConfig{},
resyncPeriod,
indexers,
)
}
func (f *varnishConfigInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewFilteredVarnishConfigInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
}
func (f *varnishConfigInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&varnishingressv1alpha1.VarnishConfig{}, f.defaultInformer)
}
func (f *varnishConfigInformer) Lister() v1alpha1.VarnishConfigLister {
return v1alpha1.NewVarnishConfigLister(f.Informer().GetIndexer())
}
/*
* Copyright (c) 2018 UPLEX Nils Goroll Systemoptimierung
* All rights reserved
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
// Code generated by lister-gen. DO NOT EDIT.
// This file was automatically generated by lister-gen
package v1alpha1
// VarnishConfigListerExpansion allows custom methods to be added to
// VarnishConfigLister.
type VarnishConfigListerExpansion interface{}
// VarnishConfigNamespaceListerExpansion allows custom methods to be added to
// VarnishConfigNamespaceLister.
type VarnishConfigNamespaceListerExpansion interface{}
/*
* Copyright (c) 2018 UPLEX Nils Goroll Systemoptimierung
* All rights reserved
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
// Code generated by lister-gen. DO NOT EDIT.
// This file was automatically generated by lister-gen
package v1alpha1
import (
v1alpha1 "code.uplex.de/uplex-varnish/k8s-ingress/pkg/apis/varnishingress/v1alpha1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
)
// VarnishConfigLister helps list VarnishConfigs.
type VarnishConfigLister interface {
// List lists all VarnishConfigs in the indexer.
List(selector labels.Selector) (ret []*v1alpha1.VarnishConfig, err error)
// VarnishConfigs returns an object that can list and get VarnishConfigs.
VarnishConfigs(namespace string) VarnishConfigNamespaceLister
VarnishConfigListerExpansion
}
// varnishConfigLister implements the VarnishConfigLister interface.
type varnishConfigLister struct {
indexer cache.Indexer
}
// NewVarnishConfigLister returns a new VarnishConfigLister.
func NewVarnishConfigLister(indexer cache.Indexer) VarnishConfigLister {
return &varnishConfigLister{indexer: indexer}
}
// List lists all VarnishConfigs in the indexer.
func (s *varnishConfigLister) List(selector labels.Selector) (ret []*v1alpha1.VarnishConfig, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.VarnishConfig))
})
return ret, err
}
// VarnishConfigs returns an object that can list and get VarnishConfigs.
func (s *varnishConfigLister) VarnishConfigs(namespace string) VarnishConfigNamespaceLister {
return varnishConfigNamespaceLister{indexer: s.indexer, namespace: namespace}
}
// VarnishConfigNamespaceLister helps list and get VarnishConfigs.
type VarnishConfigNamespaceLister interface {
// List lists all VarnishConfigs in the indexer for a given namespace.
List(selector labels.Selector) (ret []*v1alpha1.VarnishConfig, err error)
// Get retrieves the VarnishConfig from the indexer for a given namespace and name.
Get(name string) (*v1alpha1.VarnishConfig, error)
VarnishConfigNamespaceListerExpansion
}
// varnishConfigNamespaceLister implements the VarnishConfigNamespaceLister
// interface.
type varnishConfigNamespaceLister struct {
indexer cache.Indexer
namespace string
}
// List lists all VarnishConfigs in the indexer for a given namespace.
func (s varnishConfigNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.VarnishConfig, err error) {
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.VarnishConfig))
})
return ret, err
}
// Get retrieves the VarnishConfig from the indexer for a given namespace and name.
func (s varnishConfigNamespaceLister) Get(name string) (*v1alpha1.VarnishConfig, error) {
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1alpha1.Resource("varnishconfig"), name)
}
return obj.(*v1alpha1.VarnishConfig), nil
}
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