Commit 7c22f4d5 authored by Geoff Simmons's avatar Geoff Simmons

WIP: update client-go to v0.22.1, supporting k8s 1.22.

In this commit, the code compiles and passes make check. But we
currently can't test anything else, because the manifests/charts
still use API groups that are obsolete in this k8s version.
parent 1fd111fc
......@@ -26,12 +26,12 @@
all: k8s-ingress
KUBEVER=kubernetes-1.16.4
KUBEVER=kubernetes-1.22.1
install-code-gen:
go get k8s.io/code-generator/cmd/client-gen@$(KUBEVER)
go get k8s.io/code-generator/cmd/deepcopy-gen@$(KUBEVER)
go get k8s.io/code-generator/cmd/lister-gen@$(KUBEVER)
go get k8s.io/code-generator/cmd/informer-gen@$(KUBEVER)
go install k8s.io/code-generator/cmd/client-gen@$(KUBEVER)
go install k8s.io/code-generator/cmd/deepcopy-gen@$(KUBEVER)
go install k8s.io/code-generator/cmd/lister-gen@$(KUBEVER)
go install k8s.io/code-generator/cmd/informer-gen@$(KUBEVER)
CODE_SUBDIRS=./pkg/... ./cmd/...
build:
......
......@@ -13,9 +13,9 @@ require (
github.com/go-openapi/strfmt v0.20.1
github.com/go-openapi/swag v0.19.15 // indirect
github.com/go-openapi/validate v0.20.2 // indirect
github.com/golang/groupcache v0.0.0-20181024230925-c65c006176ff // indirect
github.com/google/go-cmp v0.5.2
github.com/googleapis/gnostic v0.2.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/google/go-cmp v0.5.5
github.com/googleapis/gnostic v0.5.5 // indirect
github.com/haproxytech/models/v2 v2.2.0
github.com/imdario/mergo v0.3.6 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
......@@ -24,9 +24,9 @@ require (
github.com/sirupsen/logrus v1.6.0
go.mongodb.org/mongo-driver v1.5.3 // indirect
golang.org/x/net v0.0.0-20210525063256-abc453219eb5 // indirect
k8s.io/api v0.16.15
k8s.io/apimachinery v0.16.15
k8s.io/client-go v0.16.15
k8s.io/api v0.22.1
k8s.io/apimachinery v0.22.1
k8s.io/client-go v0.22.1
)
require (
......@@ -34,17 +34,17 @@ require (
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/evanphx/json-patch v4.9.0+incompatible // indirect
github.com/evanphx/json-patch v4.11.0+incompatible // indirect
github.com/go-logr/logr v0.4.0 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/loads v0.20.2 // indirect
github.com/go-openapi/spec v0.20.3 // indirect
github.com/go-stack/stack v1.8.0 // indirect
github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d // indirect
github.com/golang/protobuf v1.3.1 // indirect
github.com/google/gofuzz v1.0.0 // indirect
github.com/hashicorp/golang-lru v0.5.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.7 // indirect
github.com/json-iterator/go v1.1.11 // indirect
github.com/konsorten/go-windows-terminal-sequences v1.0.3 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/mitchellh/mapstructure v1.4.1 // indirect
......@@ -52,20 +52,23 @@ require (
github.com/modern-go/reflect2 v1.0.1 // indirect
github.com/oklog/ulid v1.3.1 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910 // indirect
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 // indirect
github.com/prometheus/common v0.0.0-20181126121408-4724e9255275 // indirect
github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a // indirect
github.com/spf13/pflag v1.0.5 // indirect
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 // indirect
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 // indirect
golang.org/x/sys v0.0.0-20210423082822-04245dca01da // indirect
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d // indirect
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 // indirect
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d // indirect
golang.org/x/text v0.3.6 // indirect
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 // indirect
google.golang.org/appengine v1.5.0 // indirect
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
google.golang.org/appengine v1.6.5 // indirect
google.golang.org/protobuf v1.26.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
k8s.io/klog v1.0.0 // indirect
k8s.io/kube-openapi v0.0.0-20200410163147-594e756bea31 // indirect
k8s.io/utils v0.0.0-20190801114015-581e00157fb1 // indirect
sigs.k8s.io/yaml v1.1.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
k8s.io/klog/v2 v2.9.0 // indirect
k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e // indirect
k8s.io/utils v0.0.0-20210707171843-4b05e18ac7d9 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.1.2 // indirect
sigs.k8s.io/yaml v1.2.0 // indirect
)
This diff is collapsed.
......@@ -69,7 +69,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
configShallowCopy := *c
if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 {
if configShallowCopy.Burst <= 0 {
return nil, fmt.Errorf("Burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0")
return nil, fmt.Errorf("burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0")
}
configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst)
}
......
......@@ -84,7 +84,10 @@ func (c *Clientset) Tracker() testing.ObjectTracker {
return c.tracker
}
var _ clientset.Interface = &Clientset{}
var (
_ clientset.Interface = &Clientset{}
_ testing.FakeClient = &Clientset{}
)
// IngressV1alpha1 retrieves the IngressV1alpha1Client
func (c *Clientset) IngressV1alpha1() ingressv1alpha1.IngressV1alpha1Interface {
......
......@@ -39,7 +39,7 @@ import (
var scheme = runtime.NewScheme()
var codecs = serializer.NewCodecFactory(scheme)
var parameterCodec = runtime.NewParameterCodec(scheme)
var localSchemeBuilder = runtime.SchemeBuilder{
ingressv1alpha1.AddToScheme,
}
......
......@@ -29,6 +29,7 @@
package v1alpha1
import (
"context"
"time"
v1alpha1 "code.uplex.de/uplex-varnish/k8s-ingress/pkg/apis/varnishingress/v1alpha1"
......@@ -47,14 +48,14 @@ type BackendConfigsGetter interface {
// BackendConfigInterface has methods to work with BackendConfig resources.
type BackendConfigInterface interface {
Create(*v1alpha1.BackendConfig) (*v1alpha1.BackendConfig, error)
Update(*v1alpha1.BackendConfig) (*v1alpha1.BackendConfig, error)
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string, options v1.GetOptions) (*v1alpha1.BackendConfig, error)
List(opts v1.ListOptions) (*v1alpha1.BackendConfigList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.BackendConfig, err error)
Create(ctx context.Context, backendConfig *v1alpha1.BackendConfig, opts v1.CreateOptions) (*v1alpha1.BackendConfig, error)
Update(ctx context.Context, backendConfig *v1alpha1.BackendConfig, opts v1.UpdateOptions) (*v1alpha1.BackendConfig, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.BackendConfig, error)
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.BackendConfigList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.BackendConfig, err error)
BackendConfigExpansion
}
......@@ -73,20 +74,20 @@ func newBackendConfigs(c *IngressV1alpha1Client, namespace string) *backendConfi
}
// Get takes name of the backendConfig, and returns the corresponding backendConfig object, and an error if there is any.
func (c *backendConfigs) Get(name string, options v1.GetOptions) (result *v1alpha1.BackendConfig, err error) {
func (c *backendConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.BackendConfig, err error) {
result = &v1alpha1.BackendConfig{}
err = c.client.Get().
Namespace(c.ns).
Resource("backendconfigs").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of BackendConfigs that match those selectors.
func (c *backendConfigs) List(opts v1.ListOptions) (result *v1alpha1.BackendConfigList, err error) {
func (c *backendConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.BackendConfigList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
......@@ -97,13 +98,13 @@ func (c *backendConfigs) List(opts v1.ListOptions) (result *v1alpha1.BackendConf
Resource("backendconfigs").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested backendConfigs.
func (c *backendConfigs) Watch(opts v1.ListOptions) (watch.Interface, error) {
func (c *backendConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
......@@ -114,71 +115,74 @@ func (c *backendConfigs) Watch(opts v1.ListOptions) (watch.Interface, error) {
Resource("backendconfigs").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(ctx)
}
// Create takes the representation of a backendConfig and creates it. Returns the server's representation of the backendConfig, and an error, if there is any.
func (c *backendConfigs) Create(backendConfig *v1alpha1.BackendConfig) (result *v1alpha1.BackendConfig, err error) {
func (c *backendConfigs) Create(ctx context.Context, backendConfig *v1alpha1.BackendConfig, opts v1.CreateOptions) (result *v1alpha1.BackendConfig, err error) {
result = &v1alpha1.BackendConfig{}
err = c.client.Post().
Namespace(c.ns).
Resource("backendconfigs").
VersionedParams(&opts, scheme.ParameterCodec).
Body(backendConfig).
Do().
Do(ctx).
Into(result)
return
}
// Update takes the representation of a backendConfig and updates it. Returns the server's representation of the backendConfig, and an error, if there is any.
func (c *backendConfigs) Update(backendConfig *v1alpha1.BackendConfig) (result *v1alpha1.BackendConfig, err error) {
func (c *backendConfigs) Update(ctx context.Context, backendConfig *v1alpha1.BackendConfig, opts v1.UpdateOptions) (result *v1alpha1.BackendConfig, err error) {
result = &v1alpha1.BackendConfig{}
err = c.client.Put().
Namespace(c.ns).
Resource("backendconfigs").
Name(backendConfig.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(backendConfig).
Do().
Do(ctx).
Into(result)
return
}
// Delete takes name of the backendConfig and deletes it. Returns an error if one occurs.
func (c *backendConfigs) Delete(name string, options *v1.DeleteOptions) error {
func (c *backendConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("backendconfigs").
Name(name).
Body(options).
Do().
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *backendConfigs) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
func (c *backendConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("backendconfigs").
VersionedParams(&listOptions, scheme.ParameterCodec).
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched backendConfig.
func (c *backendConfigs) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.BackendConfig, err error) {
func (c *backendConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.BackendConfig, err error) {
result = &v1alpha1.BackendConfig{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("backendconfigs").
SubResource(subresources...).
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do().
Do(ctx).
Into(result)
return
}
......@@ -29,6 +29,8 @@
package fake
import (
"context"
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"
......@@ -49,7 +51,7 @@ var backendconfigsResource = schema.GroupVersionResource{Group: "ingress.varnish
var backendconfigsKind = schema.GroupVersionKind{Group: "ingress.varnish-cache.org", Version: "v1alpha1", Kind: "BackendConfig"}
// Get takes name of the backendConfig, and returns the corresponding backendConfig object, and an error if there is any.
func (c *FakeBackendConfigs) Get(name string, options v1.GetOptions) (result *v1alpha1.BackendConfig, err error) {
func (c *FakeBackendConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.BackendConfig, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(backendconfigsResource, c.ns, name), &v1alpha1.BackendConfig{})
......@@ -60,7 +62,7 @@ func (c *FakeBackendConfigs) Get(name string, options v1.GetOptions) (result *v1
}
// List takes label and field selectors, and returns the list of BackendConfigs that match those selectors.
func (c *FakeBackendConfigs) List(opts v1.ListOptions) (result *v1alpha1.BackendConfigList, err error) {
func (c *FakeBackendConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.BackendConfigList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(backendconfigsResource, backendconfigsKind, c.ns, opts), &v1alpha1.BackendConfigList{})
......@@ -82,14 +84,14 @@ func (c *FakeBackendConfigs) List(opts v1.ListOptions) (result *v1alpha1.Backend
}
// Watch returns a watch.Interface that watches the requested backendConfigs.
func (c *FakeBackendConfigs) Watch(opts v1.ListOptions) (watch.Interface, error) {
func (c *FakeBackendConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(backendconfigsResource, c.ns, opts))
}
// Create takes the representation of a backendConfig and creates it. Returns the server's representation of the backendConfig, and an error, if there is any.
func (c *FakeBackendConfigs) Create(backendConfig *v1alpha1.BackendConfig) (result *v1alpha1.BackendConfig, err error) {
func (c *FakeBackendConfigs) Create(ctx context.Context, backendConfig *v1alpha1.BackendConfig, opts v1.CreateOptions) (result *v1alpha1.BackendConfig, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(backendconfigsResource, c.ns, backendConfig), &v1alpha1.BackendConfig{})
......@@ -100,7 +102,7 @@ func (c *FakeBackendConfigs) Create(backendConfig *v1alpha1.BackendConfig) (resu
}
// Update takes the representation of a backendConfig and updates it. Returns the server's representation of the backendConfig, and an error, if there is any.
func (c *FakeBackendConfigs) Update(backendConfig *v1alpha1.BackendConfig) (result *v1alpha1.BackendConfig, err error) {
func (c *FakeBackendConfigs) Update(ctx context.Context, backendConfig *v1alpha1.BackendConfig, opts v1.UpdateOptions) (result *v1alpha1.BackendConfig, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(backendconfigsResource, c.ns, backendConfig), &v1alpha1.BackendConfig{})
......@@ -111,7 +113,7 @@ func (c *FakeBackendConfigs) Update(backendConfig *v1alpha1.BackendConfig) (resu
}
// Delete takes name of the backendConfig and deletes it. Returns an error if one occurs.
func (c *FakeBackendConfigs) Delete(name string, options *v1.DeleteOptions) error {
func (c *FakeBackendConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(backendconfigsResource, c.ns, name), &v1alpha1.BackendConfig{})
......@@ -119,15 +121,15 @@ func (c *FakeBackendConfigs) Delete(name string, options *v1.DeleteOptions) erro
}
// DeleteCollection deletes a collection of objects.
func (c *FakeBackendConfigs) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(backendconfigsResource, c.ns, listOptions)
func (c *FakeBackendConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(backendconfigsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v1alpha1.BackendConfigList{})
return err
}
// Patch applies the patch and returns the patched backendConfig.
func (c *FakeBackendConfigs) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.BackendConfig, err error) {
func (c *FakeBackendConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.BackendConfig, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(backendconfigsResource, c.ns, name, pt, data, subresources...), &v1alpha1.BackendConfig{})
......
......@@ -29,6 +29,8 @@
package fake
import (
"context"
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"
......@@ -49,7 +51,7 @@ var templateconfigsResource = schema.GroupVersionResource{Group: "ingress.varnis
var templateconfigsKind = schema.GroupVersionKind{Group: "ingress.varnish-cache.org", Version: "v1alpha1", Kind: "TemplateConfig"}
// Get takes name of the templateConfig, and returns the corresponding templateConfig object, and an error if there is any.
func (c *FakeTemplateConfigs) Get(name string, options v1.GetOptions) (result *v1alpha1.TemplateConfig, err error) {
func (c *FakeTemplateConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.TemplateConfig, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(templateconfigsResource, c.ns, name), &v1alpha1.TemplateConfig{})
......@@ -60,7 +62,7 @@ func (c *FakeTemplateConfigs) Get(name string, options v1.GetOptions) (result *v
}
// List takes label and field selectors, and returns the list of TemplateConfigs that match those selectors.
func (c *FakeTemplateConfigs) List(opts v1.ListOptions) (result *v1alpha1.TemplateConfigList, err error) {
func (c *FakeTemplateConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.TemplateConfigList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(templateconfigsResource, templateconfigsKind, c.ns, opts), &v1alpha1.TemplateConfigList{})
......@@ -82,14 +84,14 @@ func (c *FakeTemplateConfigs) List(opts v1.ListOptions) (result *v1alpha1.Templa
}
// Watch returns a watch.Interface that watches the requested templateConfigs.
func (c *FakeTemplateConfigs) Watch(opts v1.ListOptions) (watch.Interface, error) {
func (c *FakeTemplateConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(templateconfigsResource, c.ns, opts))
}
// Create takes the representation of a templateConfig and creates it. Returns the server's representation of the templateConfig, and an error, if there is any.
func (c *FakeTemplateConfigs) Create(templateConfig *v1alpha1.TemplateConfig) (result *v1alpha1.TemplateConfig, err error) {
func (c *FakeTemplateConfigs) Create(ctx context.Context, templateConfig *v1alpha1.TemplateConfig, opts v1.CreateOptions) (result *v1alpha1.TemplateConfig, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(templateconfigsResource, c.ns, templateConfig), &v1alpha1.TemplateConfig{})
......@@ -100,7 +102,7 @@ func (c *FakeTemplateConfigs) Create(templateConfig *v1alpha1.TemplateConfig) (r
}
// Update takes the representation of a templateConfig and updates it. Returns the server's representation of the templateConfig, and an error, if there is any.
func (c *FakeTemplateConfigs) Update(templateConfig *v1alpha1.TemplateConfig) (result *v1alpha1.TemplateConfig, err error) {
func (c *FakeTemplateConfigs) Update(ctx context.Context, templateConfig *v1alpha1.TemplateConfig, opts v1.UpdateOptions) (result *v1alpha1.TemplateConfig, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(templateconfigsResource, c.ns, templateConfig), &v1alpha1.TemplateConfig{})
......@@ -111,7 +113,7 @@ func (c *FakeTemplateConfigs) Update(templateConfig *v1alpha1.TemplateConfig) (r
}
// Delete takes name of the templateConfig and deletes it. Returns an error if one occurs.
func (c *FakeTemplateConfigs) Delete(name string, options *v1.DeleteOptions) error {
func (c *FakeTemplateConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(templateconfigsResource, c.ns, name), &v1alpha1.TemplateConfig{})
......@@ -119,15 +121,15 @@ func (c *FakeTemplateConfigs) Delete(name string, options *v1.DeleteOptions) err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeTemplateConfigs) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(templateconfigsResource, c.ns, listOptions)
func (c *FakeTemplateConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(templateconfigsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v1alpha1.TemplateConfigList{})
return err
}
// Patch applies the patch and returns the patched templateConfig.
func (c *FakeTemplateConfigs) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.TemplateConfig, err error) {
func (c *FakeTemplateConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.TemplateConfig, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(templateconfigsResource, c.ns, name, pt, data, subresources...), &v1alpha1.TemplateConfig{})
......
......@@ -29,6 +29,8 @@
package fake
import (
"context"
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"
......@@ -49,7 +51,7 @@ var varnishconfigsResource = schema.GroupVersionResource{Group: "ingress.varnish
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) {
func (c *FakeVarnishConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VarnishConfig, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(varnishconfigsResource, c.ns, name), &v1alpha1.VarnishConfig{})
......@@ -60,7 +62,7 @@ func (c *FakeVarnishConfigs) Get(name string, options v1.GetOptions) (result *v1
}
// 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) {
func (c *FakeVarnishConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.VarnishConfigList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(varnishconfigsResource, varnishconfigsKind, c.ns, opts), &v1alpha1.VarnishConfigList{})
......@@ -82,14 +84,14 @@ func (c *FakeVarnishConfigs) List(opts v1.ListOptions) (result *v1alpha1.Varnish
}
// Watch returns a watch.Interface that watches the requested varnishConfigs.
func (c *FakeVarnishConfigs) Watch(opts v1.ListOptions) (watch.Interface, error) {
func (c *FakeVarnishConfigs) Watch(ctx context.Context, 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) {
func (c *FakeVarnishConfigs) Create(ctx context.Context, varnishConfig *v1alpha1.VarnishConfig, opts v1.CreateOptions) (result *v1alpha1.VarnishConfig, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(varnishconfigsResource, c.ns, varnishConfig), &v1alpha1.VarnishConfig{})
......@@ -100,7 +102,7 @@ func (c *FakeVarnishConfigs) Create(varnishConfig *v1alpha1.VarnishConfig) (resu
}
// 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) {
func (c *FakeVarnishConfigs) Update(ctx context.Context, varnishConfig *v1alpha1.VarnishConfig, opts v1.UpdateOptions) (result *v1alpha1.VarnishConfig, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(varnishconfigsResource, c.ns, varnishConfig), &v1alpha1.VarnishConfig{})
......@@ -111,7 +113,7 @@ func (c *FakeVarnishConfigs) Update(varnishConfig *v1alpha1.VarnishConfig) (resu
}
// 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 {
func (c *FakeVarnishConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(varnishconfigsResource, c.ns, name), &v1alpha1.VarnishConfig{})
......@@ -119,15 +121,15 @@ func (c *FakeVarnishConfigs) Delete(name string, options *v1.DeleteOptions) erro
}
// DeleteCollection deletes a collection of objects.
func (c *FakeVarnishConfigs) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(varnishconfigsResource, c.ns, listOptions)
func (c *FakeVarnishConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(varnishconfigsResource, c.ns, listOpts)
_, 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) {
func (c *FakeVarnishConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.VarnishConfig, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(varnishconfigsResource, c.ns, name, pt, data, subresources...), &v1alpha1.VarnishConfig{})
......
......@@ -29,6 +29,7 @@
package v1alpha1
import (
"context"
"time"
v1alpha1 "code.uplex.de/uplex-varnish/k8s-ingress/pkg/apis/varnishingress/v1alpha1"
......@@ -47,14 +48,14 @@ type TemplateConfigsGetter interface {
// TemplateConfigInterface has methods to work with TemplateConfig resources.
type TemplateConfigInterface interface {
Create(*v1alpha1.TemplateConfig) (*v1alpha1.TemplateConfig, error)
Update(*v1alpha1.TemplateConfig) (*v1alpha1.TemplateConfig, error)
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string, options v1.GetOptions) (*v1alpha1.TemplateConfig, error)
List(opts v1.ListOptions) (*v1alpha1.TemplateConfigList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.TemplateConfig, err error)
Create(ctx context.Context, templateConfig *v1alpha1.TemplateConfig, opts v1.CreateOptions) (*v1alpha1.TemplateConfig, error)
Update(ctx context.Context, templateConfig *v1alpha1.TemplateConfig, opts v1.UpdateOptions) (*v1alpha1.TemplateConfig, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.TemplateConfig, error)
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.TemplateConfigList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.TemplateConfig, err error)
TemplateConfigExpansion
}
......@@ -73,20 +74,20 @@ func newTemplateConfigs(c *IngressV1alpha1Client, namespace string) *templateCon
}
// Get takes name of the templateConfig, and returns the corresponding templateConfig object, and an error if there is any.
func (c *templateConfigs) Get(name string, options v1.GetOptions) (result *v1alpha1.TemplateConfig, err error) {
func (c *templateConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.TemplateConfig, err error) {
result = &v1alpha1.TemplateConfig{}
err = c.client.Get().
Namespace(c.ns).
Resource("templateconfigs").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of TemplateConfigs that match those selectors.
func (c *templateConfigs) List(opts v1.ListOptions) (result *v1alpha1.TemplateConfigList, err error) {
func (c *templateConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.TemplateConfigList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
......@@ -97,13 +98,13 @@ func (c *templateConfigs) List(opts v1.ListOptions) (result *v1alpha1.TemplateCo
Resource("templateconfigs").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested templateConfigs.
func (c *templateConfigs) Watch(opts v1.ListOptions) (watch.Interface, error) {
func (c *templateConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
......@@ -114,71 +115,74 @@ func (c *templateConfigs) Watch(opts v1.ListOptions) (watch.Interface, error) {
Resource("templateconfigs").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(ctx)
}
// Create takes the representation of a templateConfig and creates it. Returns the server's representation of the templateConfig, and an error, if there is any.
func (c *templateConfigs) Create(templateConfig *v1alpha1.TemplateConfig) (result *v1alpha1.TemplateConfig, err error) {
func (c *templateConfigs) Create(ctx context.Context, templateConfig *v1alpha1.TemplateConfig, opts v1.CreateOptions) (result *v1alpha1.TemplateConfig, err error) {
result = &v1alpha1.TemplateConfig{}
err = c.client.Post().
Namespace(c.ns).
Resource("templateconfigs").
VersionedParams(&opts, scheme.ParameterCodec).
Body(templateConfig).
Do().
Do(ctx).
Into(result)
return
}
// Update takes the representation of a templateConfig and updates it. Returns the server's representation of the templateConfig, and an error, if there is any.
func (c *templateConfigs) Update(templateConfig *v1alpha1.TemplateConfig) (result *v1alpha1.TemplateConfig, err error) {
func (c *templateConfigs) Update(ctx context.Context, templateConfig *v1alpha1.TemplateConfig, opts v1.UpdateOptions) (result *v1alpha1.TemplateConfig, err error) {
result = &v1alpha1.TemplateConfig{}
err = c.client.Put().
Namespace(c.ns).
Resource("templateconfigs").
Name(templateConfig.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(templateConfig).
Do().
Do(ctx).
Into(result)
return
}
// Delete takes name of the templateConfig and deletes it. Returns an error if one occurs.
func (c *templateConfigs) Delete(name string, options *v1.DeleteOptions) error {
func (c *templateConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("templateconfigs").
Name(name).
Body(options).
Do().
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *templateConfigs) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
func (c *templateConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("templateconfigs").
VersionedParams(&listOptions, scheme.ParameterCodec).
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched templateConfig.
func (c *templateConfigs) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.TemplateConfig, err error) {
func (c *templateConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.TemplateConfig, err error) {
result = &v1alpha1.TemplateConfig{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("templateconfigs").
SubResource(subresources...).
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do().
Do(ctx).
Into(result)
return
}
......@@ -29,6 +29,7 @@
package v1alpha1
import (
"context"
"time"
v1alpha1 "code.uplex.de/uplex-varnish/k8s-ingress/pkg/apis/varnishingress/v1alpha1"
......@@ -47,14 +48,14 @@ type VarnishConfigsGetter interface {
// 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)
Create(ctx context.Context, varnishConfig *v1alpha1.VarnishConfig, opts v1.CreateOptions) (*v1alpha1.VarnishConfig, error)
Update(ctx context.Context, varnishConfig *v1alpha1.VarnishConfig, opts v1.UpdateOptions) (*v1alpha1.VarnishConfig, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.VarnishConfig, error)
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.VarnishConfigList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.VarnishConfig, err error)
VarnishConfigExpansion
}
......@@ -73,20 +74,20 @@ func newVarnishConfigs(c *IngressV1alpha1Client, namespace string) *varnishConfi
}
// 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) {
func (c *varnishConfigs) Get(ctx context.Context, 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().
Do(ctx).
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) {
func (c *varnishConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.VarnishConfigList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
......@@ -97,13 +98,13 @@ func (c *varnishConfigs) List(opts v1.ListOptions) (result *v1alpha1.VarnishConf
Resource("varnishconfigs").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested varnishConfigs.
func (c *varnishConfigs) Watch(opts v1.ListOptions) (watch.Interface, error) {
func (c *varnishConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
......@@ -114,71 +115,74 @@ func (c *varnishConfigs) Watch(opts v1.ListOptions) (watch.Interface, error) {
Resource("varnishconfigs").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(ctx)
}
// 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) {
func (c *varnishConfigs) Create(ctx context.Context, varnishConfig *v1alpha1.VarnishConfig, opts v1.CreateOptions) (result *v1alpha1.VarnishConfig, err error) {
result = &v1alpha1.VarnishConfig{}
err = c.client.Post().
Namespace(c.ns).
Resource("varnishconfigs").
VersionedParams(&opts, scheme.ParameterCodec).
Body(varnishConfig).
Do().
Do(ctx).
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) {
func (c *varnishConfigs) Update(ctx context.Context, varnishConfig *v1alpha1.VarnishConfig, opts v1.UpdateOptions) (result *v1alpha1.VarnishConfig, err error) {
result = &v1alpha1.VarnishConfig{}
err = c.client.Put().
Namespace(c.ns).
Resource("varnishconfigs").
Name(varnishConfig.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(varnishConfig).
Do().
Do(ctx).
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 {
func (c *varnishConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("varnishconfigs").
Name(name).
Body(options).
Do().
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *varnishConfigs) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
func (c *varnishConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("varnishconfigs").
VersionedParams(&listOptions, scheme.ParameterCodec).
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Body(&opts).
Do(ctx).
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) {
func (c *varnishConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.VarnishConfig, err error) {
result = &v1alpha1.VarnishConfig{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("varnishconfigs").
SubResource(subresources...).
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do().
Do(ctx).
Into(result)
return
}
......@@ -29,6 +29,7 @@
package v1alpha1
import (
"context"
time "time"
varnishingressv1alpha1 "code.uplex.de/uplex-varnish/k8s-ingress/pkg/apis/varnishingress/v1alpha1"
......@@ -71,13 +72,13 @@ func NewFilteredBackendConfigInformer(client versioned.Interface, namespace stri
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.IngressV1alpha1().BackendConfigs(namespace).List(options)
return client.IngressV1alpha1().BackendConfigs(namespace).List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.IngressV1alpha1().BackendConfigs(namespace).Watch(options)
return client.IngressV1alpha1().BackendConfigs(namespace).Watch(context.TODO(), options)
},
},
&varnishingressv1alpha1.BackendConfig{},
......
......@@ -29,6 +29,7 @@
package v1alpha1
import (
"context"
time "time"
varnishingressv1alpha1 "code.uplex.de/uplex-varnish/k8s-ingress/pkg/apis/varnishingress/v1alpha1"
......@@ -71,13 +72,13 @@ func NewFilteredTemplateConfigInformer(client versioned.Interface, namespace str
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.IngressV1alpha1().TemplateConfigs(namespace).List(options)
return client.IngressV1alpha1().TemplateConfigs(namespace).List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.IngressV1alpha1().TemplateConfigs(namespace).Watch(options)
return client.IngressV1alpha1().TemplateConfigs(namespace).Watch(context.TODO(), options)
},
},
&varnishingressv1alpha1.TemplateConfig{},
......
......@@ -29,6 +29,7 @@
package v1alpha1
import (
"context"
time "time"
varnishingressv1alpha1 "code.uplex.de/uplex-varnish/k8s-ingress/pkg/apis/varnishingress/v1alpha1"
......@@ -71,13 +72,13 @@ func NewFilteredVarnishConfigInformer(client versioned.Interface, namespace stri
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.IngressV1alpha1().VarnishConfigs(namespace).List(options)
return client.IngressV1alpha1().VarnishConfigs(namespace).List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.IngressV1alpha1().VarnishConfigs(namespace).Watch(options)
return client.IngressV1alpha1().VarnishConfigs(namespace).Watch(context.TODO(), options)
},
},
&varnishingressv1alpha1.VarnishConfig{},
......
......@@ -36,8 +36,10 @@ import (
)
// BackendConfigLister helps list BackendConfigs.
// All objects returned here must be treated as read-only.
type BackendConfigLister interface {
// List lists all BackendConfigs in the indexer.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1alpha1.BackendConfig, err error)
// BackendConfigs returns an object that can list and get BackendConfigs.
BackendConfigs(namespace string) BackendConfigNamespaceLister
......@@ -68,10 +70,13 @@ func (s *backendConfigLister) BackendConfigs(namespace string) BackendConfigName
}
// BackendConfigNamespaceLister helps list and get BackendConfigs.
// All objects returned here must be treated as read-only.
type BackendConfigNamespaceLister interface {
// List lists all BackendConfigs in the indexer for a given namespace.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1alpha1.BackendConfig, err error)
// Get retrieves the BackendConfig from the indexer for a given namespace and name.
// Objects returned here must be treated as read-only.
Get(name string) (*v1alpha1.BackendConfig, error)
BackendConfigNamespaceListerExpansion
}
......
......@@ -36,8 +36,10 @@ import (
)
// TemplateConfigLister helps list TemplateConfigs.
// All objects returned here must be treated as read-only.
type TemplateConfigLister interface {
// List lists all TemplateConfigs in the indexer.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1alpha1.TemplateConfig, err error)
// TemplateConfigs returns an object that can list and get TemplateConfigs.
TemplateConfigs(namespace string) TemplateConfigNamespaceLister
......@@ -68,10 +70,13 @@ func (s *templateConfigLister) TemplateConfigs(namespace string) TemplateConfigN
}
// TemplateConfigNamespaceLister helps list and get TemplateConfigs.
// All objects returned here must be treated as read-only.
type TemplateConfigNamespaceLister interface {
// List lists all TemplateConfigs in the indexer for a given namespace.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1alpha1.TemplateConfig, err error)
// Get retrieves the TemplateConfig from the indexer for a given namespace and name.
// Objects returned here must be treated as read-only.
Get(name string) (*v1alpha1.TemplateConfig, error)
TemplateConfigNamespaceListerExpansion
}
......
......@@ -36,8 +36,10 @@ import (
)
// VarnishConfigLister helps list VarnishConfigs.
// All objects returned here must be treated as read-only.
type VarnishConfigLister interface {
// List lists all VarnishConfigs in the indexer.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1alpha1.VarnishConfig, err error)
// VarnishConfigs returns an object that can list and get VarnishConfigs.
VarnishConfigs(namespace string) VarnishConfigNamespaceLister
......@@ -68,10 +70,13 @@ func (s *varnishConfigLister) VarnishConfigs(namespace string) VarnishConfigName
}
// VarnishConfigNamespaceLister helps list and get VarnishConfigs.
// All objects returned here must be treated as read-only.
type VarnishConfigNamespaceLister interface {
// List lists all VarnishConfigs in the indexer for a given namespace.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1alpha1.VarnishConfig, err error)
// Get retrieves the VarnishConfig from the indexer for a given namespace and name.
// Objects returned here must be treated as read-only.
Get(name string) (*v1alpha1.VarnishConfig, error)
VarnishConfigNamespaceListerExpansion
}
......
......@@ -31,6 +31,7 @@ package controller
// Methods for syncing Ingresses
import (
"context"
"encoding/base64"
"fmt"
"strconv"
......@@ -49,6 +50,7 @@ import (
api_v1 "k8s.io/api/core/v1"
extensions "k8s.io/api/extensions/v1beta1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
const (
......@@ -1058,7 +1060,8 @@ func (worker *NamespaceWorker) updateIngStatus(
copy(ing.Status.LoadBalancer.Ingress, lb)
ingClient := worker.client.ExtensionsV1beta1().
Ingresses(ing.Namespace)
if _, err := ingClient.UpdateStatus(ing); err != nil {
if _, err := ingClient.UpdateStatus(context.TODO(), ing,
metav1.UpdateOptions{}); err != nil {
return update.MakeFatal(
"Cannot update status for Ingress %s/%s: %v",
ing.Namespace, ing.Name, err)
......
......@@ -29,6 +29,7 @@
package controller
import (
"context"
"fmt"
api_v1 "k8s.io/api/core/v1"
......@@ -147,7 +148,7 @@ func (worker *NamespaceWorker) getPods(
svc *api_v1.Service) (*api_v1.PodList, error) {
return worker.client.CoreV1().Pods(svc.Namespace).
List(meta_v1.ListOptions{
List(context.TODO(), meta_v1.ListOptions{
LabelSelector: labels.Set(svc.Spec.Selector).String(),
})
}
......
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