mirror of
https://github.com/fluxcd/flagger.git
synced 2026-02-14 18:10:00 +00:00
Regenerate clientset with Kubernetes 1.34 code-gen
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
This commit is contained in:
1
go.mod
1
go.mod
@@ -60,6 +60,7 @@ require (
|
||||
github.com/jmespath/go-jmespath v0.4.1-0.20220621161143-b0104c826a24 // indirect
|
||||
github.com/josharian/intern v1.0.0 // indirect
|
||||
github.com/json-iterator/go v1.1.12 // indirect
|
||||
github.com/kylelemons/godebug v1.1.0 // indirect
|
||||
github.com/mailru/easyjson v0.9.0 // indirect
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
|
||||
|
||||
@@ -19,8 +19,8 @@ limitations under the License.
|
||||
package versioned
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
fmt "fmt"
|
||||
http "net/http"
|
||||
|
||||
apisixv2 "github.com/fluxcd/flagger/pkg/client/clientset/versioned/typed/apisix/v2"
|
||||
appmeshv1beta1 "github.com/fluxcd/flagger/pkg/client/clientset/versioned/typed/appmesh/v1beta1"
|
||||
|
||||
@@ -52,6 +52,7 @@ import (
|
||||
fakesplitv1alpha3 "github.com/fluxcd/flagger/pkg/client/clientset/versioned/typed/smi/v1alpha3/fake"
|
||||
traefikv1alpha1 "github.com/fluxcd/flagger/pkg/client/clientset/versioned/typed/traefik/v1alpha1"
|
||||
faketraefikv1alpha1 "github.com/fluxcd/flagger/pkg/client/clientset/versioned/typed/traefik/v1alpha1/fake"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
"k8s.io/client-go/discovery"
|
||||
@@ -79,9 +80,13 @@ func NewSimpleClientset(objects ...runtime.Object) *Clientset {
|
||||
cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake}
|
||||
cs.AddReactor("*", "*", testing.ObjectReaction(o))
|
||||
cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) {
|
||||
var opts metav1.ListOptions
|
||||
if watchActcion, ok := action.(testing.WatchActionImpl); ok {
|
||||
opts = watchActcion.ListOptions
|
||||
}
|
||||
gvr := action.GetResource()
|
||||
ns := action.GetNamespace()
|
||||
watch, err := o.Watch(gvr, ns)
|
||||
watch, err := o.Watch(gvr, ns, opts)
|
||||
if err != nil {
|
||||
return false, nil, err
|
||||
}
|
||||
|
||||
@@ -19,10 +19,10 @@ limitations under the License.
|
||||
package v2
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
http "net/http"
|
||||
|
||||
v2 "github.com/fluxcd/flagger/pkg/apis/apisix/v2"
|
||||
"github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
apisixv2 "github.com/fluxcd/flagger/pkg/apis/apisix/v2"
|
||||
scheme "github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
rest "k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
@@ -45,9 +45,7 @@ func (c *ApisixV2Client) ApisixRoutes(namespace string) ApisixRouteInterface {
|
||||
// where httpClient was generated with rest.HTTPClientFor(c).
|
||||
func NewForConfig(c *rest.Config) (*ApisixV2Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
setConfigDefaults(&config)
|
||||
httpClient, err := rest.HTTPClientFor(&config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -59,9 +57,7 @@ func NewForConfig(c *rest.Config) (*ApisixV2Client, error) {
|
||||
// Note the http client provided takes precedence over the configured transport values.
|
||||
func NewForConfigAndClient(c *rest.Config, h *http.Client) (*ApisixV2Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
setConfigDefaults(&config)
|
||||
client, err := rest.RESTClientForConfigAndClient(&config, h)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -84,17 +80,15 @@ func New(c rest.Interface) *ApisixV2Client {
|
||||
return &ApisixV2Client{c}
|
||||
}
|
||||
|
||||
func setConfigDefaults(config *rest.Config) error {
|
||||
gv := v2.SchemeGroupVersion
|
||||
func setConfigDefaults(config *rest.Config) {
|
||||
gv := apisixv2.SchemeGroupVersion
|
||||
config.GroupVersion = &gv
|
||||
config.APIPath = "/apis"
|
||||
config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
|
||||
config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion()
|
||||
|
||||
if config.UserAgent == "" {
|
||||
config.UserAgent = rest.DefaultKubernetesUserAgent()
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
|
||||
@@ -19,9 +19,9 @@ limitations under the License.
|
||||
package v2
|
||||
|
||||
import (
|
||||
"context"
|
||||
context "context"
|
||||
|
||||
v2 "github.com/fluxcd/flagger/pkg/apis/apisix/v2"
|
||||
apisixv2 "github.com/fluxcd/flagger/pkg/apis/apisix/v2"
|
||||
scheme "github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
@@ -37,33 +37,34 @@ type ApisixRoutesGetter interface {
|
||||
|
||||
// ApisixRouteInterface has methods to work with ApisixRoute resources.
|
||||
type ApisixRouteInterface interface {
|
||||
Create(ctx context.Context, apisixRoute *v2.ApisixRoute, opts v1.CreateOptions) (*v2.ApisixRoute, error)
|
||||
Update(ctx context.Context, apisixRoute *v2.ApisixRoute, opts v1.UpdateOptions) (*v2.ApisixRoute, error)
|
||||
Create(ctx context.Context, apisixRoute *apisixv2.ApisixRoute, opts v1.CreateOptions) (*apisixv2.ApisixRoute, error)
|
||||
Update(ctx context.Context, apisixRoute *apisixv2.ApisixRoute, opts v1.UpdateOptions) (*apisixv2.ApisixRoute, error)
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
UpdateStatus(ctx context.Context, apisixRoute *v2.ApisixRoute, opts v1.UpdateOptions) (*v2.ApisixRoute, error)
|
||||
UpdateStatus(ctx context.Context, apisixRoute *apisixv2.ApisixRoute, opts v1.UpdateOptions) (*apisixv2.ApisixRoute, 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) (*v2.ApisixRoute, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*v2.ApisixRouteList, error)
|
||||
Get(ctx context.Context, name string, opts v1.GetOptions) (*apisixv2.ApisixRoute, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*apisixv2.ApisixRouteList, 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 *v2.ApisixRoute, err error)
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *apisixv2.ApisixRoute, err error)
|
||||
ApisixRouteExpansion
|
||||
}
|
||||
|
||||
// apisixRoutes implements ApisixRouteInterface
|
||||
type apisixRoutes struct {
|
||||
*gentype.ClientWithList[*v2.ApisixRoute, *v2.ApisixRouteList]
|
||||
*gentype.ClientWithList[*apisixv2.ApisixRoute, *apisixv2.ApisixRouteList]
|
||||
}
|
||||
|
||||
// newApisixRoutes returns a ApisixRoutes
|
||||
func newApisixRoutes(c *ApisixV2Client, namespace string) *apisixRoutes {
|
||||
return &apisixRoutes{
|
||||
gentype.NewClientWithList[*v2.ApisixRoute, *v2.ApisixRouteList](
|
||||
gentype.NewClientWithList[*apisixv2.ApisixRoute, *apisixv2.ApisixRouteList](
|
||||
"apisixroutes",
|
||||
c.RESTClient(),
|
||||
scheme.ParameterCodec,
|
||||
namespace,
|
||||
func() *v2.ApisixRoute { return &v2.ApisixRoute{} },
|
||||
func() *v2.ApisixRouteList { return &v2.ApisixRouteList{} }),
|
||||
func() *apisixv2.ApisixRoute { return &apisixv2.ApisixRoute{} },
|
||||
func() *apisixv2.ApisixRouteList { return &apisixv2.ApisixRouteList{} },
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ type FakeApisixV2 struct {
|
||||
}
|
||||
|
||||
func (c *FakeApisixV2) ApisixRoutes(namespace string) v2.ApisixRouteInterface {
|
||||
return &FakeApisixRoutes{c, namespace}
|
||||
return newFakeApisixRoutes(c, namespace)
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
|
||||
@@ -19,129 +19,30 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
v2 "github.com/fluxcd/flagger/pkg/apis/apisix/v2"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
apisixv2 "github.com/fluxcd/flagger/pkg/client/clientset/versioned/typed/apisix/v2"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
)
|
||||
|
||||
// FakeApisixRoutes implements ApisixRouteInterface
|
||||
type FakeApisixRoutes struct {
|
||||
// fakeApisixRoutes implements ApisixRouteInterface
|
||||
type fakeApisixRoutes struct {
|
||||
*gentype.FakeClientWithList[*v2.ApisixRoute, *v2.ApisixRouteList]
|
||||
Fake *FakeApisixV2
|
||||
ns string
|
||||
}
|
||||
|
||||
var apisixroutesResource = v2.SchemeGroupVersion.WithResource("apisixroutes")
|
||||
|
||||
var apisixroutesKind = v2.SchemeGroupVersion.WithKind("ApisixRoute")
|
||||
|
||||
// Get takes name of the apisixRoute, and returns the corresponding apisixRoute object, and an error if there is any.
|
||||
func (c *FakeApisixRoutes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2.ApisixRoute, err error) {
|
||||
emptyResult := &v2.ApisixRoute{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetActionWithOptions(apisixroutesResource, c.ns, name, options), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
func newFakeApisixRoutes(fake *FakeApisixV2, namespace string) apisixv2.ApisixRouteInterface {
|
||||
return &fakeApisixRoutes{
|
||||
gentype.NewFakeClientWithList[*v2.ApisixRoute, *v2.ApisixRouteList](
|
||||
fake.Fake,
|
||||
namespace,
|
||||
v2.SchemeGroupVersion.WithResource("apisixroutes"),
|
||||
v2.SchemeGroupVersion.WithKind("ApisixRoute"),
|
||||
func() *v2.ApisixRoute { return &v2.ApisixRoute{} },
|
||||
func() *v2.ApisixRouteList { return &v2.ApisixRouteList{} },
|
||||
func(dst, src *v2.ApisixRouteList) { dst.ListMeta = src.ListMeta },
|
||||
func(list *v2.ApisixRouteList) []*v2.ApisixRoute { return gentype.ToPointerSlice(list.Items) },
|
||||
func(list *v2.ApisixRouteList, items []*v2.ApisixRoute) { list.Items = gentype.FromPointerSlice(items) },
|
||||
),
|
||||
fake,
|
||||
}
|
||||
return obj.(*v2.ApisixRoute), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of ApisixRoutes that match those selectors.
|
||||
func (c *FakeApisixRoutes) List(ctx context.Context, opts v1.ListOptions) (result *v2.ApisixRouteList, err error) {
|
||||
emptyResult := &v2.ApisixRouteList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListActionWithOptions(apisixroutesResource, apisixroutesKind, c.ns, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v2.ApisixRouteList{ListMeta: obj.(*v2.ApisixRouteList).ListMeta}
|
||||
for _, item := range obj.(*v2.ApisixRouteList).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 apisixRoutes.
|
||||
func (c *FakeApisixRoutes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchActionWithOptions(apisixroutesResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a apisixRoute and creates it. Returns the server's representation of the apisixRoute, and an error, if there is any.
|
||||
func (c *FakeApisixRoutes) Create(ctx context.Context, apisixRoute *v2.ApisixRoute, opts v1.CreateOptions) (result *v2.ApisixRoute, err error) {
|
||||
emptyResult := &v2.ApisixRoute{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateActionWithOptions(apisixroutesResource, c.ns, apisixRoute, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v2.ApisixRoute), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a apisixRoute and updates it. Returns the server's representation of the apisixRoute, and an error, if there is any.
|
||||
func (c *FakeApisixRoutes) Update(ctx context.Context, apisixRoute *v2.ApisixRoute, opts v1.UpdateOptions) (result *v2.ApisixRoute, err error) {
|
||||
emptyResult := &v2.ApisixRoute{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateActionWithOptions(apisixroutesResource, c.ns, apisixRoute, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v2.ApisixRoute), err
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
func (c *FakeApisixRoutes) UpdateStatus(ctx context.Context, apisixRoute *v2.ApisixRoute, opts v1.UpdateOptions) (result *v2.ApisixRoute, err error) {
|
||||
emptyResult := &v2.ApisixRoute{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateSubresourceActionWithOptions(apisixroutesResource, "status", c.ns, apisixRoute, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v2.ApisixRoute), err
|
||||
}
|
||||
|
||||
// Delete takes name of the apisixRoute and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeApisixRoutes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteActionWithOptions(apisixroutesResource, c.ns, name, opts), &v2.ApisixRoute{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeApisixRoutes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionActionWithOptions(apisixroutesResource, c.ns, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v2.ApisixRouteList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched apisixRoute.
|
||||
func (c *FakeApisixRoutes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.ApisixRoute, err error) {
|
||||
emptyResult := &v2.ApisixRoute{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(apisixroutesResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v2.ApisixRoute), err
|
||||
}
|
||||
|
||||
@@ -19,10 +19,10 @@ limitations under the License.
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
http "net/http"
|
||||
|
||||
v1beta1 "github.com/fluxcd/flagger/pkg/apis/appmesh/v1beta1"
|
||||
"github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
appmeshv1beta1 "github.com/fluxcd/flagger/pkg/apis/appmesh/v1beta1"
|
||||
scheme "github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
rest "k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
@@ -55,9 +55,7 @@ func (c *AppmeshV1beta1Client) VirtualServices(namespace string) VirtualServiceI
|
||||
// where httpClient was generated with rest.HTTPClientFor(c).
|
||||
func NewForConfig(c *rest.Config) (*AppmeshV1beta1Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
setConfigDefaults(&config)
|
||||
httpClient, err := rest.HTTPClientFor(&config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -69,9 +67,7 @@ func NewForConfig(c *rest.Config) (*AppmeshV1beta1Client, error) {
|
||||
// Note the http client provided takes precedence over the configured transport values.
|
||||
func NewForConfigAndClient(c *rest.Config, h *http.Client) (*AppmeshV1beta1Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
setConfigDefaults(&config)
|
||||
client, err := rest.RESTClientForConfigAndClient(&config, h)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -94,17 +90,15 @@ func New(c rest.Interface) *AppmeshV1beta1Client {
|
||||
return &AppmeshV1beta1Client{c}
|
||||
}
|
||||
|
||||
func setConfigDefaults(config *rest.Config) error {
|
||||
gv := v1beta1.SchemeGroupVersion
|
||||
func setConfigDefaults(config *rest.Config) {
|
||||
gv := appmeshv1beta1.SchemeGroupVersion
|
||||
config.GroupVersion = &gv
|
||||
config.APIPath = "/apis"
|
||||
config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
|
||||
config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion()
|
||||
|
||||
if config.UserAgent == "" {
|
||||
config.UserAgent = rest.DefaultKubernetesUserAgent()
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
|
||||
@@ -29,15 +29,15 @@ type FakeAppmeshV1beta1 struct {
|
||||
}
|
||||
|
||||
func (c *FakeAppmeshV1beta1) Meshes() v1beta1.MeshInterface {
|
||||
return &FakeMeshes{c}
|
||||
return newFakeMeshes(c)
|
||||
}
|
||||
|
||||
func (c *FakeAppmeshV1beta1) VirtualNodes(namespace string) v1beta1.VirtualNodeInterface {
|
||||
return &FakeVirtualNodes{c, namespace}
|
||||
return newFakeVirtualNodes(c, namespace)
|
||||
}
|
||||
|
||||
func (c *FakeAppmeshV1beta1) VirtualServices(namespace string) v1beta1.VirtualServiceInterface {
|
||||
return &FakeVirtualServices{c, namespace}
|
||||
return newFakeVirtualServices(c, namespace)
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
|
||||
@@ -19,120 +19,30 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
v1beta1 "github.com/fluxcd/flagger/pkg/apis/appmesh/v1beta1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
appmeshv1beta1 "github.com/fluxcd/flagger/pkg/client/clientset/versioned/typed/appmesh/v1beta1"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
)
|
||||
|
||||
// FakeMeshes implements MeshInterface
|
||||
type FakeMeshes struct {
|
||||
// fakeMeshes implements MeshInterface
|
||||
type fakeMeshes struct {
|
||||
*gentype.FakeClientWithList[*v1beta1.Mesh, *v1beta1.MeshList]
|
||||
Fake *FakeAppmeshV1beta1
|
||||
}
|
||||
|
||||
var meshesResource = v1beta1.SchemeGroupVersion.WithResource("meshes")
|
||||
|
||||
var meshesKind = v1beta1.SchemeGroupVersion.WithKind("Mesh")
|
||||
|
||||
// Get takes name of the mesh, and returns the corresponding mesh object, and an error if there is any.
|
||||
func (c *FakeMeshes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Mesh, err error) {
|
||||
emptyResult := &v1beta1.Mesh{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootGetActionWithOptions(meshesResource, name, options), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
func newFakeMeshes(fake *FakeAppmeshV1beta1) appmeshv1beta1.MeshInterface {
|
||||
return &fakeMeshes{
|
||||
gentype.NewFakeClientWithList[*v1beta1.Mesh, *v1beta1.MeshList](
|
||||
fake.Fake,
|
||||
"",
|
||||
v1beta1.SchemeGroupVersion.WithResource("meshes"),
|
||||
v1beta1.SchemeGroupVersion.WithKind("Mesh"),
|
||||
func() *v1beta1.Mesh { return &v1beta1.Mesh{} },
|
||||
func() *v1beta1.MeshList { return &v1beta1.MeshList{} },
|
||||
func(dst, src *v1beta1.MeshList) { dst.ListMeta = src.ListMeta },
|
||||
func(list *v1beta1.MeshList) []*v1beta1.Mesh { return gentype.ToPointerSlice(list.Items) },
|
||||
func(list *v1beta1.MeshList, items []*v1beta1.Mesh) { list.Items = gentype.FromPointerSlice(items) },
|
||||
),
|
||||
fake,
|
||||
}
|
||||
return obj.(*v1beta1.Mesh), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of Meshes that match those selectors.
|
||||
func (c *FakeMeshes) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.MeshList, err error) {
|
||||
emptyResult := &v1beta1.MeshList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootListActionWithOptions(meshesResource, meshesKind, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1beta1.MeshList{ListMeta: obj.(*v1beta1.MeshList).ListMeta}
|
||||
for _, item := range obj.(*v1beta1.MeshList).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 meshes.
|
||||
func (c *FakeMeshes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewRootWatchActionWithOptions(meshesResource, opts))
|
||||
}
|
||||
|
||||
// Create takes the representation of a mesh and creates it. Returns the server's representation of the mesh, and an error, if there is any.
|
||||
func (c *FakeMeshes) Create(ctx context.Context, mesh *v1beta1.Mesh, opts v1.CreateOptions) (result *v1beta1.Mesh, err error) {
|
||||
emptyResult := &v1beta1.Mesh{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootCreateActionWithOptions(meshesResource, mesh, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.Mesh), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a mesh and updates it. Returns the server's representation of the mesh, and an error, if there is any.
|
||||
func (c *FakeMeshes) Update(ctx context.Context, mesh *v1beta1.Mesh, opts v1.UpdateOptions) (result *v1beta1.Mesh, err error) {
|
||||
emptyResult := &v1beta1.Mesh{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootUpdateActionWithOptions(meshesResource, mesh, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.Mesh), err
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
func (c *FakeMeshes) UpdateStatus(ctx context.Context, mesh *v1beta1.Mesh, opts v1.UpdateOptions) (result *v1beta1.Mesh, err error) {
|
||||
emptyResult := &v1beta1.Mesh{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootUpdateSubresourceActionWithOptions(meshesResource, "status", mesh, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.Mesh), err
|
||||
}
|
||||
|
||||
// Delete takes name of the mesh and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeMeshes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewRootDeleteActionWithOptions(meshesResource, name, opts), &v1beta1.Mesh{})
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeMeshes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewRootDeleteCollectionActionWithOptions(meshesResource, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1beta1.MeshList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched mesh.
|
||||
func (c *FakeMeshes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Mesh, err error) {
|
||||
emptyResult := &v1beta1.Mesh{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootPatchSubresourceActionWithOptions(meshesResource, name, pt, data, opts, subresources...), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.Mesh), err
|
||||
}
|
||||
|
||||
@@ -19,129 +19,32 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
v1beta1 "github.com/fluxcd/flagger/pkg/apis/appmesh/v1beta1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
appmeshv1beta1 "github.com/fluxcd/flagger/pkg/client/clientset/versioned/typed/appmesh/v1beta1"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
)
|
||||
|
||||
// FakeVirtualNodes implements VirtualNodeInterface
|
||||
type FakeVirtualNodes struct {
|
||||
// fakeVirtualNodes implements VirtualNodeInterface
|
||||
type fakeVirtualNodes struct {
|
||||
*gentype.FakeClientWithList[*v1beta1.VirtualNode, *v1beta1.VirtualNodeList]
|
||||
Fake *FakeAppmeshV1beta1
|
||||
ns string
|
||||
}
|
||||
|
||||
var virtualnodesResource = v1beta1.SchemeGroupVersion.WithResource("virtualnodes")
|
||||
|
||||
var virtualnodesKind = v1beta1.SchemeGroupVersion.WithKind("VirtualNode")
|
||||
|
||||
// Get takes name of the virtualNode, and returns the corresponding virtualNode object, and an error if there is any.
|
||||
func (c *FakeVirtualNodes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VirtualNode, err error) {
|
||||
emptyResult := &v1beta1.VirtualNode{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetActionWithOptions(virtualnodesResource, c.ns, name, options), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
func newFakeVirtualNodes(fake *FakeAppmeshV1beta1, namespace string) appmeshv1beta1.VirtualNodeInterface {
|
||||
return &fakeVirtualNodes{
|
||||
gentype.NewFakeClientWithList[*v1beta1.VirtualNode, *v1beta1.VirtualNodeList](
|
||||
fake.Fake,
|
||||
namespace,
|
||||
v1beta1.SchemeGroupVersion.WithResource("virtualnodes"),
|
||||
v1beta1.SchemeGroupVersion.WithKind("VirtualNode"),
|
||||
func() *v1beta1.VirtualNode { return &v1beta1.VirtualNode{} },
|
||||
func() *v1beta1.VirtualNodeList { return &v1beta1.VirtualNodeList{} },
|
||||
func(dst, src *v1beta1.VirtualNodeList) { dst.ListMeta = src.ListMeta },
|
||||
func(list *v1beta1.VirtualNodeList) []*v1beta1.VirtualNode { return gentype.ToPointerSlice(list.Items) },
|
||||
func(list *v1beta1.VirtualNodeList, items []*v1beta1.VirtualNode) {
|
||||
list.Items = gentype.FromPointerSlice(items)
|
||||
},
|
||||
),
|
||||
fake,
|
||||
}
|
||||
return obj.(*v1beta1.VirtualNode), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of VirtualNodes that match those selectors.
|
||||
func (c *FakeVirtualNodes) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VirtualNodeList, err error) {
|
||||
emptyResult := &v1beta1.VirtualNodeList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListActionWithOptions(virtualnodesResource, virtualnodesKind, c.ns, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1beta1.VirtualNodeList{ListMeta: obj.(*v1beta1.VirtualNodeList).ListMeta}
|
||||
for _, item := range obj.(*v1beta1.VirtualNodeList).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 virtualNodes.
|
||||
func (c *FakeVirtualNodes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchActionWithOptions(virtualnodesResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a virtualNode and creates it. Returns the server's representation of the virtualNode, and an error, if there is any.
|
||||
func (c *FakeVirtualNodes) Create(ctx context.Context, virtualNode *v1beta1.VirtualNode, opts v1.CreateOptions) (result *v1beta1.VirtualNode, err error) {
|
||||
emptyResult := &v1beta1.VirtualNode{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateActionWithOptions(virtualnodesResource, c.ns, virtualNode, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.VirtualNode), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a virtualNode and updates it. Returns the server's representation of the virtualNode, and an error, if there is any.
|
||||
func (c *FakeVirtualNodes) Update(ctx context.Context, virtualNode *v1beta1.VirtualNode, opts v1.UpdateOptions) (result *v1beta1.VirtualNode, err error) {
|
||||
emptyResult := &v1beta1.VirtualNode{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateActionWithOptions(virtualnodesResource, c.ns, virtualNode, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.VirtualNode), err
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
func (c *FakeVirtualNodes) UpdateStatus(ctx context.Context, virtualNode *v1beta1.VirtualNode, opts v1.UpdateOptions) (result *v1beta1.VirtualNode, err error) {
|
||||
emptyResult := &v1beta1.VirtualNode{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateSubresourceActionWithOptions(virtualnodesResource, "status", c.ns, virtualNode, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.VirtualNode), err
|
||||
}
|
||||
|
||||
// Delete takes name of the virtualNode and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeVirtualNodes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteActionWithOptions(virtualnodesResource, c.ns, name, opts), &v1beta1.VirtualNode{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeVirtualNodes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionActionWithOptions(virtualnodesResource, c.ns, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1beta1.VirtualNodeList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched virtualNode.
|
||||
func (c *FakeVirtualNodes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VirtualNode, err error) {
|
||||
emptyResult := &v1beta1.VirtualNode{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(virtualnodesResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.VirtualNode), err
|
||||
}
|
||||
|
||||
@@ -19,129 +19,34 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
v1beta1 "github.com/fluxcd/flagger/pkg/apis/appmesh/v1beta1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
appmeshv1beta1 "github.com/fluxcd/flagger/pkg/client/clientset/versioned/typed/appmesh/v1beta1"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
)
|
||||
|
||||
// FakeVirtualServices implements VirtualServiceInterface
|
||||
type FakeVirtualServices struct {
|
||||
// fakeVirtualServices implements VirtualServiceInterface
|
||||
type fakeVirtualServices struct {
|
||||
*gentype.FakeClientWithList[*v1beta1.VirtualService, *v1beta1.VirtualServiceList]
|
||||
Fake *FakeAppmeshV1beta1
|
||||
ns string
|
||||
}
|
||||
|
||||
var virtualservicesResource = v1beta1.SchemeGroupVersion.WithResource("virtualservices")
|
||||
|
||||
var virtualservicesKind = v1beta1.SchemeGroupVersion.WithKind("VirtualService")
|
||||
|
||||
// Get takes name of the virtualService, and returns the corresponding virtualService object, and an error if there is any.
|
||||
func (c *FakeVirtualServices) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VirtualService, err error) {
|
||||
emptyResult := &v1beta1.VirtualService{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetActionWithOptions(virtualservicesResource, c.ns, name, options), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
func newFakeVirtualServices(fake *FakeAppmeshV1beta1, namespace string) appmeshv1beta1.VirtualServiceInterface {
|
||||
return &fakeVirtualServices{
|
||||
gentype.NewFakeClientWithList[*v1beta1.VirtualService, *v1beta1.VirtualServiceList](
|
||||
fake.Fake,
|
||||
namespace,
|
||||
v1beta1.SchemeGroupVersion.WithResource("virtualservices"),
|
||||
v1beta1.SchemeGroupVersion.WithKind("VirtualService"),
|
||||
func() *v1beta1.VirtualService { return &v1beta1.VirtualService{} },
|
||||
func() *v1beta1.VirtualServiceList { return &v1beta1.VirtualServiceList{} },
|
||||
func(dst, src *v1beta1.VirtualServiceList) { dst.ListMeta = src.ListMeta },
|
||||
func(list *v1beta1.VirtualServiceList) []*v1beta1.VirtualService {
|
||||
return gentype.ToPointerSlice(list.Items)
|
||||
},
|
||||
func(list *v1beta1.VirtualServiceList, items []*v1beta1.VirtualService) {
|
||||
list.Items = gentype.FromPointerSlice(items)
|
||||
},
|
||||
),
|
||||
fake,
|
||||
}
|
||||
return obj.(*v1beta1.VirtualService), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of VirtualServices that match those selectors.
|
||||
func (c *FakeVirtualServices) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VirtualServiceList, err error) {
|
||||
emptyResult := &v1beta1.VirtualServiceList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListActionWithOptions(virtualservicesResource, virtualservicesKind, c.ns, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1beta1.VirtualServiceList{ListMeta: obj.(*v1beta1.VirtualServiceList).ListMeta}
|
||||
for _, item := range obj.(*v1beta1.VirtualServiceList).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 virtualServices.
|
||||
func (c *FakeVirtualServices) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchActionWithOptions(virtualservicesResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a virtualService and creates it. Returns the server's representation of the virtualService, and an error, if there is any.
|
||||
func (c *FakeVirtualServices) Create(ctx context.Context, virtualService *v1beta1.VirtualService, opts v1.CreateOptions) (result *v1beta1.VirtualService, err error) {
|
||||
emptyResult := &v1beta1.VirtualService{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateActionWithOptions(virtualservicesResource, c.ns, virtualService, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.VirtualService), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a virtualService and updates it. Returns the server's representation of the virtualService, and an error, if there is any.
|
||||
func (c *FakeVirtualServices) Update(ctx context.Context, virtualService *v1beta1.VirtualService, opts v1.UpdateOptions) (result *v1beta1.VirtualService, err error) {
|
||||
emptyResult := &v1beta1.VirtualService{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateActionWithOptions(virtualservicesResource, c.ns, virtualService, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.VirtualService), err
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
func (c *FakeVirtualServices) UpdateStatus(ctx context.Context, virtualService *v1beta1.VirtualService, opts v1.UpdateOptions) (result *v1beta1.VirtualService, err error) {
|
||||
emptyResult := &v1beta1.VirtualService{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateSubresourceActionWithOptions(virtualservicesResource, "status", c.ns, virtualService, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.VirtualService), err
|
||||
}
|
||||
|
||||
// Delete takes name of the virtualService and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeVirtualServices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteActionWithOptions(virtualservicesResource, c.ns, name, opts), &v1beta1.VirtualService{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeVirtualServices) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionActionWithOptions(virtualservicesResource, c.ns, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1beta1.VirtualServiceList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched virtualService.
|
||||
func (c *FakeVirtualServices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VirtualService, err error) {
|
||||
emptyResult := &v1beta1.VirtualService{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(virtualservicesResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.VirtualService), err
|
||||
}
|
||||
|
||||
@@ -19,9 +19,9 @@ limitations under the License.
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
"context"
|
||||
context "context"
|
||||
|
||||
v1beta1 "github.com/fluxcd/flagger/pkg/apis/appmesh/v1beta1"
|
||||
appmeshv1beta1 "github.com/fluxcd/flagger/pkg/apis/appmesh/v1beta1"
|
||||
scheme "github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
@@ -37,33 +37,34 @@ type MeshesGetter interface {
|
||||
|
||||
// MeshInterface has methods to work with Mesh resources.
|
||||
type MeshInterface interface {
|
||||
Create(ctx context.Context, mesh *v1beta1.Mesh, opts v1.CreateOptions) (*v1beta1.Mesh, error)
|
||||
Update(ctx context.Context, mesh *v1beta1.Mesh, opts v1.UpdateOptions) (*v1beta1.Mesh, error)
|
||||
Create(ctx context.Context, mesh *appmeshv1beta1.Mesh, opts v1.CreateOptions) (*appmeshv1beta1.Mesh, error)
|
||||
Update(ctx context.Context, mesh *appmeshv1beta1.Mesh, opts v1.UpdateOptions) (*appmeshv1beta1.Mesh, error)
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
UpdateStatus(ctx context.Context, mesh *v1beta1.Mesh, opts v1.UpdateOptions) (*v1beta1.Mesh, error)
|
||||
UpdateStatus(ctx context.Context, mesh *appmeshv1beta1.Mesh, opts v1.UpdateOptions) (*appmeshv1beta1.Mesh, 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) (*v1beta1.Mesh, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.MeshList, error)
|
||||
Get(ctx context.Context, name string, opts v1.GetOptions) (*appmeshv1beta1.Mesh, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*appmeshv1beta1.MeshList, 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 *v1beta1.Mesh, err error)
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *appmeshv1beta1.Mesh, err error)
|
||||
MeshExpansion
|
||||
}
|
||||
|
||||
// meshes implements MeshInterface
|
||||
type meshes struct {
|
||||
*gentype.ClientWithList[*v1beta1.Mesh, *v1beta1.MeshList]
|
||||
*gentype.ClientWithList[*appmeshv1beta1.Mesh, *appmeshv1beta1.MeshList]
|
||||
}
|
||||
|
||||
// newMeshes returns a Meshes
|
||||
func newMeshes(c *AppmeshV1beta1Client) *meshes {
|
||||
return &meshes{
|
||||
gentype.NewClientWithList[*v1beta1.Mesh, *v1beta1.MeshList](
|
||||
gentype.NewClientWithList[*appmeshv1beta1.Mesh, *appmeshv1beta1.MeshList](
|
||||
"meshes",
|
||||
c.RESTClient(),
|
||||
scheme.ParameterCodec,
|
||||
"",
|
||||
func() *v1beta1.Mesh { return &v1beta1.Mesh{} },
|
||||
func() *v1beta1.MeshList { return &v1beta1.MeshList{} }),
|
||||
func() *appmeshv1beta1.Mesh { return &appmeshv1beta1.Mesh{} },
|
||||
func() *appmeshv1beta1.MeshList { return &appmeshv1beta1.MeshList{} },
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,9 +19,9 @@ limitations under the License.
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
"context"
|
||||
context "context"
|
||||
|
||||
v1beta1 "github.com/fluxcd/flagger/pkg/apis/appmesh/v1beta1"
|
||||
appmeshv1beta1 "github.com/fluxcd/flagger/pkg/apis/appmesh/v1beta1"
|
||||
scheme "github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
@@ -37,33 +37,34 @@ type VirtualNodesGetter interface {
|
||||
|
||||
// VirtualNodeInterface has methods to work with VirtualNode resources.
|
||||
type VirtualNodeInterface interface {
|
||||
Create(ctx context.Context, virtualNode *v1beta1.VirtualNode, opts v1.CreateOptions) (*v1beta1.VirtualNode, error)
|
||||
Update(ctx context.Context, virtualNode *v1beta1.VirtualNode, opts v1.UpdateOptions) (*v1beta1.VirtualNode, error)
|
||||
Create(ctx context.Context, virtualNode *appmeshv1beta1.VirtualNode, opts v1.CreateOptions) (*appmeshv1beta1.VirtualNode, error)
|
||||
Update(ctx context.Context, virtualNode *appmeshv1beta1.VirtualNode, opts v1.UpdateOptions) (*appmeshv1beta1.VirtualNode, error)
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
UpdateStatus(ctx context.Context, virtualNode *v1beta1.VirtualNode, opts v1.UpdateOptions) (*v1beta1.VirtualNode, error)
|
||||
UpdateStatus(ctx context.Context, virtualNode *appmeshv1beta1.VirtualNode, opts v1.UpdateOptions) (*appmeshv1beta1.VirtualNode, 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) (*v1beta1.VirtualNode, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.VirtualNodeList, error)
|
||||
Get(ctx context.Context, name string, opts v1.GetOptions) (*appmeshv1beta1.VirtualNode, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*appmeshv1beta1.VirtualNodeList, 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 *v1beta1.VirtualNode, err error)
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *appmeshv1beta1.VirtualNode, err error)
|
||||
VirtualNodeExpansion
|
||||
}
|
||||
|
||||
// virtualNodes implements VirtualNodeInterface
|
||||
type virtualNodes struct {
|
||||
*gentype.ClientWithList[*v1beta1.VirtualNode, *v1beta1.VirtualNodeList]
|
||||
*gentype.ClientWithList[*appmeshv1beta1.VirtualNode, *appmeshv1beta1.VirtualNodeList]
|
||||
}
|
||||
|
||||
// newVirtualNodes returns a VirtualNodes
|
||||
func newVirtualNodes(c *AppmeshV1beta1Client, namespace string) *virtualNodes {
|
||||
return &virtualNodes{
|
||||
gentype.NewClientWithList[*v1beta1.VirtualNode, *v1beta1.VirtualNodeList](
|
||||
gentype.NewClientWithList[*appmeshv1beta1.VirtualNode, *appmeshv1beta1.VirtualNodeList](
|
||||
"virtualnodes",
|
||||
c.RESTClient(),
|
||||
scheme.ParameterCodec,
|
||||
namespace,
|
||||
func() *v1beta1.VirtualNode { return &v1beta1.VirtualNode{} },
|
||||
func() *v1beta1.VirtualNodeList { return &v1beta1.VirtualNodeList{} }),
|
||||
func() *appmeshv1beta1.VirtualNode { return &appmeshv1beta1.VirtualNode{} },
|
||||
func() *appmeshv1beta1.VirtualNodeList { return &appmeshv1beta1.VirtualNodeList{} },
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,9 +19,9 @@ limitations under the License.
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
"context"
|
||||
context "context"
|
||||
|
||||
v1beta1 "github.com/fluxcd/flagger/pkg/apis/appmesh/v1beta1"
|
||||
appmeshv1beta1 "github.com/fluxcd/flagger/pkg/apis/appmesh/v1beta1"
|
||||
scheme "github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
@@ -37,33 +37,34 @@ type VirtualServicesGetter interface {
|
||||
|
||||
// VirtualServiceInterface has methods to work with VirtualService resources.
|
||||
type VirtualServiceInterface interface {
|
||||
Create(ctx context.Context, virtualService *v1beta1.VirtualService, opts v1.CreateOptions) (*v1beta1.VirtualService, error)
|
||||
Update(ctx context.Context, virtualService *v1beta1.VirtualService, opts v1.UpdateOptions) (*v1beta1.VirtualService, error)
|
||||
Create(ctx context.Context, virtualService *appmeshv1beta1.VirtualService, opts v1.CreateOptions) (*appmeshv1beta1.VirtualService, error)
|
||||
Update(ctx context.Context, virtualService *appmeshv1beta1.VirtualService, opts v1.UpdateOptions) (*appmeshv1beta1.VirtualService, error)
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
UpdateStatus(ctx context.Context, virtualService *v1beta1.VirtualService, opts v1.UpdateOptions) (*v1beta1.VirtualService, error)
|
||||
UpdateStatus(ctx context.Context, virtualService *appmeshv1beta1.VirtualService, opts v1.UpdateOptions) (*appmeshv1beta1.VirtualService, 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) (*v1beta1.VirtualService, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.VirtualServiceList, error)
|
||||
Get(ctx context.Context, name string, opts v1.GetOptions) (*appmeshv1beta1.VirtualService, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*appmeshv1beta1.VirtualServiceList, 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 *v1beta1.VirtualService, err error)
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *appmeshv1beta1.VirtualService, err error)
|
||||
VirtualServiceExpansion
|
||||
}
|
||||
|
||||
// virtualServices implements VirtualServiceInterface
|
||||
type virtualServices struct {
|
||||
*gentype.ClientWithList[*v1beta1.VirtualService, *v1beta1.VirtualServiceList]
|
||||
*gentype.ClientWithList[*appmeshv1beta1.VirtualService, *appmeshv1beta1.VirtualServiceList]
|
||||
}
|
||||
|
||||
// newVirtualServices returns a VirtualServices
|
||||
func newVirtualServices(c *AppmeshV1beta1Client, namespace string) *virtualServices {
|
||||
return &virtualServices{
|
||||
gentype.NewClientWithList[*v1beta1.VirtualService, *v1beta1.VirtualServiceList](
|
||||
gentype.NewClientWithList[*appmeshv1beta1.VirtualService, *appmeshv1beta1.VirtualServiceList](
|
||||
"virtualservices",
|
||||
c.RESTClient(),
|
||||
scheme.ParameterCodec,
|
||||
namespace,
|
||||
func() *v1beta1.VirtualService { return &v1beta1.VirtualService{} },
|
||||
func() *v1beta1.VirtualServiceList { return &v1beta1.VirtualServiceList{} }),
|
||||
func() *appmeshv1beta1.VirtualService { return &appmeshv1beta1.VirtualService{} },
|
||||
func() *appmeshv1beta1.VirtualServiceList { return &appmeshv1beta1.VirtualServiceList{} },
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,10 +19,10 @@ limitations under the License.
|
||||
package v1beta2
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
http "net/http"
|
||||
|
||||
v1beta2 "github.com/fluxcd/flagger/pkg/apis/appmesh/v1beta2"
|
||||
"github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
appmeshv1beta2 "github.com/fluxcd/flagger/pkg/apis/appmesh/v1beta2"
|
||||
scheme "github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
rest "k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
@@ -55,9 +55,7 @@ func (c *AppmeshV1beta2Client) VirtualServices(namespace string) VirtualServiceI
|
||||
// where httpClient was generated with rest.HTTPClientFor(c).
|
||||
func NewForConfig(c *rest.Config) (*AppmeshV1beta2Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
setConfigDefaults(&config)
|
||||
httpClient, err := rest.HTTPClientFor(&config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -69,9 +67,7 @@ func NewForConfig(c *rest.Config) (*AppmeshV1beta2Client, error) {
|
||||
// Note the http client provided takes precedence over the configured transport values.
|
||||
func NewForConfigAndClient(c *rest.Config, h *http.Client) (*AppmeshV1beta2Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
setConfigDefaults(&config)
|
||||
client, err := rest.RESTClientForConfigAndClient(&config, h)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -94,17 +90,15 @@ func New(c rest.Interface) *AppmeshV1beta2Client {
|
||||
return &AppmeshV1beta2Client{c}
|
||||
}
|
||||
|
||||
func setConfigDefaults(config *rest.Config) error {
|
||||
gv := v1beta2.SchemeGroupVersion
|
||||
func setConfigDefaults(config *rest.Config) {
|
||||
gv := appmeshv1beta2.SchemeGroupVersion
|
||||
config.GroupVersion = &gv
|
||||
config.APIPath = "/apis"
|
||||
config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
|
||||
config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion()
|
||||
|
||||
if config.UserAgent == "" {
|
||||
config.UserAgent = rest.DefaultKubernetesUserAgent()
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
|
||||
@@ -29,15 +29,15 @@ type FakeAppmeshV1beta2 struct {
|
||||
}
|
||||
|
||||
func (c *FakeAppmeshV1beta2) VirtualNodes(namespace string) v1beta2.VirtualNodeInterface {
|
||||
return &FakeVirtualNodes{c, namespace}
|
||||
return newFakeVirtualNodes(c, namespace)
|
||||
}
|
||||
|
||||
func (c *FakeAppmeshV1beta2) VirtualRouters(namespace string) v1beta2.VirtualRouterInterface {
|
||||
return &FakeVirtualRouters{c, namespace}
|
||||
return newFakeVirtualRouters(c, namespace)
|
||||
}
|
||||
|
||||
func (c *FakeAppmeshV1beta2) VirtualServices(namespace string) v1beta2.VirtualServiceInterface {
|
||||
return &FakeVirtualServices{c, namespace}
|
||||
return newFakeVirtualServices(c, namespace)
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
|
||||
@@ -19,129 +19,32 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
v1beta2 "github.com/fluxcd/flagger/pkg/apis/appmesh/v1beta2"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
appmeshv1beta2 "github.com/fluxcd/flagger/pkg/client/clientset/versioned/typed/appmesh/v1beta2"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
)
|
||||
|
||||
// FakeVirtualNodes implements VirtualNodeInterface
|
||||
type FakeVirtualNodes struct {
|
||||
// fakeVirtualNodes implements VirtualNodeInterface
|
||||
type fakeVirtualNodes struct {
|
||||
*gentype.FakeClientWithList[*v1beta2.VirtualNode, *v1beta2.VirtualNodeList]
|
||||
Fake *FakeAppmeshV1beta2
|
||||
ns string
|
||||
}
|
||||
|
||||
var virtualnodesResource = v1beta2.SchemeGroupVersion.WithResource("virtualnodes")
|
||||
|
||||
var virtualnodesKind = v1beta2.SchemeGroupVersion.WithKind("VirtualNode")
|
||||
|
||||
// Get takes name of the virtualNode, and returns the corresponding virtualNode object, and an error if there is any.
|
||||
func (c *FakeVirtualNodes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.VirtualNode, err error) {
|
||||
emptyResult := &v1beta2.VirtualNode{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetActionWithOptions(virtualnodesResource, c.ns, name, options), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
func newFakeVirtualNodes(fake *FakeAppmeshV1beta2, namespace string) appmeshv1beta2.VirtualNodeInterface {
|
||||
return &fakeVirtualNodes{
|
||||
gentype.NewFakeClientWithList[*v1beta2.VirtualNode, *v1beta2.VirtualNodeList](
|
||||
fake.Fake,
|
||||
namespace,
|
||||
v1beta2.SchemeGroupVersion.WithResource("virtualnodes"),
|
||||
v1beta2.SchemeGroupVersion.WithKind("VirtualNode"),
|
||||
func() *v1beta2.VirtualNode { return &v1beta2.VirtualNode{} },
|
||||
func() *v1beta2.VirtualNodeList { return &v1beta2.VirtualNodeList{} },
|
||||
func(dst, src *v1beta2.VirtualNodeList) { dst.ListMeta = src.ListMeta },
|
||||
func(list *v1beta2.VirtualNodeList) []*v1beta2.VirtualNode { return gentype.ToPointerSlice(list.Items) },
|
||||
func(list *v1beta2.VirtualNodeList, items []*v1beta2.VirtualNode) {
|
||||
list.Items = gentype.FromPointerSlice(items)
|
||||
},
|
||||
),
|
||||
fake,
|
||||
}
|
||||
return obj.(*v1beta2.VirtualNode), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of VirtualNodes that match those selectors.
|
||||
func (c *FakeVirtualNodes) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.VirtualNodeList, err error) {
|
||||
emptyResult := &v1beta2.VirtualNodeList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListActionWithOptions(virtualnodesResource, virtualnodesKind, c.ns, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1beta2.VirtualNodeList{ListMeta: obj.(*v1beta2.VirtualNodeList).ListMeta}
|
||||
for _, item := range obj.(*v1beta2.VirtualNodeList).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 virtualNodes.
|
||||
func (c *FakeVirtualNodes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchActionWithOptions(virtualnodesResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a virtualNode and creates it. Returns the server's representation of the virtualNode, and an error, if there is any.
|
||||
func (c *FakeVirtualNodes) Create(ctx context.Context, virtualNode *v1beta2.VirtualNode, opts v1.CreateOptions) (result *v1beta2.VirtualNode, err error) {
|
||||
emptyResult := &v1beta2.VirtualNode{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateActionWithOptions(virtualnodesResource, c.ns, virtualNode, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta2.VirtualNode), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a virtualNode and updates it. Returns the server's representation of the virtualNode, and an error, if there is any.
|
||||
func (c *FakeVirtualNodes) Update(ctx context.Context, virtualNode *v1beta2.VirtualNode, opts v1.UpdateOptions) (result *v1beta2.VirtualNode, err error) {
|
||||
emptyResult := &v1beta2.VirtualNode{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateActionWithOptions(virtualnodesResource, c.ns, virtualNode, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta2.VirtualNode), err
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
func (c *FakeVirtualNodes) UpdateStatus(ctx context.Context, virtualNode *v1beta2.VirtualNode, opts v1.UpdateOptions) (result *v1beta2.VirtualNode, err error) {
|
||||
emptyResult := &v1beta2.VirtualNode{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateSubresourceActionWithOptions(virtualnodesResource, "status", c.ns, virtualNode, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta2.VirtualNode), err
|
||||
}
|
||||
|
||||
// Delete takes name of the virtualNode and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeVirtualNodes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteActionWithOptions(virtualnodesResource, c.ns, name, opts), &v1beta2.VirtualNode{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeVirtualNodes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionActionWithOptions(virtualnodesResource, c.ns, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1beta2.VirtualNodeList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched virtualNode.
|
||||
func (c *FakeVirtualNodes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.VirtualNode, err error) {
|
||||
emptyResult := &v1beta2.VirtualNode{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(virtualnodesResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta2.VirtualNode), err
|
||||
}
|
||||
|
||||
@@ -19,129 +19,34 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
v1beta2 "github.com/fluxcd/flagger/pkg/apis/appmesh/v1beta2"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
appmeshv1beta2 "github.com/fluxcd/flagger/pkg/client/clientset/versioned/typed/appmesh/v1beta2"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
)
|
||||
|
||||
// FakeVirtualRouters implements VirtualRouterInterface
|
||||
type FakeVirtualRouters struct {
|
||||
// fakeVirtualRouters implements VirtualRouterInterface
|
||||
type fakeVirtualRouters struct {
|
||||
*gentype.FakeClientWithList[*v1beta2.VirtualRouter, *v1beta2.VirtualRouterList]
|
||||
Fake *FakeAppmeshV1beta2
|
||||
ns string
|
||||
}
|
||||
|
||||
var virtualroutersResource = v1beta2.SchemeGroupVersion.WithResource("virtualrouters")
|
||||
|
||||
var virtualroutersKind = v1beta2.SchemeGroupVersion.WithKind("VirtualRouter")
|
||||
|
||||
// Get takes name of the virtualRouter, and returns the corresponding virtualRouter object, and an error if there is any.
|
||||
func (c *FakeVirtualRouters) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.VirtualRouter, err error) {
|
||||
emptyResult := &v1beta2.VirtualRouter{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetActionWithOptions(virtualroutersResource, c.ns, name, options), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
func newFakeVirtualRouters(fake *FakeAppmeshV1beta2, namespace string) appmeshv1beta2.VirtualRouterInterface {
|
||||
return &fakeVirtualRouters{
|
||||
gentype.NewFakeClientWithList[*v1beta2.VirtualRouter, *v1beta2.VirtualRouterList](
|
||||
fake.Fake,
|
||||
namespace,
|
||||
v1beta2.SchemeGroupVersion.WithResource("virtualrouters"),
|
||||
v1beta2.SchemeGroupVersion.WithKind("VirtualRouter"),
|
||||
func() *v1beta2.VirtualRouter { return &v1beta2.VirtualRouter{} },
|
||||
func() *v1beta2.VirtualRouterList { return &v1beta2.VirtualRouterList{} },
|
||||
func(dst, src *v1beta2.VirtualRouterList) { dst.ListMeta = src.ListMeta },
|
||||
func(list *v1beta2.VirtualRouterList) []*v1beta2.VirtualRouter {
|
||||
return gentype.ToPointerSlice(list.Items)
|
||||
},
|
||||
func(list *v1beta2.VirtualRouterList, items []*v1beta2.VirtualRouter) {
|
||||
list.Items = gentype.FromPointerSlice(items)
|
||||
},
|
||||
),
|
||||
fake,
|
||||
}
|
||||
return obj.(*v1beta2.VirtualRouter), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of VirtualRouters that match those selectors.
|
||||
func (c *FakeVirtualRouters) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.VirtualRouterList, err error) {
|
||||
emptyResult := &v1beta2.VirtualRouterList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListActionWithOptions(virtualroutersResource, virtualroutersKind, c.ns, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1beta2.VirtualRouterList{ListMeta: obj.(*v1beta2.VirtualRouterList).ListMeta}
|
||||
for _, item := range obj.(*v1beta2.VirtualRouterList).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 virtualRouters.
|
||||
func (c *FakeVirtualRouters) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchActionWithOptions(virtualroutersResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a virtualRouter and creates it. Returns the server's representation of the virtualRouter, and an error, if there is any.
|
||||
func (c *FakeVirtualRouters) Create(ctx context.Context, virtualRouter *v1beta2.VirtualRouter, opts v1.CreateOptions) (result *v1beta2.VirtualRouter, err error) {
|
||||
emptyResult := &v1beta2.VirtualRouter{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateActionWithOptions(virtualroutersResource, c.ns, virtualRouter, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta2.VirtualRouter), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a virtualRouter and updates it. Returns the server's representation of the virtualRouter, and an error, if there is any.
|
||||
func (c *FakeVirtualRouters) Update(ctx context.Context, virtualRouter *v1beta2.VirtualRouter, opts v1.UpdateOptions) (result *v1beta2.VirtualRouter, err error) {
|
||||
emptyResult := &v1beta2.VirtualRouter{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateActionWithOptions(virtualroutersResource, c.ns, virtualRouter, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta2.VirtualRouter), err
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
func (c *FakeVirtualRouters) UpdateStatus(ctx context.Context, virtualRouter *v1beta2.VirtualRouter, opts v1.UpdateOptions) (result *v1beta2.VirtualRouter, err error) {
|
||||
emptyResult := &v1beta2.VirtualRouter{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateSubresourceActionWithOptions(virtualroutersResource, "status", c.ns, virtualRouter, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta2.VirtualRouter), err
|
||||
}
|
||||
|
||||
// Delete takes name of the virtualRouter and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeVirtualRouters) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteActionWithOptions(virtualroutersResource, c.ns, name, opts), &v1beta2.VirtualRouter{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeVirtualRouters) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionActionWithOptions(virtualroutersResource, c.ns, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1beta2.VirtualRouterList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched virtualRouter.
|
||||
func (c *FakeVirtualRouters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.VirtualRouter, err error) {
|
||||
emptyResult := &v1beta2.VirtualRouter{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(virtualroutersResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta2.VirtualRouter), err
|
||||
}
|
||||
|
||||
@@ -19,129 +19,34 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
v1beta2 "github.com/fluxcd/flagger/pkg/apis/appmesh/v1beta2"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
appmeshv1beta2 "github.com/fluxcd/flagger/pkg/client/clientset/versioned/typed/appmesh/v1beta2"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
)
|
||||
|
||||
// FakeVirtualServices implements VirtualServiceInterface
|
||||
type FakeVirtualServices struct {
|
||||
// fakeVirtualServices implements VirtualServiceInterface
|
||||
type fakeVirtualServices struct {
|
||||
*gentype.FakeClientWithList[*v1beta2.VirtualService, *v1beta2.VirtualServiceList]
|
||||
Fake *FakeAppmeshV1beta2
|
||||
ns string
|
||||
}
|
||||
|
||||
var virtualservicesResource = v1beta2.SchemeGroupVersion.WithResource("virtualservices")
|
||||
|
||||
var virtualservicesKind = v1beta2.SchemeGroupVersion.WithKind("VirtualService")
|
||||
|
||||
// Get takes name of the virtualService, and returns the corresponding virtualService object, and an error if there is any.
|
||||
func (c *FakeVirtualServices) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.VirtualService, err error) {
|
||||
emptyResult := &v1beta2.VirtualService{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetActionWithOptions(virtualservicesResource, c.ns, name, options), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
func newFakeVirtualServices(fake *FakeAppmeshV1beta2, namespace string) appmeshv1beta2.VirtualServiceInterface {
|
||||
return &fakeVirtualServices{
|
||||
gentype.NewFakeClientWithList[*v1beta2.VirtualService, *v1beta2.VirtualServiceList](
|
||||
fake.Fake,
|
||||
namespace,
|
||||
v1beta2.SchemeGroupVersion.WithResource("virtualservices"),
|
||||
v1beta2.SchemeGroupVersion.WithKind("VirtualService"),
|
||||
func() *v1beta2.VirtualService { return &v1beta2.VirtualService{} },
|
||||
func() *v1beta2.VirtualServiceList { return &v1beta2.VirtualServiceList{} },
|
||||
func(dst, src *v1beta2.VirtualServiceList) { dst.ListMeta = src.ListMeta },
|
||||
func(list *v1beta2.VirtualServiceList) []*v1beta2.VirtualService {
|
||||
return gentype.ToPointerSlice(list.Items)
|
||||
},
|
||||
func(list *v1beta2.VirtualServiceList, items []*v1beta2.VirtualService) {
|
||||
list.Items = gentype.FromPointerSlice(items)
|
||||
},
|
||||
),
|
||||
fake,
|
||||
}
|
||||
return obj.(*v1beta2.VirtualService), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of VirtualServices that match those selectors.
|
||||
func (c *FakeVirtualServices) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.VirtualServiceList, err error) {
|
||||
emptyResult := &v1beta2.VirtualServiceList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListActionWithOptions(virtualservicesResource, virtualservicesKind, c.ns, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1beta2.VirtualServiceList{ListMeta: obj.(*v1beta2.VirtualServiceList).ListMeta}
|
||||
for _, item := range obj.(*v1beta2.VirtualServiceList).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 virtualServices.
|
||||
func (c *FakeVirtualServices) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchActionWithOptions(virtualservicesResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a virtualService and creates it. Returns the server's representation of the virtualService, and an error, if there is any.
|
||||
func (c *FakeVirtualServices) Create(ctx context.Context, virtualService *v1beta2.VirtualService, opts v1.CreateOptions) (result *v1beta2.VirtualService, err error) {
|
||||
emptyResult := &v1beta2.VirtualService{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateActionWithOptions(virtualservicesResource, c.ns, virtualService, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta2.VirtualService), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a virtualService and updates it. Returns the server's representation of the virtualService, and an error, if there is any.
|
||||
func (c *FakeVirtualServices) Update(ctx context.Context, virtualService *v1beta2.VirtualService, opts v1.UpdateOptions) (result *v1beta2.VirtualService, err error) {
|
||||
emptyResult := &v1beta2.VirtualService{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateActionWithOptions(virtualservicesResource, c.ns, virtualService, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta2.VirtualService), err
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
func (c *FakeVirtualServices) UpdateStatus(ctx context.Context, virtualService *v1beta2.VirtualService, opts v1.UpdateOptions) (result *v1beta2.VirtualService, err error) {
|
||||
emptyResult := &v1beta2.VirtualService{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateSubresourceActionWithOptions(virtualservicesResource, "status", c.ns, virtualService, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta2.VirtualService), err
|
||||
}
|
||||
|
||||
// Delete takes name of the virtualService and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeVirtualServices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteActionWithOptions(virtualservicesResource, c.ns, name, opts), &v1beta2.VirtualService{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeVirtualServices) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionActionWithOptions(virtualservicesResource, c.ns, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1beta2.VirtualServiceList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched virtualService.
|
||||
func (c *FakeVirtualServices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.VirtualService, err error) {
|
||||
emptyResult := &v1beta2.VirtualService{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(virtualservicesResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta2.VirtualService), err
|
||||
}
|
||||
|
||||
@@ -19,9 +19,9 @@ limitations under the License.
|
||||
package v1beta2
|
||||
|
||||
import (
|
||||
"context"
|
||||
context "context"
|
||||
|
||||
v1beta2 "github.com/fluxcd/flagger/pkg/apis/appmesh/v1beta2"
|
||||
appmeshv1beta2 "github.com/fluxcd/flagger/pkg/apis/appmesh/v1beta2"
|
||||
scheme "github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
@@ -37,33 +37,34 @@ type VirtualNodesGetter interface {
|
||||
|
||||
// VirtualNodeInterface has methods to work with VirtualNode resources.
|
||||
type VirtualNodeInterface interface {
|
||||
Create(ctx context.Context, virtualNode *v1beta2.VirtualNode, opts v1.CreateOptions) (*v1beta2.VirtualNode, error)
|
||||
Update(ctx context.Context, virtualNode *v1beta2.VirtualNode, opts v1.UpdateOptions) (*v1beta2.VirtualNode, error)
|
||||
Create(ctx context.Context, virtualNode *appmeshv1beta2.VirtualNode, opts v1.CreateOptions) (*appmeshv1beta2.VirtualNode, error)
|
||||
Update(ctx context.Context, virtualNode *appmeshv1beta2.VirtualNode, opts v1.UpdateOptions) (*appmeshv1beta2.VirtualNode, error)
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
UpdateStatus(ctx context.Context, virtualNode *v1beta2.VirtualNode, opts v1.UpdateOptions) (*v1beta2.VirtualNode, error)
|
||||
UpdateStatus(ctx context.Context, virtualNode *appmeshv1beta2.VirtualNode, opts v1.UpdateOptions) (*appmeshv1beta2.VirtualNode, 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) (*v1beta2.VirtualNode, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*v1beta2.VirtualNodeList, error)
|
||||
Get(ctx context.Context, name string, opts v1.GetOptions) (*appmeshv1beta2.VirtualNode, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*appmeshv1beta2.VirtualNodeList, 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 *v1beta2.VirtualNode, err error)
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *appmeshv1beta2.VirtualNode, err error)
|
||||
VirtualNodeExpansion
|
||||
}
|
||||
|
||||
// virtualNodes implements VirtualNodeInterface
|
||||
type virtualNodes struct {
|
||||
*gentype.ClientWithList[*v1beta2.VirtualNode, *v1beta2.VirtualNodeList]
|
||||
*gentype.ClientWithList[*appmeshv1beta2.VirtualNode, *appmeshv1beta2.VirtualNodeList]
|
||||
}
|
||||
|
||||
// newVirtualNodes returns a VirtualNodes
|
||||
func newVirtualNodes(c *AppmeshV1beta2Client, namespace string) *virtualNodes {
|
||||
return &virtualNodes{
|
||||
gentype.NewClientWithList[*v1beta2.VirtualNode, *v1beta2.VirtualNodeList](
|
||||
gentype.NewClientWithList[*appmeshv1beta2.VirtualNode, *appmeshv1beta2.VirtualNodeList](
|
||||
"virtualnodes",
|
||||
c.RESTClient(),
|
||||
scheme.ParameterCodec,
|
||||
namespace,
|
||||
func() *v1beta2.VirtualNode { return &v1beta2.VirtualNode{} },
|
||||
func() *v1beta2.VirtualNodeList { return &v1beta2.VirtualNodeList{} }),
|
||||
func() *appmeshv1beta2.VirtualNode { return &appmeshv1beta2.VirtualNode{} },
|
||||
func() *appmeshv1beta2.VirtualNodeList { return &appmeshv1beta2.VirtualNodeList{} },
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,9 +19,9 @@ limitations under the License.
|
||||
package v1beta2
|
||||
|
||||
import (
|
||||
"context"
|
||||
context "context"
|
||||
|
||||
v1beta2 "github.com/fluxcd/flagger/pkg/apis/appmesh/v1beta2"
|
||||
appmeshv1beta2 "github.com/fluxcd/flagger/pkg/apis/appmesh/v1beta2"
|
||||
scheme "github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
@@ -37,33 +37,34 @@ type VirtualRoutersGetter interface {
|
||||
|
||||
// VirtualRouterInterface has methods to work with VirtualRouter resources.
|
||||
type VirtualRouterInterface interface {
|
||||
Create(ctx context.Context, virtualRouter *v1beta2.VirtualRouter, opts v1.CreateOptions) (*v1beta2.VirtualRouter, error)
|
||||
Update(ctx context.Context, virtualRouter *v1beta2.VirtualRouter, opts v1.UpdateOptions) (*v1beta2.VirtualRouter, error)
|
||||
Create(ctx context.Context, virtualRouter *appmeshv1beta2.VirtualRouter, opts v1.CreateOptions) (*appmeshv1beta2.VirtualRouter, error)
|
||||
Update(ctx context.Context, virtualRouter *appmeshv1beta2.VirtualRouter, opts v1.UpdateOptions) (*appmeshv1beta2.VirtualRouter, error)
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
UpdateStatus(ctx context.Context, virtualRouter *v1beta2.VirtualRouter, opts v1.UpdateOptions) (*v1beta2.VirtualRouter, error)
|
||||
UpdateStatus(ctx context.Context, virtualRouter *appmeshv1beta2.VirtualRouter, opts v1.UpdateOptions) (*appmeshv1beta2.VirtualRouter, 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) (*v1beta2.VirtualRouter, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*v1beta2.VirtualRouterList, error)
|
||||
Get(ctx context.Context, name string, opts v1.GetOptions) (*appmeshv1beta2.VirtualRouter, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*appmeshv1beta2.VirtualRouterList, 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 *v1beta2.VirtualRouter, err error)
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *appmeshv1beta2.VirtualRouter, err error)
|
||||
VirtualRouterExpansion
|
||||
}
|
||||
|
||||
// virtualRouters implements VirtualRouterInterface
|
||||
type virtualRouters struct {
|
||||
*gentype.ClientWithList[*v1beta2.VirtualRouter, *v1beta2.VirtualRouterList]
|
||||
*gentype.ClientWithList[*appmeshv1beta2.VirtualRouter, *appmeshv1beta2.VirtualRouterList]
|
||||
}
|
||||
|
||||
// newVirtualRouters returns a VirtualRouters
|
||||
func newVirtualRouters(c *AppmeshV1beta2Client, namespace string) *virtualRouters {
|
||||
return &virtualRouters{
|
||||
gentype.NewClientWithList[*v1beta2.VirtualRouter, *v1beta2.VirtualRouterList](
|
||||
gentype.NewClientWithList[*appmeshv1beta2.VirtualRouter, *appmeshv1beta2.VirtualRouterList](
|
||||
"virtualrouters",
|
||||
c.RESTClient(),
|
||||
scheme.ParameterCodec,
|
||||
namespace,
|
||||
func() *v1beta2.VirtualRouter { return &v1beta2.VirtualRouter{} },
|
||||
func() *v1beta2.VirtualRouterList { return &v1beta2.VirtualRouterList{} }),
|
||||
func() *appmeshv1beta2.VirtualRouter { return &appmeshv1beta2.VirtualRouter{} },
|
||||
func() *appmeshv1beta2.VirtualRouterList { return &appmeshv1beta2.VirtualRouterList{} },
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,9 +19,9 @@ limitations under the License.
|
||||
package v1beta2
|
||||
|
||||
import (
|
||||
"context"
|
||||
context "context"
|
||||
|
||||
v1beta2 "github.com/fluxcd/flagger/pkg/apis/appmesh/v1beta2"
|
||||
appmeshv1beta2 "github.com/fluxcd/flagger/pkg/apis/appmesh/v1beta2"
|
||||
scheme "github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
@@ -37,33 +37,34 @@ type VirtualServicesGetter interface {
|
||||
|
||||
// VirtualServiceInterface has methods to work with VirtualService resources.
|
||||
type VirtualServiceInterface interface {
|
||||
Create(ctx context.Context, virtualService *v1beta2.VirtualService, opts v1.CreateOptions) (*v1beta2.VirtualService, error)
|
||||
Update(ctx context.Context, virtualService *v1beta2.VirtualService, opts v1.UpdateOptions) (*v1beta2.VirtualService, error)
|
||||
Create(ctx context.Context, virtualService *appmeshv1beta2.VirtualService, opts v1.CreateOptions) (*appmeshv1beta2.VirtualService, error)
|
||||
Update(ctx context.Context, virtualService *appmeshv1beta2.VirtualService, opts v1.UpdateOptions) (*appmeshv1beta2.VirtualService, error)
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
UpdateStatus(ctx context.Context, virtualService *v1beta2.VirtualService, opts v1.UpdateOptions) (*v1beta2.VirtualService, error)
|
||||
UpdateStatus(ctx context.Context, virtualService *appmeshv1beta2.VirtualService, opts v1.UpdateOptions) (*appmeshv1beta2.VirtualService, 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) (*v1beta2.VirtualService, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*v1beta2.VirtualServiceList, error)
|
||||
Get(ctx context.Context, name string, opts v1.GetOptions) (*appmeshv1beta2.VirtualService, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*appmeshv1beta2.VirtualServiceList, 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 *v1beta2.VirtualService, err error)
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *appmeshv1beta2.VirtualService, err error)
|
||||
VirtualServiceExpansion
|
||||
}
|
||||
|
||||
// virtualServices implements VirtualServiceInterface
|
||||
type virtualServices struct {
|
||||
*gentype.ClientWithList[*v1beta2.VirtualService, *v1beta2.VirtualServiceList]
|
||||
*gentype.ClientWithList[*appmeshv1beta2.VirtualService, *appmeshv1beta2.VirtualServiceList]
|
||||
}
|
||||
|
||||
// newVirtualServices returns a VirtualServices
|
||||
func newVirtualServices(c *AppmeshV1beta2Client, namespace string) *virtualServices {
|
||||
return &virtualServices{
|
||||
gentype.NewClientWithList[*v1beta2.VirtualService, *v1beta2.VirtualServiceList](
|
||||
gentype.NewClientWithList[*appmeshv1beta2.VirtualService, *appmeshv1beta2.VirtualServiceList](
|
||||
"virtualservices",
|
||||
c.RESTClient(),
|
||||
scheme.ParameterCodec,
|
||||
namespace,
|
||||
func() *v1beta2.VirtualService { return &v1beta2.VirtualService{} },
|
||||
func() *v1beta2.VirtualServiceList { return &v1beta2.VirtualServiceList{} }),
|
||||
func() *appmeshv1beta2.VirtualService { return &appmeshv1beta2.VirtualService{} },
|
||||
func() *appmeshv1beta2.VirtualServiceList { return &appmeshv1beta2.VirtualServiceList{} },
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,9 +19,9 @@ limitations under the License.
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
"context"
|
||||
context "context"
|
||||
|
||||
v1beta1 "github.com/fluxcd/flagger/pkg/apis/flagger/v1beta1"
|
||||
flaggerv1beta1 "github.com/fluxcd/flagger/pkg/apis/flagger/v1beta1"
|
||||
scheme "github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
@@ -37,33 +37,34 @@ type AlertProvidersGetter interface {
|
||||
|
||||
// AlertProviderInterface has methods to work with AlertProvider resources.
|
||||
type AlertProviderInterface interface {
|
||||
Create(ctx context.Context, alertProvider *v1beta1.AlertProvider, opts v1.CreateOptions) (*v1beta1.AlertProvider, error)
|
||||
Update(ctx context.Context, alertProvider *v1beta1.AlertProvider, opts v1.UpdateOptions) (*v1beta1.AlertProvider, error)
|
||||
Create(ctx context.Context, alertProvider *flaggerv1beta1.AlertProvider, opts v1.CreateOptions) (*flaggerv1beta1.AlertProvider, error)
|
||||
Update(ctx context.Context, alertProvider *flaggerv1beta1.AlertProvider, opts v1.UpdateOptions) (*flaggerv1beta1.AlertProvider, error)
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
UpdateStatus(ctx context.Context, alertProvider *v1beta1.AlertProvider, opts v1.UpdateOptions) (*v1beta1.AlertProvider, error)
|
||||
UpdateStatus(ctx context.Context, alertProvider *flaggerv1beta1.AlertProvider, opts v1.UpdateOptions) (*flaggerv1beta1.AlertProvider, 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) (*v1beta1.AlertProvider, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.AlertProviderList, error)
|
||||
Get(ctx context.Context, name string, opts v1.GetOptions) (*flaggerv1beta1.AlertProvider, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*flaggerv1beta1.AlertProviderList, 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 *v1beta1.AlertProvider, err error)
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *flaggerv1beta1.AlertProvider, err error)
|
||||
AlertProviderExpansion
|
||||
}
|
||||
|
||||
// alertProviders implements AlertProviderInterface
|
||||
type alertProviders struct {
|
||||
*gentype.ClientWithList[*v1beta1.AlertProvider, *v1beta1.AlertProviderList]
|
||||
*gentype.ClientWithList[*flaggerv1beta1.AlertProvider, *flaggerv1beta1.AlertProviderList]
|
||||
}
|
||||
|
||||
// newAlertProviders returns a AlertProviders
|
||||
func newAlertProviders(c *FlaggerV1beta1Client, namespace string) *alertProviders {
|
||||
return &alertProviders{
|
||||
gentype.NewClientWithList[*v1beta1.AlertProvider, *v1beta1.AlertProviderList](
|
||||
gentype.NewClientWithList[*flaggerv1beta1.AlertProvider, *flaggerv1beta1.AlertProviderList](
|
||||
"alertproviders",
|
||||
c.RESTClient(),
|
||||
scheme.ParameterCodec,
|
||||
namespace,
|
||||
func() *v1beta1.AlertProvider { return &v1beta1.AlertProvider{} },
|
||||
func() *v1beta1.AlertProviderList { return &v1beta1.AlertProviderList{} }),
|
||||
func() *flaggerv1beta1.AlertProvider { return &flaggerv1beta1.AlertProvider{} },
|
||||
func() *flaggerv1beta1.AlertProviderList { return &flaggerv1beta1.AlertProviderList{} },
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,9 +19,9 @@ limitations under the License.
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
"context"
|
||||
context "context"
|
||||
|
||||
v1beta1 "github.com/fluxcd/flagger/pkg/apis/flagger/v1beta1"
|
||||
flaggerv1beta1 "github.com/fluxcd/flagger/pkg/apis/flagger/v1beta1"
|
||||
scheme "github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
@@ -37,33 +37,34 @@ type CanariesGetter interface {
|
||||
|
||||
// CanaryInterface has methods to work with Canary resources.
|
||||
type CanaryInterface interface {
|
||||
Create(ctx context.Context, canary *v1beta1.Canary, opts v1.CreateOptions) (*v1beta1.Canary, error)
|
||||
Update(ctx context.Context, canary *v1beta1.Canary, opts v1.UpdateOptions) (*v1beta1.Canary, error)
|
||||
Create(ctx context.Context, canary *flaggerv1beta1.Canary, opts v1.CreateOptions) (*flaggerv1beta1.Canary, error)
|
||||
Update(ctx context.Context, canary *flaggerv1beta1.Canary, opts v1.UpdateOptions) (*flaggerv1beta1.Canary, error)
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
UpdateStatus(ctx context.Context, canary *v1beta1.Canary, opts v1.UpdateOptions) (*v1beta1.Canary, error)
|
||||
UpdateStatus(ctx context.Context, canary *flaggerv1beta1.Canary, opts v1.UpdateOptions) (*flaggerv1beta1.Canary, 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) (*v1beta1.Canary, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.CanaryList, error)
|
||||
Get(ctx context.Context, name string, opts v1.GetOptions) (*flaggerv1beta1.Canary, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*flaggerv1beta1.CanaryList, 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 *v1beta1.Canary, err error)
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *flaggerv1beta1.Canary, err error)
|
||||
CanaryExpansion
|
||||
}
|
||||
|
||||
// canaries implements CanaryInterface
|
||||
type canaries struct {
|
||||
*gentype.ClientWithList[*v1beta1.Canary, *v1beta1.CanaryList]
|
||||
*gentype.ClientWithList[*flaggerv1beta1.Canary, *flaggerv1beta1.CanaryList]
|
||||
}
|
||||
|
||||
// newCanaries returns a Canaries
|
||||
func newCanaries(c *FlaggerV1beta1Client, namespace string) *canaries {
|
||||
return &canaries{
|
||||
gentype.NewClientWithList[*v1beta1.Canary, *v1beta1.CanaryList](
|
||||
gentype.NewClientWithList[*flaggerv1beta1.Canary, *flaggerv1beta1.CanaryList](
|
||||
"canaries",
|
||||
c.RESTClient(),
|
||||
scheme.ParameterCodec,
|
||||
namespace,
|
||||
func() *v1beta1.Canary { return &v1beta1.Canary{} },
|
||||
func() *v1beta1.CanaryList { return &v1beta1.CanaryList{} }),
|
||||
func() *flaggerv1beta1.Canary { return &flaggerv1beta1.Canary{} },
|
||||
func() *flaggerv1beta1.CanaryList { return &flaggerv1beta1.CanaryList{} },
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,129 +19,34 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
v1beta1 "github.com/fluxcd/flagger/pkg/apis/flagger/v1beta1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
flaggerv1beta1 "github.com/fluxcd/flagger/pkg/client/clientset/versioned/typed/flagger/v1beta1"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
)
|
||||
|
||||
// FakeAlertProviders implements AlertProviderInterface
|
||||
type FakeAlertProviders struct {
|
||||
// fakeAlertProviders implements AlertProviderInterface
|
||||
type fakeAlertProviders struct {
|
||||
*gentype.FakeClientWithList[*v1beta1.AlertProvider, *v1beta1.AlertProviderList]
|
||||
Fake *FakeFlaggerV1beta1
|
||||
ns string
|
||||
}
|
||||
|
||||
var alertprovidersResource = v1beta1.SchemeGroupVersion.WithResource("alertproviders")
|
||||
|
||||
var alertprovidersKind = v1beta1.SchemeGroupVersion.WithKind("AlertProvider")
|
||||
|
||||
// Get takes name of the alertProvider, and returns the corresponding alertProvider object, and an error if there is any.
|
||||
func (c *FakeAlertProviders) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.AlertProvider, err error) {
|
||||
emptyResult := &v1beta1.AlertProvider{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetActionWithOptions(alertprovidersResource, c.ns, name, options), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
func newFakeAlertProviders(fake *FakeFlaggerV1beta1, namespace string) flaggerv1beta1.AlertProviderInterface {
|
||||
return &fakeAlertProviders{
|
||||
gentype.NewFakeClientWithList[*v1beta1.AlertProvider, *v1beta1.AlertProviderList](
|
||||
fake.Fake,
|
||||
namespace,
|
||||
v1beta1.SchemeGroupVersion.WithResource("alertproviders"),
|
||||
v1beta1.SchemeGroupVersion.WithKind("AlertProvider"),
|
||||
func() *v1beta1.AlertProvider { return &v1beta1.AlertProvider{} },
|
||||
func() *v1beta1.AlertProviderList { return &v1beta1.AlertProviderList{} },
|
||||
func(dst, src *v1beta1.AlertProviderList) { dst.ListMeta = src.ListMeta },
|
||||
func(list *v1beta1.AlertProviderList) []*v1beta1.AlertProvider {
|
||||
return gentype.ToPointerSlice(list.Items)
|
||||
},
|
||||
func(list *v1beta1.AlertProviderList, items []*v1beta1.AlertProvider) {
|
||||
list.Items = gentype.FromPointerSlice(items)
|
||||
},
|
||||
),
|
||||
fake,
|
||||
}
|
||||
return obj.(*v1beta1.AlertProvider), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of AlertProviders that match those selectors.
|
||||
func (c *FakeAlertProviders) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.AlertProviderList, err error) {
|
||||
emptyResult := &v1beta1.AlertProviderList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListActionWithOptions(alertprovidersResource, alertprovidersKind, c.ns, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1beta1.AlertProviderList{ListMeta: obj.(*v1beta1.AlertProviderList).ListMeta}
|
||||
for _, item := range obj.(*v1beta1.AlertProviderList).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 alertProviders.
|
||||
func (c *FakeAlertProviders) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchActionWithOptions(alertprovidersResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a alertProvider and creates it. Returns the server's representation of the alertProvider, and an error, if there is any.
|
||||
func (c *FakeAlertProviders) Create(ctx context.Context, alertProvider *v1beta1.AlertProvider, opts v1.CreateOptions) (result *v1beta1.AlertProvider, err error) {
|
||||
emptyResult := &v1beta1.AlertProvider{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateActionWithOptions(alertprovidersResource, c.ns, alertProvider, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.AlertProvider), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a alertProvider and updates it. Returns the server's representation of the alertProvider, and an error, if there is any.
|
||||
func (c *FakeAlertProviders) Update(ctx context.Context, alertProvider *v1beta1.AlertProvider, opts v1.UpdateOptions) (result *v1beta1.AlertProvider, err error) {
|
||||
emptyResult := &v1beta1.AlertProvider{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateActionWithOptions(alertprovidersResource, c.ns, alertProvider, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.AlertProvider), err
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
func (c *FakeAlertProviders) UpdateStatus(ctx context.Context, alertProvider *v1beta1.AlertProvider, opts v1.UpdateOptions) (result *v1beta1.AlertProvider, err error) {
|
||||
emptyResult := &v1beta1.AlertProvider{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateSubresourceActionWithOptions(alertprovidersResource, "status", c.ns, alertProvider, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.AlertProvider), err
|
||||
}
|
||||
|
||||
// Delete takes name of the alertProvider and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeAlertProviders) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteActionWithOptions(alertprovidersResource, c.ns, name, opts), &v1beta1.AlertProvider{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeAlertProviders) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionActionWithOptions(alertprovidersResource, c.ns, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1beta1.AlertProviderList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched alertProvider.
|
||||
func (c *FakeAlertProviders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.AlertProvider, err error) {
|
||||
emptyResult := &v1beta1.AlertProvider{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(alertprovidersResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.AlertProvider), err
|
||||
}
|
||||
|
||||
@@ -19,129 +19,30 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
v1beta1 "github.com/fluxcd/flagger/pkg/apis/flagger/v1beta1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
flaggerv1beta1 "github.com/fluxcd/flagger/pkg/client/clientset/versioned/typed/flagger/v1beta1"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
)
|
||||
|
||||
// FakeCanaries implements CanaryInterface
|
||||
type FakeCanaries struct {
|
||||
// fakeCanaries implements CanaryInterface
|
||||
type fakeCanaries struct {
|
||||
*gentype.FakeClientWithList[*v1beta1.Canary, *v1beta1.CanaryList]
|
||||
Fake *FakeFlaggerV1beta1
|
||||
ns string
|
||||
}
|
||||
|
||||
var canariesResource = v1beta1.SchemeGroupVersion.WithResource("canaries")
|
||||
|
||||
var canariesKind = v1beta1.SchemeGroupVersion.WithKind("Canary")
|
||||
|
||||
// Get takes name of the canary, and returns the corresponding canary object, and an error if there is any.
|
||||
func (c *FakeCanaries) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Canary, err error) {
|
||||
emptyResult := &v1beta1.Canary{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetActionWithOptions(canariesResource, c.ns, name, options), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
func newFakeCanaries(fake *FakeFlaggerV1beta1, namespace string) flaggerv1beta1.CanaryInterface {
|
||||
return &fakeCanaries{
|
||||
gentype.NewFakeClientWithList[*v1beta1.Canary, *v1beta1.CanaryList](
|
||||
fake.Fake,
|
||||
namespace,
|
||||
v1beta1.SchemeGroupVersion.WithResource("canaries"),
|
||||
v1beta1.SchemeGroupVersion.WithKind("Canary"),
|
||||
func() *v1beta1.Canary { return &v1beta1.Canary{} },
|
||||
func() *v1beta1.CanaryList { return &v1beta1.CanaryList{} },
|
||||
func(dst, src *v1beta1.CanaryList) { dst.ListMeta = src.ListMeta },
|
||||
func(list *v1beta1.CanaryList) []*v1beta1.Canary { return gentype.ToPointerSlice(list.Items) },
|
||||
func(list *v1beta1.CanaryList, items []*v1beta1.Canary) { list.Items = gentype.FromPointerSlice(items) },
|
||||
),
|
||||
fake,
|
||||
}
|
||||
return obj.(*v1beta1.Canary), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of Canaries that match those selectors.
|
||||
func (c *FakeCanaries) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CanaryList, err error) {
|
||||
emptyResult := &v1beta1.CanaryList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListActionWithOptions(canariesResource, canariesKind, c.ns, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1beta1.CanaryList{ListMeta: obj.(*v1beta1.CanaryList).ListMeta}
|
||||
for _, item := range obj.(*v1beta1.CanaryList).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 canaries.
|
||||
func (c *FakeCanaries) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchActionWithOptions(canariesResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a canary and creates it. Returns the server's representation of the canary, and an error, if there is any.
|
||||
func (c *FakeCanaries) Create(ctx context.Context, canary *v1beta1.Canary, opts v1.CreateOptions) (result *v1beta1.Canary, err error) {
|
||||
emptyResult := &v1beta1.Canary{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateActionWithOptions(canariesResource, c.ns, canary, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.Canary), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a canary and updates it. Returns the server's representation of the canary, and an error, if there is any.
|
||||
func (c *FakeCanaries) Update(ctx context.Context, canary *v1beta1.Canary, opts v1.UpdateOptions) (result *v1beta1.Canary, err error) {
|
||||
emptyResult := &v1beta1.Canary{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateActionWithOptions(canariesResource, c.ns, canary, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.Canary), err
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
func (c *FakeCanaries) UpdateStatus(ctx context.Context, canary *v1beta1.Canary, opts v1.UpdateOptions) (result *v1beta1.Canary, err error) {
|
||||
emptyResult := &v1beta1.Canary{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateSubresourceActionWithOptions(canariesResource, "status", c.ns, canary, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.Canary), err
|
||||
}
|
||||
|
||||
// Delete takes name of the canary and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeCanaries) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteActionWithOptions(canariesResource, c.ns, name, opts), &v1beta1.Canary{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeCanaries) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionActionWithOptions(canariesResource, c.ns, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1beta1.CanaryList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched canary.
|
||||
func (c *FakeCanaries) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Canary, err error) {
|
||||
emptyResult := &v1beta1.Canary{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(canariesResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.Canary), err
|
||||
}
|
||||
|
||||
@@ -29,15 +29,15 @@ type FakeFlaggerV1beta1 struct {
|
||||
}
|
||||
|
||||
func (c *FakeFlaggerV1beta1) AlertProviders(namespace string) v1beta1.AlertProviderInterface {
|
||||
return &FakeAlertProviders{c, namespace}
|
||||
return newFakeAlertProviders(c, namespace)
|
||||
}
|
||||
|
||||
func (c *FakeFlaggerV1beta1) Canaries(namespace string) v1beta1.CanaryInterface {
|
||||
return &FakeCanaries{c, namespace}
|
||||
return newFakeCanaries(c, namespace)
|
||||
}
|
||||
|
||||
func (c *FakeFlaggerV1beta1) MetricTemplates(namespace string) v1beta1.MetricTemplateInterface {
|
||||
return &FakeMetricTemplates{c, namespace}
|
||||
return newFakeMetricTemplates(c, namespace)
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
|
||||
@@ -19,129 +19,34 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
v1beta1 "github.com/fluxcd/flagger/pkg/apis/flagger/v1beta1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
flaggerv1beta1 "github.com/fluxcd/flagger/pkg/client/clientset/versioned/typed/flagger/v1beta1"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
)
|
||||
|
||||
// FakeMetricTemplates implements MetricTemplateInterface
|
||||
type FakeMetricTemplates struct {
|
||||
// fakeMetricTemplates implements MetricTemplateInterface
|
||||
type fakeMetricTemplates struct {
|
||||
*gentype.FakeClientWithList[*v1beta1.MetricTemplate, *v1beta1.MetricTemplateList]
|
||||
Fake *FakeFlaggerV1beta1
|
||||
ns string
|
||||
}
|
||||
|
||||
var metrictemplatesResource = v1beta1.SchemeGroupVersion.WithResource("metrictemplates")
|
||||
|
||||
var metrictemplatesKind = v1beta1.SchemeGroupVersion.WithKind("MetricTemplate")
|
||||
|
||||
// Get takes name of the metricTemplate, and returns the corresponding metricTemplate object, and an error if there is any.
|
||||
func (c *FakeMetricTemplates) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.MetricTemplate, err error) {
|
||||
emptyResult := &v1beta1.MetricTemplate{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetActionWithOptions(metrictemplatesResource, c.ns, name, options), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
func newFakeMetricTemplates(fake *FakeFlaggerV1beta1, namespace string) flaggerv1beta1.MetricTemplateInterface {
|
||||
return &fakeMetricTemplates{
|
||||
gentype.NewFakeClientWithList[*v1beta1.MetricTemplate, *v1beta1.MetricTemplateList](
|
||||
fake.Fake,
|
||||
namespace,
|
||||
v1beta1.SchemeGroupVersion.WithResource("metrictemplates"),
|
||||
v1beta1.SchemeGroupVersion.WithKind("MetricTemplate"),
|
||||
func() *v1beta1.MetricTemplate { return &v1beta1.MetricTemplate{} },
|
||||
func() *v1beta1.MetricTemplateList { return &v1beta1.MetricTemplateList{} },
|
||||
func(dst, src *v1beta1.MetricTemplateList) { dst.ListMeta = src.ListMeta },
|
||||
func(list *v1beta1.MetricTemplateList) []*v1beta1.MetricTemplate {
|
||||
return gentype.ToPointerSlice(list.Items)
|
||||
},
|
||||
func(list *v1beta1.MetricTemplateList, items []*v1beta1.MetricTemplate) {
|
||||
list.Items = gentype.FromPointerSlice(items)
|
||||
},
|
||||
),
|
||||
fake,
|
||||
}
|
||||
return obj.(*v1beta1.MetricTemplate), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of MetricTemplates that match those selectors.
|
||||
func (c *FakeMetricTemplates) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.MetricTemplateList, err error) {
|
||||
emptyResult := &v1beta1.MetricTemplateList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListActionWithOptions(metrictemplatesResource, metrictemplatesKind, c.ns, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1beta1.MetricTemplateList{ListMeta: obj.(*v1beta1.MetricTemplateList).ListMeta}
|
||||
for _, item := range obj.(*v1beta1.MetricTemplateList).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 metricTemplates.
|
||||
func (c *FakeMetricTemplates) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchActionWithOptions(metrictemplatesResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a metricTemplate and creates it. Returns the server's representation of the metricTemplate, and an error, if there is any.
|
||||
func (c *FakeMetricTemplates) Create(ctx context.Context, metricTemplate *v1beta1.MetricTemplate, opts v1.CreateOptions) (result *v1beta1.MetricTemplate, err error) {
|
||||
emptyResult := &v1beta1.MetricTemplate{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateActionWithOptions(metrictemplatesResource, c.ns, metricTemplate, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.MetricTemplate), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a metricTemplate and updates it. Returns the server's representation of the metricTemplate, and an error, if there is any.
|
||||
func (c *FakeMetricTemplates) Update(ctx context.Context, metricTemplate *v1beta1.MetricTemplate, opts v1.UpdateOptions) (result *v1beta1.MetricTemplate, err error) {
|
||||
emptyResult := &v1beta1.MetricTemplate{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateActionWithOptions(metrictemplatesResource, c.ns, metricTemplate, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.MetricTemplate), err
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
func (c *FakeMetricTemplates) UpdateStatus(ctx context.Context, metricTemplate *v1beta1.MetricTemplate, opts v1.UpdateOptions) (result *v1beta1.MetricTemplate, err error) {
|
||||
emptyResult := &v1beta1.MetricTemplate{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateSubresourceActionWithOptions(metrictemplatesResource, "status", c.ns, metricTemplate, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.MetricTemplate), err
|
||||
}
|
||||
|
||||
// Delete takes name of the metricTemplate and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeMetricTemplates) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteActionWithOptions(metrictemplatesResource, c.ns, name, opts), &v1beta1.MetricTemplate{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeMetricTemplates) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionActionWithOptions(metrictemplatesResource, c.ns, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1beta1.MetricTemplateList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched metricTemplate.
|
||||
func (c *FakeMetricTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.MetricTemplate, err error) {
|
||||
emptyResult := &v1beta1.MetricTemplate{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(metrictemplatesResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.MetricTemplate), err
|
||||
}
|
||||
|
||||
@@ -19,10 +19,10 @@ limitations under the License.
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
http "net/http"
|
||||
|
||||
v1beta1 "github.com/fluxcd/flagger/pkg/apis/flagger/v1beta1"
|
||||
"github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
flaggerv1beta1 "github.com/fluxcd/flagger/pkg/apis/flagger/v1beta1"
|
||||
scheme "github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
rest "k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
@@ -55,9 +55,7 @@ func (c *FlaggerV1beta1Client) MetricTemplates(namespace string) MetricTemplateI
|
||||
// where httpClient was generated with rest.HTTPClientFor(c).
|
||||
func NewForConfig(c *rest.Config) (*FlaggerV1beta1Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
setConfigDefaults(&config)
|
||||
httpClient, err := rest.HTTPClientFor(&config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -69,9 +67,7 @@ func NewForConfig(c *rest.Config) (*FlaggerV1beta1Client, error) {
|
||||
// Note the http client provided takes precedence over the configured transport values.
|
||||
func NewForConfigAndClient(c *rest.Config, h *http.Client) (*FlaggerV1beta1Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
setConfigDefaults(&config)
|
||||
client, err := rest.RESTClientForConfigAndClient(&config, h)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -94,17 +90,15 @@ func New(c rest.Interface) *FlaggerV1beta1Client {
|
||||
return &FlaggerV1beta1Client{c}
|
||||
}
|
||||
|
||||
func setConfigDefaults(config *rest.Config) error {
|
||||
gv := v1beta1.SchemeGroupVersion
|
||||
func setConfigDefaults(config *rest.Config) {
|
||||
gv := flaggerv1beta1.SchemeGroupVersion
|
||||
config.GroupVersion = &gv
|
||||
config.APIPath = "/apis"
|
||||
config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
|
||||
config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion()
|
||||
|
||||
if config.UserAgent == "" {
|
||||
config.UserAgent = rest.DefaultKubernetesUserAgent()
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
|
||||
@@ -19,9 +19,9 @@ limitations under the License.
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
"context"
|
||||
context "context"
|
||||
|
||||
v1beta1 "github.com/fluxcd/flagger/pkg/apis/flagger/v1beta1"
|
||||
flaggerv1beta1 "github.com/fluxcd/flagger/pkg/apis/flagger/v1beta1"
|
||||
scheme "github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
@@ -37,33 +37,34 @@ type MetricTemplatesGetter interface {
|
||||
|
||||
// MetricTemplateInterface has methods to work with MetricTemplate resources.
|
||||
type MetricTemplateInterface interface {
|
||||
Create(ctx context.Context, metricTemplate *v1beta1.MetricTemplate, opts v1.CreateOptions) (*v1beta1.MetricTemplate, error)
|
||||
Update(ctx context.Context, metricTemplate *v1beta1.MetricTemplate, opts v1.UpdateOptions) (*v1beta1.MetricTemplate, error)
|
||||
Create(ctx context.Context, metricTemplate *flaggerv1beta1.MetricTemplate, opts v1.CreateOptions) (*flaggerv1beta1.MetricTemplate, error)
|
||||
Update(ctx context.Context, metricTemplate *flaggerv1beta1.MetricTemplate, opts v1.UpdateOptions) (*flaggerv1beta1.MetricTemplate, error)
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
UpdateStatus(ctx context.Context, metricTemplate *v1beta1.MetricTemplate, opts v1.UpdateOptions) (*v1beta1.MetricTemplate, error)
|
||||
UpdateStatus(ctx context.Context, metricTemplate *flaggerv1beta1.MetricTemplate, opts v1.UpdateOptions) (*flaggerv1beta1.MetricTemplate, 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) (*v1beta1.MetricTemplate, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.MetricTemplateList, error)
|
||||
Get(ctx context.Context, name string, opts v1.GetOptions) (*flaggerv1beta1.MetricTemplate, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*flaggerv1beta1.MetricTemplateList, 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 *v1beta1.MetricTemplate, err error)
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *flaggerv1beta1.MetricTemplate, err error)
|
||||
MetricTemplateExpansion
|
||||
}
|
||||
|
||||
// metricTemplates implements MetricTemplateInterface
|
||||
type metricTemplates struct {
|
||||
*gentype.ClientWithList[*v1beta1.MetricTemplate, *v1beta1.MetricTemplateList]
|
||||
*gentype.ClientWithList[*flaggerv1beta1.MetricTemplate, *flaggerv1beta1.MetricTemplateList]
|
||||
}
|
||||
|
||||
// newMetricTemplates returns a MetricTemplates
|
||||
func newMetricTemplates(c *FlaggerV1beta1Client, namespace string) *metricTemplates {
|
||||
return &metricTemplates{
|
||||
gentype.NewClientWithList[*v1beta1.MetricTemplate, *v1beta1.MetricTemplateList](
|
||||
gentype.NewClientWithList[*flaggerv1beta1.MetricTemplate, *flaggerv1beta1.MetricTemplateList](
|
||||
"metrictemplates",
|
||||
c.RESTClient(),
|
||||
scheme.ParameterCodec,
|
||||
namespace,
|
||||
func() *v1beta1.MetricTemplate { return &v1beta1.MetricTemplate{} },
|
||||
func() *v1beta1.MetricTemplateList { return &v1beta1.MetricTemplateList{} }),
|
||||
func() *flaggerv1beta1.MetricTemplate { return &flaggerv1beta1.MetricTemplate{} },
|
||||
func() *flaggerv1beta1.MetricTemplateList { return &flaggerv1beta1.MetricTemplateList{} },
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ type FakeGatewayapiV1 struct {
|
||||
}
|
||||
|
||||
func (c *FakeGatewayapiV1) HTTPRoutes(namespace string) v1.HTTPRouteInterface {
|
||||
return &FakeHTTPRoutes{c, namespace}
|
||||
return newFakeHTTPRoutes(c, namespace)
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
|
||||
@@ -19,129 +19,30 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
v1 "github.com/fluxcd/flagger/pkg/apis/gatewayapi/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
gatewayapiv1 "github.com/fluxcd/flagger/pkg/client/clientset/versioned/typed/gatewayapi/v1"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
)
|
||||
|
||||
// FakeHTTPRoutes implements HTTPRouteInterface
|
||||
type FakeHTTPRoutes struct {
|
||||
// fakeHTTPRoutes implements HTTPRouteInterface
|
||||
type fakeHTTPRoutes struct {
|
||||
*gentype.FakeClientWithList[*v1.HTTPRoute, *v1.HTTPRouteList]
|
||||
Fake *FakeGatewayapiV1
|
||||
ns string
|
||||
}
|
||||
|
||||
var httproutesResource = v1.SchemeGroupVersion.WithResource("httproutes")
|
||||
|
||||
var httproutesKind = v1.SchemeGroupVersion.WithKind("HTTPRoute")
|
||||
|
||||
// Get takes name of the hTTPRoute, and returns the corresponding hTTPRoute object, and an error if there is any.
|
||||
func (c *FakeHTTPRoutes) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.HTTPRoute, err error) {
|
||||
emptyResult := &v1.HTTPRoute{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetActionWithOptions(httproutesResource, c.ns, name, options), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
func newFakeHTTPRoutes(fake *FakeGatewayapiV1, namespace string) gatewayapiv1.HTTPRouteInterface {
|
||||
return &fakeHTTPRoutes{
|
||||
gentype.NewFakeClientWithList[*v1.HTTPRoute, *v1.HTTPRouteList](
|
||||
fake.Fake,
|
||||
namespace,
|
||||
v1.SchemeGroupVersion.WithResource("httproutes"),
|
||||
v1.SchemeGroupVersion.WithKind("HTTPRoute"),
|
||||
func() *v1.HTTPRoute { return &v1.HTTPRoute{} },
|
||||
func() *v1.HTTPRouteList { return &v1.HTTPRouteList{} },
|
||||
func(dst, src *v1.HTTPRouteList) { dst.ListMeta = src.ListMeta },
|
||||
func(list *v1.HTTPRouteList) []*v1.HTTPRoute { return gentype.ToPointerSlice(list.Items) },
|
||||
func(list *v1.HTTPRouteList, items []*v1.HTTPRoute) { list.Items = gentype.FromPointerSlice(items) },
|
||||
),
|
||||
fake,
|
||||
}
|
||||
return obj.(*v1.HTTPRoute), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of HTTPRoutes that match those selectors.
|
||||
func (c *FakeHTTPRoutes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.HTTPRouteList, err error) {
|
||||
emptyResult := &v1.HTTPRouteList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListActionWithOptions(httproutesResource, httproutesKind, c.ns, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1.HTTPRouteList{ListMeta: obj.(*v1.HTTPRouteList).ListMeta}
|
||||
for _, item := range obj.(*v1.HTTPRouteList).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 hTTPRoutes.
|
||||
func (c *FakeHTTPRoutes) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchActionWithOptions(httproutesResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a hTTPRoute and creates it. Returns the server's representation of the hTTPRoute, and an error, if there is any.
|
||||
func (c *FakeHTTPRoutes) Create(ctx context.Context, hTTPRoute *v1.HTTPRoute, opts metav1.CreateOptions) (result *v1.HTTPRoute, err error) {
|
||||
emptyResult := &v1.HTTPRoute{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateActionWithOptions(httproutesResource, c.ns, hTTPRoute, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.HTTPRoute), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a hTTPRoute and updates it. Returns the server's representation of the hTTPRoute, and an error, if there is any.
|
||||
func (c *FakeHTTPRoutes) Update(ctx context.Context, hTTPRoute *v1.HTTPRoute, opts metav1.UpdateOptions) (result *v1.HTTPRoute, err error) {
|
||||
emptyResult := &v1.HTTPRoute{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateActionWithOptions(httproutesResource, c.ns, hTTPRoute, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.HTTPRoute), err
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
func (c *FakeHTTPRoutes) UpdateStatus(ctx context.Context, hTTPRoute *v1.HTTPRoute, opts metav1.UpdateOptions) (result *v1.HTTPRoute, err error) {
|
||||
emptyResult := &v1.HTTPRoute{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateSubresourceActionWithOptions(httproutesResource, "status", c.ns, hTTPRoute, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.HTTPRoute), err
|
||||
}
|
||||
|
||||
// Delete takes name of the hTTPRoute and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeHTTPRoutes) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteActionWithOptions(httproutesResource, c.ns, name, opts), &v1.HTTPRoute{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeHTTPRoutes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionActionWithOptions(httproutesResource, c.ns, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1.HTTPRouteList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched hTTPRoute.
|
||||
func (c *FakeHTTPRoutes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.HTTPRoute, err error) {
|
||||
emptyResult := &v1.HTTPRoute{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(httproutesResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.HTTPRoute), err
|
||||
}
|
||||
|
||||
@@ -19,10 +19,10 @@ limitations under the License.
|
||||
package v1
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
http "net/http"
|
||||
|
||||
v1 "github.com/fluxcd/flagger/pkg/apis/gatewayapi/v1"
|
||||
"github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
gatewayapiv1 "github.com/fluxcd/flagger/pkg/apis/gatewayapi/v1"
|
||||
scheme "github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
rest "k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
@@ -45,9 +45,7 @@ func (c *GatewayapiV1Client) HTTPRoutes(namespace string) HTTPRouteInterface {
|
||||
// where httpClient was generated with rest.HTTPClientFor(c).
|
||||
func NewForConfig(c *rest.Config) (*GatewayapiV1Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
setConfigDefaults(&config)
|
||||
httpClient, err := rest.HTTPClientFor(&config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -59,9 +57,7 @@ func NewForConfig(c *rest.Config) (*GatewayapiV1Client, error) {
|
||||
// Note the http client provided takes precedence over the configured transport values.
|
||||
func NewForConfigAndClient(c *rest.Config, h *http.Client) (*GatewayapiV1Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
setConfigDefaults(&config)
|
||||
client, err := rest.RESTClientForConfigAndClient(&config, h)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -84,17 +80,15 @@ func New(c rest.Interface) *GatewayapiV1Client {
|
||||
return &GatewayapiV1Client{c}
|
||||
}
|
||||
|
||||
func setConfigDefaults(config *rest.Config) error {
|
||||
gv := v1.SchemeGroupVersion
|
||||
func setConfigDefaults(config *rest.Config) {
|
||||
gv := gatewayapiv1.SchemeGroupVersion
|
||||
config.GroupVersion = &gv
|
||||
config.APIPath = "/apis"
|
||||
config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
|
||||
config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion()
|
||||
|
||||
if config.UserAgent == "" {
|
||||
config.UserAgent = rest.DefaultKubernetesUserAgent()
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
|
||||
@@ -19,9 +19,9 @@ limitations under the License.
|
||||
package v1
|
||||
|
||||
import (
|
||||
"context"
|
||||
context "context"
|
||||
|
||||
v1 "github.com/fluxcd/flagger/pkg/apis/gatewayapi/v1"
|
||||
gatewayapiv1 "github.com/fluxcd/flagger/pkg/apis/gatewayapi/v1"
|
||||
scheme "github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
@@ -37,33 +37,34 @@ type HTTPRoutesGetter interface {
|
||||
|
||||
// HTTPRouteInterface has methods to work with HTTPRoute resources.
|
||||
type HTTPRouteInterface interface {
|
||||
Create(ctx context.Context, hTTPRoute *v1.HTTPRoute, opts metav1.CreateOptions) (*v1.HTTPRoute, error)
|
||||
Update(ctx context.Context, hTTPRoute *v1.HTTPRoute, opts metav1.UpdateOptions) (*v1.HTTPRoute, error)
|
||||
Create(ctx context.Context, hTTPRoute *gatewayapiv1.HTTPRoute, opts metav1.CreateOptions) (*gatewayapiv1.HTTPRoute, error)
|
||||
Update(ctx context.Context, hTTPRoute *gatewayapiv1.HTTPRoute, opts metav1.UpdateOptions) (*gatewayapiv1.HTTPRoute, error)
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
UpdateStatus(ctx context.Context, hTTPRoute *v1.HTTPRoute, opts metav1.UpdateOptions) (*v1.HTTPRoute, error)
|
||||
UpdateStatus(ctx context.Context, hTTPRoute *gatewayapiv1.HTTPRoute, opts metav1.UpdateOptions) (*gatewayapiv1.HTTPRoute, error)
|
||||
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
|
||||
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.HTTPRoute, error)
|
||||
List(ctx context.Context, opts metav1.ListOptions) (*v1.HTTPRouteList, error)
|
||||
Get(ctx context.Context, name string, opts metav1.GetOptions) (*gatewayapiv1.HTTPRoute, error)
|
||||
List(ctx context.Context, opts metav1.ListOptions) (*gatewayapiv1.HTTPRouteList, error)
|
||||
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.HTTPRoute, err error)
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *gatewayapiv1.HTTPRoute, err error)
|
||||
HTTPRouteExpansion
|
||||
}
|
||||
|
||||
// hTTPRoutes implements HTTPRouteInterface
|
||||
type hTTPRoutes struct {
|
||||
*gentype.ClientWithList[*v1.HTTPRoute, *v1.HTTPRouteList]
|
||||
*gentype.ClientWithList[*gatewayapiv1.HTTPRoute, *gatewayapiv1.HTTPRouteList]
|
||||
}
|
||||
|
||||
// newHTTPRoutes returns a HTTPRoutes
|
||||
func newHTTPRoutes(c *GatewayapiV1Client, namespace string) *hTTPRoutes {
|
||||
return &hTTPRoutes{
|
||||
gentype.NewClientWithList[*v1.HTTPRoute, *v1.HTTPRouteList](
|
||||
gentype.NewClientWithList[*gatewayapiv1.HTTPRoute, *gatewayapiv1.HTTPRouteList](
|
||||
"httproutes",
|
||||
c.RESTClient(),
|
||||
scheme.ParameterCodec,
|
||||
namespace,
|
||||
func() *v1.HTTPRoute { return &v1.HTTPRoute{} },
|
||||
func() *v1.HTTPRouteList { return &v1.HTTPRouteList{} }),
|
||||
func() *gatewayapiv1.HTTPRoute { return &gatewayapiv1.HTTPRoute{} },
|
||||
func() *gatewayapiv1.HTTPRouteList { return &gatewayapiv1.HTTPRouteList{} },
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ type FakeGatewayapiV1beta1 struct {
|
||||
}
|
||||
|
||||
func (c *FakeGatewayapiV1beta1) HTTPRoutes(namespace string) v1beta1.HTTPRouteInterface {
|
||||
return &FakeHTTPRoutes{c, namespace}
|
||||
return newFakeHTTPRoutes(c, namespace)
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
|
||||
@@ -19,129 +19,32 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
v1beta1 "github.com/fluxcd/flagger/pkg/apis/gatewayapi/v1beta1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
gatewayapiv1beta1 "github.com/fluxcd/flagger/pkg/client/clientset/versioned/typed/gatewayapi/v1beta1"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
)
|
||||
|
||||
// FakeHTTPRoutes implements HTTPRouteInterface
|
||||
type FakeHTTPRoutes struct {
|
||||
// fakeHTTPRoutes implements HTTPRouteInterface
|
||||
type fakeHTTPRoutes struct {
|
||||
*gentype.FakeClientWithList[*v1beta1.HTTPRoute, *v1beta1.HTTPRouteList]
|
||||
Fake *FakeGatewayapiV1beta1
|
||||
ns string
|
||||
}
|
||||
|
||||
var httproutesResource = v1beta1.SchemeGroupVersion.WithResource("httproutes")
|
||||
|
||||
var httproutesKind = v1beta1.SchemeGroupVersion.WithKind("HTTPRoute")
|
||||
|
||||
// Get takes name of the hTTPRoute, and returns the corresponding hTTPRoute object, and an error if there is any.
|
||||
func (c *FakeHTTPRoutes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.HTTPRoute, err error) {
|
||||
emptyResult := &v1beta1.HTTPRoute{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetActionWithOptions(httproutesResource, c.ns, name, options), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
func newFakeHTTPRoutes(fake *FakeGatewayapiV1beta1, namespace string) gatewayapiv1beta1.HTTPRouteInterface {
|
||||
return &fakeHTTPRoutes{
|
||||
gentype.NewFakeClientWithList[*v1beta1.HTTPRoute, *v1beta1.HTTPRouteList](
|
||||
fake.Fake,
|
||||
namespace,
|
||||
v1beta1.SchemeGroupVersion.WithResource("httproutes"),
|
||||
v1beta1.SchemeGroupVersion.WithKind("HTTPRoute"),
|
||||
func() *v1beta1.HTTPRoute { return &v1beta1.HTTPRoute{} },
|
||||
func() *v1beta1.HTTPRouteList { return &v1beta1.HTTPRouteList{} },
|
||||
func(dst, src *v1beta1.HTTPRouteList) { dst.ListMeta = src.ListMeta },
|
||||
func(list *v1beta1.HTTPRouteList) []*v1beta1.HTTPRoute { return gentype.ToPointerSlice(list.Items) },
|
||||
func(list *v1beta1.HTTPRouteList, items []*v1beta1.HTTPRoute) {
|
||||
list.Items = gentype.FromPointerSlice(items)
|
||||
},
|
||||
),
|
||||
fake,
|
||||
}
|
||||
return obj.(*v1beta1.HTTPRoute), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of HTTPRoutes that match those selectors.
|
||||
func (c *FakeHTTPRoutes) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.HTTPRouteList, err error) {
|
||||
emptyResult := &v1beta1.HTTPRouteList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListActionWithOptions(httproutesResource, httproutesKind, c.ns, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1beta1.HTTPRouteList{ListMeta: obj.(*v1beta1.HTTPRouteList).ListMeta}
|
||||
for _, item := range obj.(*v1beta1.HTTPRouteList).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 hTTPRoutes.
|
||||
func (c *FakeHTTPRoutes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchActionWithOptions(httproutesResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a hTTPRoute and creates it. Returns the server's representation of the hTTPRoute, and an error, if there is any.
|
||||
func (c *FakeHTTPRoutes) Create(ctx context.Context, hTTPRoute *v1beta1.HTTPRoute, opts v1.CreateOptions) (result *v1beta1.HTTPRoute, err error) {
|
||||
emptyResult := &v1beta1.HTTPRoute{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateActionWithOptions(httproutesResource, c.ns, hTTPRoute, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.HTTPRoute), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a hTTPRoute and updates it. Returns the server's representation of the hTTPRoute, and an error, if there is any.
|
||||
func (c *FakeHTTPRoutes) Update(ctx context.Context, hTTPRoute *v1beta1.HTTPRoute, opts v1.UpdateOptions) (result *v1beta1.HTTPRoute, err error) {
|
||||
emptyResult := &v1beta1.HTTPRoute{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateActionWithOptions(httproutesResource, c.ns, hTTPRoute, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.HTTPRoute), err
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
func (c *FakeHTTPRoutes) UpdateStatus(ctx context.Context, hTTPRoute *v1beta1.HTTPRoute, opts v1.UpdateOptions) (result *v1beta1.HTTPRoute, err error) {
|
||||
emptyResult := &v1beta1.HTTPRoute{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateSubresourceActionWithOptions(httproutesResource, "status", c.ns, hTTPRoute, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.HTTPRoute), err
|
||||
}
|
||||
|
||||
// Delete takes name of the hTTPRoute and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeHTTPRoutes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteActionWithOptions(httproutesResource, c.ns, name, opts), &v1beta1.HTTPRoute{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeHTTPRoutes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionActionWithOptions(httproutesResource, c.ns, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1beta1.HTTPRouteList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched hTTPRoute.
|
||||
func (c *FakeHTTPRoutes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.HTTPRoute, err error) {
|
||||
emptyResult := &v1beta1.HTTPRoute{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(httproutesResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.HTTPRoute), err
|
||||
}
|
||||
|
||||
@@ -19,10 +19,10 @@ limitations under the License.
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
http "net/http"
|
||||
|
||||
v1beta1 "github.com/fluxcd/flagger/pkg/apis/gatewayapi/v1beta1"
|
||||
"github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
gatewayapiv1beta1 "github.com/fluxcd/flagger/pkg/apis/gatewayapi/v1beta1"
|
||||
scheme "github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
rest "k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
@@ -45,9 +45,7 @@ func (c *GatewayapiV1beta1Client) HTTPRoutes(namespace string) HTTPRouteInterfac
|
||||
// where httpClient was generated with rest.HTTPClientFor(c).
|
||||
func NewForConfig(c *rest.Config) (*GatewayapiV1beta1Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
setConfigDefaults(&config)
|
||||
httpClient, err := rest.HTTPClientFor(&config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -59,9 +57,7 @@ func NewForConfig(c *rest.Config) (*GatewayapiV1beta1Client, error) {
|
||||
// Note the http client provided takes precedence over the configured transport values.
|
||||
func NewForConfigAndClient(c *rest.Config, h *http.Client) (*GatewayapiV1beta1Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
setConfigDefaults(&config)
|
||||
client, err := rest.RESTClientForConfigAndClient(&config, h)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -84,17 +80,15 @@ func New(c rest.Interface) *GatewayapiV1beta1Client {
|
||||
return &GatewayapiV1beta1Client{c}
|
||||
}
|
||||
|
||||
func setConfigDefaults(config *rest.Config) error {
|
||||
gv := v1beta1.SchemeGroupVersion
|
||||
func setConfigDefaults(config *rest.Config) {
|
||||
gv := gatewayapiv1beta1.SchemeGroupVersion
|
||||
config.GroupVersion = &gv
|
||||
config.APIPath = "/apis"
|
||||
config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
|
||||
config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion()
|
||||
|
||||
if config.UserAgent == "" {
|
||||
config.UserAgent = rest.DefaultKubernetesUserAgent()
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
|
||||
@@ -19,9 +19,9 @@ limitations under the License.
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
"context"
|
||||
context "context"
|
||||
|
||||
v1beta1 "github.com/fluxcd/flagger/pkg/apis/gatewayapi/v1beta1"
|
||||
gatewayapiv1beta1 "github.com/fluxcd/flagger/pkg/apis/gatewayapi/v1beta1"
|
||||
scheme "github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
@@ -37,33 +37,34 @@ type HTTPRoutesGetter interface {
|
||||
|
||||
// HTTPRouteInterface has methods to work with HTTPRoute resources.
|
||||
type HTTPRouteInterface interface {
|
||||
Create(ctx context.Context, hTTPRoute *v1beta1.HTTPRoute, opts v1.CreateOptions) (*v1beta1.HTTPRoute, error)
|
||||
Update(ctx context.Context, hTTPRoute *v1beta1.HTTPRoute, opts v1.UpdateOptions) (*v1beta1.HTTPRoute, error)
|
||||
Create(ctx context.Context, hTTPRoute *gatewayapiv1beta1.HTTPRoute, opts v1.CreateOptions) (*gatewayapiv1beta1.HTTPRoute, error)
|
||||
Update(ctx context.Context, hTTPRoute *gatewayapiv1beta1.HTTPRoute, opts v1.UpdateOptions) (*gatewayapiv1beta1.HTTPRoute, error)
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
UpdateStatus(ctx context.Context, hTTPRoute *v1beta1.HTTPRoute, opts v1.UpdateOptions) (*v1beta1.HTTPRoute, error)
|
||||
UpdateStatus(ctx context.Context, hTTPRoute *gatewayapiv1beta1.HTTPRoute, opts v1.UpdateOptions) (*gatewayapiv1beta1.HTTPRoute, 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) (*v1beta1.HTTPRoute, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.HTTPRouteList, error)
|
||||
Get(ctx context.Context, name string, opts v1.GetOptions) (*gatewayapiv1beta1.HTTPRoute, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*gatewayapiv1beta1.HTTPRouteList, 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 *v1beta1.HTTPRoute, err error)
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *gatewayapiv1beta1.HTTPRoute, err error)
|
||||
HTTPRouteExpansion
|
||||
}
|
||||
|
||||
// hTTPRoutes implements HTTPRouteInterface
|
||||
type hTTPRoutes struct {
|
||||
*gentype.ClientWithList[*v1beta1.HTTPRoute, *v1beta1.HTTPRouteList]
|
||||
*gentype.ClientWithList[*gatewayapiv1beta1.HTTPRoute, *gatewayapiv1beta1.HTTPRouteList]
|
||||
}
|
||||
|
||||
// newHTTPRoutes returns a HTTPRoutes
|
||||
func newHTTPRoutes(c *GatewayapiV1beta1Client, namespace string) *hTTPRoutes {
|
||||
return &hTTPRoutes{
|
||||
gentype.NewClientWithList[*v1beta1.HTTPRoute, *v1beta1.HTTPRouteList](
|
||||
gentype.NewClientWithList[*gatewayapiv1beta1.HTTPRoute, *gatewayapiv1beta1.HTTPRouteList](
|
||||
"httproutes",
|
||||
c.RESTClient(),
|
||||
scheme.ParameterCodec,
|
||||
namespace,
|
||||
func() *v1beta1.HTTPRoute { return &v1beta1.HTTPRoute{} },
|
||||
func() *v1beta1.HTTPRouteList { return &v1beta1.HTTPRouteList{} }),
|
||||
func() *gatewayapiv1beta1.HTTPRoute { return &gatewayapiv1beta1.HTTPRoute{} },
|
||||
func() *gatewayapiv1beta1.HTTPRouteList { return &gatewayapiv1beta1.HTTPRouteList{} },
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ type FakeGlooV1 struct {
|
||||
}
|
||||
|
||||
func (c *FakeGlooV1) Upstreams(namespace string) v1.UpstreamInterface {
|
||||
return &FakeUpstreams{c, namespace}
|
||||
return newFakeUpstreams(c, namespace)
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
|
||||
@@ -19,116 +19,30 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
v1 "github.com/fluxcd/flagger/pkg/apis/gloo/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
gloov1 "github.com/fluxcd/flagger/pkg/client/clientset/versioned/typed/gloo/v1"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
)
|
||||
|
||||
// FakeUpstreams implements UpstreamInterface
|
||||
type FakeUpstreams struct {
|
||||
// fakeUpstreams implements UpstreamInterface
|
||||
type fakeUpstreams struct {
|
||||
*gentype.FakeClientWithList[*v1.Upstream, *v1.UpstreamList]
|
||||
Fake *FakeGlooV1
|
||||
ns string
|
||||
}
|
||||
|
||||
var upstreamsResource = v1.SchemeGroupVersion.WithResource("upstreams")
|
||||
|
||||
var upstreamsKind = v1.SchemeGroupVersion.WithKind("Upstream")
|
||||
|
||||
// Get takes name of the upstream, and returns the corresponding upstream object, and an error if there is any.
|
||||
func (c *FakeUpstreams) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Upstream, err error) {
|
||||
emptyResult := &v1.Upstream{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetActionWithOptions(upstreamsResource, c.ns, name, options), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
func newFakeUpstreams(fake *FakeGlooV1, namespace string) gloov1.UpstreamInterface {
|
||||
return &fakeUpstreams{
|
||||
gentype.NewFakeClientWithList[*v1.Upstream, *v1.UpstreamList](
|
||||
fake.Fake,
|
||||
namespace,
|
||||
v1.SchemeGroupVersion.WithResource("upstreams"),
|
||||
v1.SchemeGroupVersion.WithKind("Upstream"),
|
||||
func() *v1.Upstream { return &v1.Upstream{} },
|
||||
func() *v1.UpstreamList { return &v1.UpstreamList{} },
|
||||
func(dst, src *v1.UpstreamList) { dst.ListMeta = src.ListMeta },
|
||||
func(list *v1.UpstreamList) []*v1.Upstream { return gentype.ToPointerSlice(list.Items) },
|
||||
func(list *v1.UpstreamList, items []*v1.Upstream) { list.Items = gentype.FromPointerSlice(items) },
|
||||
),
|
||||
fake,
|
||||
}
|
||||
return obj.(*v1.Upstream), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of Upstreams that match those selectors.
|
||||
func (c *FakeUpstreams) List(ctx context.Context, opts metav1.ListOptions) (result *v1.UpstreamList, err error) {
|
||||
emptyResult := &v1.UpstreamList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListActionWithOptions(upstreamsResource, upstreamsKind, c.ns, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1.UpstreamList{ListMeta: obj.(*v1.UpstreamList).ListMeta}
|
||||
for _, item := range obj.(*v1.UpstreamList).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 upstreams.
|
||||
func (c *FakeUpstreams) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchActionWithOptions(upstreamsResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a upstream and creates it. Returns the server's representation of the upstream, and an error, if there is any.
|
||||
func (c *FakeUpstreams) Create(ctx context.Context, upstream *v1.Upstream, opts metav1.CreateOptions) (result *v1.Upstream, err error) {
|
||||
emptyResult := &v1.Upstream{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateActionWithOptions(upstreamsResource, c.ns, upstream, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.Upstream), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a upstream and updates it. Returns the server's representation of the upstream, and an error, if there is any.
|
||||
func (c *FakeUpstreams) Update(ctx context.Context, upstream *v1.Upstream, opts metav1.UpdateOptions) (result *v1.Upstream, err error) {
|
||||
emptyResult := &v1.Upstream{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateActionWithOptions(upstreamsResource, c.ns, upstream, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.Upstream), err
|
||||
}
|
||||
|
||||
// Delete takes name of the upstream and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeUpstreams) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteActionWithOptions(upstreamsResource, c.ns, name, opts), &v1.Upstream{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeUpstreams) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionActionWithOptions(upstreamsResource, c.ns, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1.UpstreamList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched upstream.
|
||||
func (c *FakeUpstreams) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Upstream, err error) {
|
||||
emptyResult := &v1.Upstream{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(upstreamsResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.Upstream), err
|
||||
}
|
||||
|
||||
@@ -19,10 +19,10 @@ limitations under the License.
|
||||
package v1
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
http "net/http"
|
||||
|
||||
v1 "github.com/fluxcd/flagger/pkg/apis/gloo/v1"
|
||||
"github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
gloov1 "github.com/fluxcd/flagger/pkg/apis/gloo/v1"
|
||||
scheme "github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
rest "k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
@@ -45,9 +45,7 @@ func (c *GlooV1Client) Upstreams(namespace string) UpstreamInterface {
|
||||
// where httpClient was generated with rest.HTTPClientFor(c).
|
||||
func NewForConfig(c *rest.Config) (*GlooV1Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
setConfigDefaults(&config)
|
||||
httpClient, err := rest.HTTPClientFor(&config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -59,9 +57,7 @@ func NewForConfig(c *rest.Config) (*GlooV1Client, error) {
|
||||
// Note the http client provided takes precedence over the configured transport values.
|
||||
func NewForConfigAndClient(c *rest.Config, h *http.Client) (*GlooV1Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
setConfigDefaults(&config)
|
||||
client, err := rest.RESTClientForConfigAndClient(&config, h)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -84,17 +80,15 @@ func New(c rest.Interface) *GlooV1Client {
|
||||
return &GlooV1Client{c}
|
||||
}
|
||||
|
||||
func setConfigDefaults(config *rest.Config) error {
|
||||
gv := v1.SchemeGroupVersion
|
||||
func setConfigDefaults(config *rest.Config) {
|
||||
gv := gloov1.SchemeGroupVersion
|
||||
config.GroupVersion = &gv
|
||||
config.APIPath = "/apis"
|
||||
config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
|
||||
config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion()
|
||||
|
||||
if config.UserAgent == "" {
|
||||
config.UserAgent = rest.DefaultKubernetesUserAgent()
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
|
||||
@@ -19,9 +19,9 @@ limitations under the License.
|
||||
package v1
|
||||
|
||||
import (
|
||||
"context"
|
||||
context "context"
|
||||
|
||||
v1 "github.com/fluxcd/flagger/pkg/apis/gloo/v1"
|
||||
gloov1 "github.com/fluxcd/flagger/pkg/apis/gloo/v1"
|
||||
scheme "github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
@@ -37,31 +37,32 @@ type UpstreamsGetter interface {
|
||||
|
||||
// UpstreamInterface has methods to work with Upstream resources.
|
||||
type UpstreamInterface interface {
|
||||
Create(ctx context.Context, upstream *v1.Upstream, opts metav1.CreateOptions) (*v1.Upstream, error)
|
||||
Update(ctx context.Context, upstream *v1.Upstream, opts metav1.UpdateOptions) (*v1.Upstream, error)
|
||||
Create(ctx context.Context, upstream *gloov1.Upstream, opts metav1.CreateOptions) (*gloov1.Upstream, error)
|
||||
Update(ctx context.Context, upstream *gloov1.Upstream, opts metav1.UpdateOptions) (*gloov1.Upstream, error)
|
||||
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
|
||||
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Upstream, error)
|
||||
List(ctx context.Context, opts metav1.ListOptions) (*v1.UpstreamList, error)
|
||||
Get(ctx context.Context, name string, opts metav1.GetOptions) (*gloov1.Upstream, error)
|
||||
List(ctx context.Context, opts metav1.ListOptions) (*gloov1.UpstreamList, error)
|
||||
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Upstream, err error)
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *gloov1.Upstream, err error)
|
||||
UpstreamExpansion
|
||||
}
|
||||
|
||||
// upstreams implements UpstreamInterface
|
||||
type upstreams struct {
|
||||
*gentype.ClientWithList[*v1.Upstream, *v1.UpstreamList]
|
||||
*gentype.ClientWithList[*gloov1.Upstream, *gloov1.UpstreamList]
|
||||
}
|
||||
|
||||
// newUpstreams returns a Upstreams
|
||||
func newUpstreams(c *GlooV1Client, namespace string) *upstreams {
|
||||
return &upstreams{
|
||||
gentype.NewClientWithList[*v1.Upstream, *v1.UpstreamList](
|
||||
gentype.NewClientWithList[*gloov1.Upstream, *gloov1.UpstreamList](
|
||||
"upstreams",
|
||||
c.RESTClient(),
|
||||
scheme.ParameterCodec,
|
||||
namespace,
|
||||
func() *v1.Upstream { return &v1.Upstream{} },
|
||||
func() *v1.UpstreamList { return &v1.UpstreamList{} }),
|
||||
func() *gloov1.Upstream { return &gloov1.Upstream{} },
|
||||
func() *gloov1.UpstreamList { return &gloov1.UpstreamList{} },
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ type FakeGatewayV1 struct {
|
||||
}
|
||||
|
||||
func (c *FakeGatewayV1) RouteTables(namespace string) v1.RouteTableInterface {
|
||||
return &FakeRouteTables{c, namespace}
|
||||
return newFakeRouteTables(c, namespace)
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
|
||||
@@ -19,116 +19,30 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
v1 "github.com/fluxcd/flagger/pkg/apis/gloogateway/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
gloogatewayv1 "github.com/fluxcd/flagger/pkg/client/clientset/versioned/typed/gloogateway/v1"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
)
|
||||
|
||||
// FakeRouteTables implements RouteTableInterface
|
||||
type FakeRouteTables struct {
|
||||
// fakeRouteTables implements RouteTableInterface
|
||||
type fakeRouteTables struct {
|
||||
*gentype.FakeClientWithList[*v1.RouteTable, *v1.RouteTableList]
|
||||
Fake *FakeGatewayV1
|
||||
ns string
|
||||
}
|
||||
|
||||
var routetablesResource = v1.SchemeGroupVersion.WithResource("routetables")
|
||||
|
||||
var routetablesKind = v1.SchemeGroupVersion.WithKind("RouteTable")
|
||||
|
||||
// Get takes name of the routeTable, and returns the corresponding routeTable object, and an error if there is any.
|
||||
func (c *FakeRouteTables) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.RouteTable, err error) {
|
||||
emptyResult := &v1.RouteTable{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetActionWithOptions(routetablesResource, c.ns, name, options), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
func newFakeRouteTables(fake *FakeGatewayV1, namespace string) gloogatewayv1.RouteTableInterface {
|
||||
return &fakeRouteTables{
|
||||
gentype.NewFakeClientWithList[*v1.RouteTable, *v1.RouteTableList](
|
||||
fake.Fake,
|
||||
namespace,
|
||||
v1.SchemeGroupVersion.WithResource("routetables"),
|
||||
v1.SchemeGroupVersion.WithKind("RouteTable"),
|
||||
func() *v1.RouteTable { return &v1.RouteTable{} },
|
||||
func() *v1.RouteTableList { return &v1.RouteTableList{} },
|
||||
func(dst, src *v1.RouteTableList) { dst.ListMeta = src.ListMeta },
|
||||
func(list *v1.RouteTableList) []*v1.RouteTable { return gentype.ToPointerSlice(list.Items) },
|
||||
func(list *v1.RouteTableList, items []*v1.RouteTable) { list.Items = gentype.FromPointerSlice(items) },
|
||||
),
|
||||
fake,
|
||||
}
|
||||
return obj.(*v1.RouteTable), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of RouteTables that match those selectors.
|
||||
func (c *FakeRouteTables) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RouteTableList, err error) {
|
||||
emptyResult := &v1.RouteTableList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListActionWithOptions(routetablesResource, routetablesKind, c.ns, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1.RouteTableList{ListMeta: obj.(*v1.RouteTableList).ListMeta}
|
||||
for _, item := range obj.(*v1.RouteTableList).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 routeTables.
|
||||
func (c *FakeRouteTables) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchActionWithOptions(routetablesResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a routeTable and creates it. Returns the server's representation of the routeTable, and an error, if there is any.
|
||||
func (c *FakeRouteTables) Create(ctx context.Context, routeTable *v1.RouteTable, opts metav1.CreateOptions) (result *v1.RouteTable, err error) {
|
||||
emptyResult := &v1.RouteTable{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateActionWithOptions(routetablesResource, c.ns, routeTable, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.RouteTable), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a routeTable and updates it. Returns the server's representation of the routeTable, and an error, if there is any.
|
||||
func (c *FakeRouteTables) Update(ctx context.Context, routeTable *v1.RouteTable, opts metav1.UpdateOptions) (result *v1.RouteTable, err error) {
|
||||
emptyResult := &v1.RouteTable{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateActionWithOptions(routetablesResource, c.ns, routeTable, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.RouteTable), err
|
||||
}
|
||||
|
||||
// Delete takes name of the routeTable and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeRouteTables) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteActionWithOptions(routetablesResource, c.ns, name, opts), &v1.RouteTable{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeRouteTables) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionActionWithOptions(routetablesResource, c.ns, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1.RouteTableList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched routeTable.
|
||||
func (c *FakeRouteTables) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.RouteTable, err error) {
|
||||
emptyResult := &v1.RouteTable{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(routetablesResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.RouteTable), err
|
||||
}
|
||||
|
||||
@@ -19,10 +19,10 @@ limitations under the License.
|
||||
package v1
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
http "net/http"
|
||||
|
||||
v1 "github.com/fluxcd/flagger/pkg/apis/gloogateway/v1"
|
||||
"github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
gloogatewayv1 "github.com/fluxcd/flagger/pkg/apis/gloogateway/v1"
|
||||
scheme "github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
rest "k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
@@ -45,9 +45,7 @@ func (c *GatewayV1Client) RouteTables(namespace string) RouteTableInterface {
|
||||
// where httpClient was generated with rest.HTTPClientFor(c).
|
||||
func NewForConfig(c *rest.Config) (*GatewayV1Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
setConfigDefaults(&config)
|
||||
httpClient, err := rest.HTTPClientFor(&config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -59,9 +57,7 @@ func NewForConfig(c *rest.Config) (*GatewayV1Client, error) {
|
||||
// Note the http client provided takes precedence over the configured transport values.
|
||||
func NewForConfigAndClient(c *rest.Config, h *http.Client) (*GatewayV1Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
setConfigDefaults(&config)
|
||||
client, err := rest.RESTClientForConfigAndClient(&config, h)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -84,17 +80,15 @@ func New(c rest.Interface) *GatewayV1Client {
|
||||
return &GatewayV1Client{c}
|
||||
}
|
||||
|
||||
func setConfigDefaults(config *rest.Config) error {
|
||||
gv := v1.SchemeGroupVersion
|
||||
func setConfigDefaults(config *rest.Config) {
|
||||
gv := gloogatewayv1.SchemeGroupVersion
|
||||
config.GroupVersion = &gv
|
||||
config.APIPath = "/apis"
|
||||
config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
|
||||
config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion()
|
||||
|
||||
if config.UserAgent == "" {
|
||||
config.UserAgent = rest.DefaultKubernetesUserAgent()
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
|
||||
@@ -19,9 +19,9 @@ limitations under the License.
|
||||
package v1
|
||||
|
||||
import (
|
||||
"context"
|
||||
context "context"
|
||||
|
||||
v1 "github.com/fluxcd/flagger/pkg/apis/gloogateway/v1"
|
||||
gloogatewayv1 "github.com/fluxcd/flagger/pkg/apis/gloogateway/v1"
|
||||
scheme "github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
@@ -37,31 +37,32 @@ type RouteTablesGetter interface {
|
||||
|
||||
// RouteTableInterface has methods to work with RouteTable resources.
|
||||
type RouteTableInterface interface {
|
||||
Create(ctx context.Context, routeTable *v1.RouteTable, opts metav1.CreateOptions) (*v1.RouteTable, error)
|
||||
Update(ctx context.Context, routeTable *v1.RouteTable, opts metav1.UpdateOptions) (*v1.RouteTable, error)
|
||||
Create(ctx context.Context, routeTable *gloogatewayv1.RouteTable, opts metav1.CreateOptions) (*gloogatewayv1.RouteTable, error)
|
||||
Update(ctx context.Context, routeTable *gloogatewayv1.RouteTable, opts metav1.UpdateOptions) (*gloogatewayv1.RouteTable, error)
|
||||
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
|
||||
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.RouteTable, error)
|
||||
List(ctx context.Context, opts metav1.ListOptions) (*v1.RouteTableList, error)
|
||||
Get(ctx context.Context, name string, opts metav1.GetOptions) (*gloogatewayv1.RouteTable, error)
|
||||
List(ctx context.Context, opts metav1.ListOptions) (*gloogatewayv1.RouteTableList, error)
|
||||
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.RouteTable, err error)
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *gloogatewayv1.RouteTable, err error)
|
||||
RouteTableExpansion
|
||||
}
|
||||
|
||||
// routeTables implements RouteTableInterface
|
||||
type routeTables struct {
|
||||
*gentype.ClientWithList[*v1.RouteTable, *v1.RouteTableList]
|
||||
*gentype.ClientWithList[*gloogatewayv1.RouteTable, *gloogatewayv1.RouteTableList]
|
||||
}
|
||||
|
||||
// newRouteTables returns a RouteTables
|
||||
func newRouteTables(c *GatewayV1Client, namespace string) *routeTables {
|
||||
return &routeTables{
|
||||
gentype.NewClientWithList[*v1.RouteTable, *v1.RouteTableList](
|
||||
gentype.NewClientWithList[*gloogatewayv1.RouteTable, *gloogatewayv1.RouteTableList](
|
||||
"routetables",
|
||||
c.RESTClient(),
|
||||
scheme.ParameterCodec,
|
||||
namespace,
|
||||
func() *v1.RouteTable { return &v1.RouteTable{} },
|
||||
func() *v1.RouteTableList { return &v1.RouteTableList{} }),
|
||||
func() *gloogatewayv1.RouteTable { return &gloogatewayv1.RouteTable{} },
|
||||
func() *gloogatewayv1.RouteTableList { return &gloogatewayv1.RouteTableList{} },
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,9 +19,9 @@ limitations under the License.
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
"context"
|
||||
context "context"
|
||||
|
||||
v1beta1 "github.com/fluxcd/flagger/pkg/apis/istio/v1beta1"
|
||||
istiov1beta1 "github.com/fluxcd/flagger/pkg/apis/istio/v1beta1"
|
||||
scheme "github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
@@ -37,31 +37,32 @@ type DestinationRulesGetter interface {
|
||||
|
||||
// DestinationRuleInterface has methods to work with DestinationRule resources.
|
||||
type DestinationRuleInterface interface {
|
||||
Create(ctx context.Context, destinationRule *v1beta1.DestinationRule, opts v1.CreateOptions) (*v1beta1.DestinationRule, error)
|
||||
Update(ctx context.Context, destinationRule *v1beta1.DestinationRule, opts v1.UpdateOptions) (*v1beta1.DestinationRule, error)
|
||||
Create(ctx context.Context, destinationRule *istiov1beta1.DestinationRule, opts v1.CreateOptions) (*istiov1beta1.DestinationRule, error)
|
||||
Update(ctx context.Context, destinationRule *istiov1beta1.DestinationRule, opts v1.UpdateOptions) (*istiov1beta1.DestinationRule, 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) (*v1beta1.DestinationRule, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.DestinationRuleList, error)
|
||||
Get(ctx context.Context, name string, opts v1.GetOptions) (*istiov1beta1.DestinationRule, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*istiov1beta1.DestinationRuleList, 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 *v1beta1.DestinationRule, err error)
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *istiov1beta1.DestinationRule, err error)
|
||||
DestinationRuleExpansion
|
||||
}
|
||||
|
||||
// destinationRules implements DestinationRuleInterface
|
||||
type destinationRules struct {
|
||||
*gentype.ClientWithList[*v1beta1.DestinationRule, *v1beta1.DestinationRuleList]
|
||||
*gentype.ClientWithList[*istiov1beta1.DestinationRule, *istiov1beta1.DestinationRuleList]
|
||||
}
|
||||
|
||||
// newDestinationRules returns a DestinationRules
|
||||
func newDestinationRules(c *NetworkingV1beta1Client, namespace string) *destinationRules {
|
||||
return &destinationRules{
|
||||
gentype.NewClientWithList[*v1beta1.DestinationRule, *v1beta1.DestinationRuleList](
|
||||
gentype.NewClientWithList[*istiov1beta1.DestinationRule, *istiov1beta1.DestinationRuleList](
|
||||
"destinationrules",
|
||||
c.RESTClient(),
|
||||
scheme.ParameterCodec,
|
||||
namespace,
|
||||
func() *v1beta1.DestinationRule { return &v1beta1.DestinationRule{} },
|
||||
func() *v1beta1.DestinationRuleList { return &v1beta1.DestinationRuleList{} }),
|
||||
func() *istiov1beta1.DestinationRule { return &istiov1beta1.DestinationRule{} },
|
||||
func() *istiov1beta1.DestinationRuleList { return &istiov1beta1.DestinationRuleList{} },
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,116 +19,34 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
v1beta1 "github.com/fluxcd/flagger/pkg/apis/istio/v1beta1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
istiov1beta1 "github.com/fluxcd/flagger/pkg/client/clientset/versioned/typed/istio/v1beta1"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
)
|
||||
|
||||
// FakeDestinationRules implements DestinationRuleInterface
|
||||
type FakeDestinationRules struct {
|
||||
// fakeDestinationRules implements DestinationRuleInterface
|
||||
type fakeDestinationRules struct {
|
||||
*gentype.FakeClientWithList[*v1beta1.DestinationRule, *v1beta1.DestinationRuleList]
|
||||
Fake *FakeNetworkingV1beta1
|
||||
ns string
|
||||
}
|
||||
|
||||
var destinationrulesResource = v1beta1.SchemeGroupVersion.WithResource("destinationrules")
|
||||
|
||||
var destinationrulesKind = v1beta1.SchemeGroupVersion.WithKind("DestinationRule")
|
||||
|
||||
// Get takes name of the destinationRule, and returns the corresponding destinationRule object, and an error if there is any.
|
||||
func (c *FakeDestinationRules) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.DestinationRule, err error) {
|
||||
emptyResult := &v1beta1.DestinationRule{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetActionWithOptions(destinationrulesResource, c.ns, name, options), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
func newFakeDestinationRules(fake *FakeNetworkingV1beta1, namespace string) istiov1beta1.DestinationRuleInterface {
|
||||
return &fakeDestinationRules{
|
||||
gentype.NewFakeClientWithList[*v1beta1.DestinationRule, *v1beta1.DestinationRuleList](
|
||||
fake.Fake,
|
||||
namespace,
|
||||
v1beta1.SchemeGroupVersion.WithResource("destinationrules"),
|
||||
v1beta1.SchemeGroupVersion.WithKind("DestinationRule"),
|
||||
func() *v1beta1.DestinationRule { return &v1beta1.DestinationRule{} },
|
||||
func() *v1beta1.DestinationRuleList { return &v1beta1.DestinationRuleList{} },
|
||||
func(dst, src *v1beta1.DestinationRuleList) { dst.ListMeta = src.ListMeta },
|
||||
func(list *v1beta1.DestinationRuleList) []*v1beta1.DestinationRule {
|
||||
return gentype.ToPointerSlice(list.Items)
|
||||
},
|
||||
func(list *v1beta1.DestinationRuleList, items []*v1beta1.DestinationRule) {
|
||||
list.Items = gentype.FromPointerSlice(items)
|
||||
},
|
||||
),
|
||||
fake,
|
||||
}
|
||||
return obj.(*v1beta1.DestinationRule), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of DestinationRules that match those selectors.
|
||||
func (c *FakeDestinationRules) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.DestinationRuleList, err error) {
|
||||
emptyResult := &v1beta1.DestinationRuleList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListActionWithOptions(destinationrulesResource, destinationrulesKind, c.ns, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1beta1.DestinationRuleList{ListMeta: obj.(*v1beta1.DestinationRuleList).ListMeta}
|
||||
for _, item := range obj.(*v1beta1.DestinationRuleList).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 destinationRules.
|
||||
func (c *FakeDestinationRules) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchActionWithOptions(destinationrulesResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a destinationRule and creates it. Returns the server's representation of the destinationRule, and an error, if there is any.
|
||||
func (c *FakeDestinationRules) Create(ctx context.Context, destinationRule *v1beta1.DestinationRule, opts v1.CreateOptions) (result *v1beta1.DestinationRule, err error) {
|
||||
emptyResult := &v1beta1.DestinationRule{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateActionWithOptions(destinationrulesResource, c.ns, destinationRule, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.DestinationRule), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a destinationRule and updates it. Returns the server's representation of the destinationRule, and an error, if there is any.
|
||||
func (c *FakeDestinationRules) Update(ctx context.Context, destinationRule *v1beta1.DestinationRule, opts v1.UpdateOptions) (result *v1beta1.DestinationRule, err error) {
|
||||
emptyResult := &v1beta1.DestinationRule{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateActionWithOptions(destinationrulesResource, c.ns, destinationRule, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.DestinationRule), err
|
||||
}
|
||||
|
||||
// Delete takes name of the destinationRule and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeDestinationRules) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteActionWithOptions(destinationrulesResource, c.ns, name, opts), &v1beta1.DestinationRule{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeDestinationRules) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionActionWithOptions(destinationrulesResource, c.ns, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1beta1.DestinationRuleList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched destinationRule.
|
||||
func (c *FakeDestinationRules) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.DestinationRule, err error) {
|
||||
emptyResult := &v1beta1.DestinationRule{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(destinationrulesResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.DestinationRule), err
|
||||
}
|
||||
|
||||
@@ -29,11 +29,11 @@ type FakeNetworkingV1beta1 struct {
|
||||
}
|
||||
|
||||
func (c *FakeNetworkingV1beta1) DestinationRules(namespace string) v1beta1.DestinationRuleInterface {
|
||||
return &FakeDestinationRules{c, namespace}
|
||||
return newFakeDestinationRules(c, namespace)
|
||||
}
|
||||
|
||||
func (c *FakeNetworkingV1beta1) VirtualServices(namespace string) v1beta1.VirtualServiceInterface {
|
||||
return &FakeVirtualServices{c, namespace}
|
||||
return newFakeVirtualServices(c, namespace)
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
|
||||
@@ -19,116 +19,34 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
v1beta1 "github.com/fluxcd/flagger/pkg/apis/istio/v1beta1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
istiov1beta1 "github.com/fluxcd/flagger/pkg/client/clientset/versioned/typed/istio/v1beta1"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
)
|
||||
|
||||
// FakeVirtualServices implements VirtualServiceInterface
|
||||
type FakeVirtualServices struct {
|
||||
// fakeVirtualServices implements VirtualServiceInterface
|
||||
type fakeVirtualServices struct {
|
||||
*gentype.FakeClientWithList[*v1beta1.VirtualService, *v1beta1.VirtualServiceList]
|
||||
Fake *FakeNetworkingV1beta1
|
||||
ns string
|
||||
}
|
||||
|
||||
var virtualservicesResource = v1beta1.SchemeGroupVersion.WithResource("virtualservices")
|
||||
|
||||
var virtualservicesKind = v1beta1.SchemeGroupVersion.WithKind("VirtualService")
|
||||
|
||||
// Get takes name of the virtualService, and returns the corresponding virtualService object, and an error if there is any.
|
||||
func (c *FakeVirtualServices) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VirtualService, err error) {
|
||||
emptyResult := &v1beta1.VirtualService{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetActionWithOptions(virtualservicesResource, c.ns, name, options), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
func newFakeVirtualServices(fake *FakeNetworkingV1beta1, namespace string) istiov1beta1.VirtualServiceInterface {
|
||||
return &fakeVirtualServices{
|
||||
gentype.NewFakeClientWithList[*v1beta1.VirtualService, *v1beta1.VirtualServiceList](
|
||||
fake.Fake,
|
||||
namespace,
|
||||
v1beta1.SchemeGroupVersion.WithResource("virtualservices"),
|
||||
v1beta1.SchemeGroupVersion.WithKind("VirtualService"),
|
||||
func() *v1beta1.VirtualService { return &v1beta1.VirtualService{} },
|
||||
func() *v1beta1.VirtualServiceList { return &v1beta1.VirtualServiceList{} },
|
||||
func(dst, src *v1beta1.VirtualServiceList) { dst.ListMeta = src.ListMeta },
|
||||
func(list *v1beta1.VirtualServiceList) []*v1beta1.VirtualService {
|
||||
return gentype.ToPointerSlice(list.Items)
|
||||
},
|
||||
func(list *v1beta1.VirtualServiceList, items []*v1beta1.VirtualService) {
|
||||
list.Items = gentype.FromPointerSlice(items)
|
||||
},
|
||||
),
|
||||
fake,
|
||||
}
|
||||
return obj.(*v1beta1.VirtualService), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of VirtualServices that match those selectors.
|
||||
func (c *FakeVirtualServices) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VirtualServiceList, err error) {
|
||||
emptyResult := &v1beta1.VirtualServiceList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListActionWithOptions(virtualservicesResource, virtualservicesKind, c.ns, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1beta1.VirtualServiceList{ListMeta: obj.(*v1beta1.VirtualServiceList).ListMeta}
|
||||
for _, item := range obj.(*v1beta1.VirtualServiceList).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 virtualServices.
|
||||
func (c *FakeVirtualServices) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchActionWithOptions(virtualservicesResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a virtualService and creates it. Returns the server's representation of the virtualService, and an error, if there is any.
|
||||
func (c *FakeVirtualServices) Create(ctx context.Context, virtualService *v1beta1.VirtualService, opts v1.CreateOptions) (result *v1beta1.VirtualService, err error) {
|
||||
emptyResult := &v1beta1.VirtualService{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateActionWithOptions(virtualservicesResource, c.ns, virtualService, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.VirtualService), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a virtualService and updates it. Returns the server's representation of the virtualService, and an error, if there is any.
|
||||
func (c *FakeVirtualServices) Update(ctx context.Context, virtualService *v1beta1.VirtualService, opts v1.UpdateOptions) (result *v1beta1.VirtualService, err error) {
|
||||
emptyResult := &v1beta1.VirtualService{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateActionWithOptions(virtualservicesResource, c.ns, virtualService, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.VirtualService), err
|
||||
}
|
||||
|
||||
// Delete takes name of the virtualService and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeVirtualServices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteActionWithOptions(virtualservicesResource, c.ns, name, opts), &v1beta1.VirtualService{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeVirtualServices) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionActionWithOptions(virtualservicesResource, c.ns, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1beta1.VirtualServiceList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched virtualService.
|
||||
func (c *FakeVirtualServices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VirtualService, err error) {
|
||||
emptyResult := &v1beta1.VirtualService{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(virtualservicesResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.VirtualService), err
|
||||
}
|
||||
|
||||
@@ -19,10 +19,10 @@ limitations under the License.
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
http "net/http"
|
||||
|
||||
v1beta1 "github.com/fluxcd/flagger/pkg/apis/istio/v1beta1"
|
||||
"github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
istiov1beta1 "github.com/fluxcd/flagger/pkg/apis/istio/v1beta1"
|
||||
scheme "github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
rest "k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
@@ -50,9 +50,7 @@ func (c *NetworkingV1beta1Client) VirtualServices(namespace string) VirtualServi
|
||||
// where httpClient was generated with rest.HTTPClientFor(c).
|
||||
func NewForConfig(c *rest.Config) (*NetworkingV1beta1Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
setConfigDefaults(&config)
|
||||
httpClient, err := rest.HTTPClientFor(&config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -64,9 +62,7 @@ func NewForConfig(c *rest.Config) (*NetworkingV1beta1Client, error) {
|
||||
// Note the http client provided takes precedence over the configured transport values.
|
||||
func NewForConfigAndClient(c *rest.Config, h *http.Client) (*NetworkingV1beta1Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
setConfigDefaults(&config)
|
||||
client, err := rest.RESTClientForConfigAndClient(&config, h)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -89,17 +85,15 @@ func New(c rest.Interface) *NetworkingV1beta1Client {
|
||||
return &NetworkingV1beta1Client{c}
|
||||
}
|
||||
|
||||
func setConfigDefaults(config *rest.Config) error {
|
||||
gv := v1beta1.SchemeGroupVersion
|
||||
func setConfigDefaults(config *rest.Config) {
|
||||
gv := istiov1beta1.SchemeGroupVersion
|
||||
config.GroupVersion = &gv
|
||||
config.APIPath = "/apis"
|
||||
config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
|
||||
config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion()
|
||||
|
||||
if config.UserAgent == "" {
|
||||
config.UserAgent = rest.DefaultKubernetesUserAgent()
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
|
||||
@@ -19,9 +19,9 @@ limitations under the License.
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
"context"
|
||||
context "context"
|
||||
|
||||
v1beta1 "github.com/fluxcd/flagger/pkg/apis/istio/v1beta1"
|
||||
istiov1beta1 "github.com/fluxcd/flagger/pkg/apis/istio/v1beta1"
|
||||
scheme "github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
@@ -37,31 +37,32 @@ type VirtualServicesGetter interface {
|
||||
|
||||
// VirtualServiceInterface has methods to work with VirtualService resources.
|
||||
type VirtualServiceInterface interface {
|
||||
Create(ctx context.Context, virtualService *v1beta1.VirtualService, opts v1.CreateOptions) (*v1beta1.VirtualService, error)
|
||||
Update(ctx context.Context, virtualService *v1beta1.VirtualService, opts v1.UpdateOptions) (*v1beta1.VirtualService, error)
|
||||
Create(ctx context.Context, virtualService *istiov1beta1.VirtualService, opts v1.CreateOptions) (*istiov1beta1.VirtualService, error)
|
||||
Update(ctx context.Context, virtualService *istiov1beta1.VirtualService, opts v1.UpdateOptions) (*istiov1beta1.VirtualService, 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) (*v1beta1.VirtualService, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.VirtualServiceList, error)
|
||||
Get(ctx context.Context, name string, opts v1.GetOptions) (*istiov1beta1.VirtualService, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*istiov1beta1.VirtualServiceList, 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 *v1beta1.VirtualService, err error)
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *istiov1beta1.VirtualService, err error)
|
||||
VirtualServiceExpansion
|
||||
}
|
||||
|
||||
// virtualServices implements VirtualServiceInterface
|
||||
type virtualServices struct {
|
||||
*gentype.ClientWithList[*v1beta1.VirtualService, *v1beta1.VirtualServiceList]
|
||||
*gentype.ClientWithList[*istiov1beta1.VirtualService, *istiov1beta1.VirtualServiceList]
|
||||
}
|
||||
|
||||
// newVirtualServices returns a VirtualServices
|
||||
func newVirtualServices(c *NetworkingV1beta1Client, namespace string) *virtualServices {
|
||||
return &virtualServices{
|
||||
gentype.NewClientWithList[*v1beta1.VirtualService, *v1beta1.VirtualServiceList](
|
||||
gentype.NewClientWithList[*istiov1beta1.VirtualService, *istiov1beta1.VirtualServiceList](
|
||||
"virtualservices",
|
||||
c.RESTClient(),
|
||||
scheme.ParameterCodec,
|
||||
namespace,
|
||||
func() *v1beta1.VirtualService { return &v1beta1.VirtualService{} },
|
||||
func() *v1beta1.VirtualServiceList { return &v1beta1.VirtualServiceList{} }),
|
||||
func() *istiov1beta1.VirtualService { return &istiov1beta1.VirtualService{} },
|
||||
func() *istiov1beta1.VirtualServiceList { return &istiov1beta1.VirtualServiceList{} },
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ type FakeKedaV1alpha1 struct {
|
||||
}
|
||||
|
||||
func (c *FakeKedaV1alpha1) ScaledObjects(namespace string) v1alpha1.ScaledObjectInterface {
|
||||
return &FakeScaledObjects{c, namespace}
|
||||
return newFakeScaledObjects(c, namespace)
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
|
||||
@@ -19,129 +19,34 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
v1alpha1 "github.com/fluxcd/flagger/pkg/apis/keda/v1alpha1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
kedav1alpha1 "github.com/fluxcd/flagger/pkg/client/clientset/versioned/typed/keda/v1alpha1"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
)
|
||||
|
||||
// FakeScaledObjects implements ScaledObjectInterface
|
||||
type FakeScaledObjects struct {
|
||||
// fakeScaledObjects implements ScaledObjectInterface
|
||||
type fakeScaledObjects struct {
|
||||
*gentype.FakeClientWithList[*v1alpha1.ScaledObject, *v1alpha1.ScaledObjectList]
|
||||
Fake *FakeKedaV1alpha1
|
||||
ns string
|
||||
}
|
||||
|
||||
var scaledobjectsResource = v1alpha1.SchemeGroupVersion.WithResource("scaledobjects")
|
||||
|
||||
var scaledobjectsKind = v1alpha1.SchemeGroupVersion.WithKind("ScaledObject")
|
||||
|
||||
// Get takes name of the scaledObject, and returns the corresponding scaledObject object, and an error if there is any.
|
||||
func (c *FakeScaledObjects) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ScaledObject, err error) {
|
||||
emptyResult := &v1alpha1.ScaledObject{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetActionWithOptions(scaledobjectsResource, c.ns, name, options), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
func newFakeScaledObjects(fake *FakeKedaV1alpha1, namespace string) kedav1alpha1.ScaledObjectInterface {
|
||||
return &fakeScaledObjects{
|
||||
gentype.NewFakeClientWithList[*v1alpha1.ScaledObject, *v1alpha1.ScaledObjectList](
|
||||
fake.Fake,
|
||||
namespace,
|
||||
v1alpha1.SchemeGroupVersion.WithResource("scaledobjects"),
|
||||
v1alpha1.SchemeGroupVersion.WithKind("ScaledObject"),
|
||||
func() *v1alpha1.ScaledObject { return &v1alpha1.ScaledObject{} },
|
||||
func() *v1alpha1.ScaledObjectList { return &v1alpha1.ScaledObjectList{} },
|
||||
func(dst, src *v1alpha1.ScaledObjectList) { dst.ListMeta = src.ListMeta },
|
||||
func(list *v1alpha1.ScaledObjectList) []*v1alpha1.ScaledObject {
|
||||
return gentype.ToPointerSlice(list.Items)
|
||||
},
|
||||
func(list *v1alpha1.ScaledObjectList, items []*v1alpha1.ScaledObject) {
|
||||
list.Items = gentype.FromPointerSlice(items)
|
||||
},
|
||||
),
|
||||
fake,
|
||||
}
|
||||
return obj.(*v1alpha1.ScaledObject), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of ScaledObjects that match those selectors.
|
||||
func (c *FakeScaledObjects) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ScaledObjectList, err error) {
|
||||
emptyResult := &v1alpha1.ScaledObjectList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListActionWithOptions(scaledobjectsResource, scaledobjectsKind, c.ns, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1alpha1.ScaledObjectList{ListMeta: obj.(*v1alpha1.ScaledObjectList).ListMeta}
|
||||
for _, item := range obj.(*v1alpha1.ScaledObjectList).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 scaledObjects.
|
||||
func (c *FakeScaledObjects) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchActionWithOptions(scaledobjectsResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a scaledObject and creates it. Returns the server's representation of the scaledObject, and an error, if there is any.
|
||||
func (c *FakeScaledObjects) Create(ctx context.Context, scaledObject *v1alpha1.ScaledObject, opts v1.CreateOptions) (result *v1alpha1.ScaledObject, err error) {
|
||||
emptyResult := &v1alpha1.ScaledObject{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateActionWithOptions(scaledobjectsResource, c.ns, scaledObject, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1alpha1.ScaledObject), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a scaledObject and updates it. Returns the server's representation of the scaledObject, and an error, if there is any.
|
||||
func (c *FakeScaledObjects) Update(ctx context.Context, scaledObject *v1alpha1.ScaledObject, opts v1.UpdateOptions) (result *v1alpha1.ScaledObject, err error) {
|
||||
emptyResult := &v1alpha1.ScaledObject{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateActionWithOptions(scaledobjectsResource, c.ns, scaledObject, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1alpha1.ScaledObject), err
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
func (c *FakeScaledObjects) UpdateStatus(ctx context.Context, scaledObject *v1alpha1.ScaledObject, opts v1.UpdateOptions) (result *v1alpha1.ScaledObject, err error) {
|
||||
emptyResult := &v1alpha1.ScaledObject{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateSubresourceActionWithOptions(scaledobjectsResource, "status", c.ns, scaledObject, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1alpha1.ScaledObject), err
|
||||
}
|
||||
|
||||
// Delete takes name of the scaledObject and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeScaledObjects) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteActionWithOptions(scaledobjectsResource, c.ns, name, opts), &v1alpha1.ScaledObject{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeScaledObjects) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionActionWithOptions(scaledobjectsResource, c.ns, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1alpha1.ScaledObjectList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched scaledObject.
|
||||
func (c *FakeScaledObjects) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ScaledObject, err error) {
|
||||
emptyResult := &v1alpha1.ScaledObject{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(scaledobjectsResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1alpha1.ScaledObject), err
|
||||
}
|
||||
|
||||
@@ -19,10 +19,10 @@ limitations under the License.
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
http "net/http"
|
||||
|
||||
v1alpha1 "github.com/fluxcd/flagger/pkg/apis/keda/v1alpha1"
|
||||
"github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
kedav1alpha1 "github.com/fluxcd/flagger/pkg/apis/keda/v1alpha1"
|
||||
scheme "github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
rest "k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
@@ -45,9 +45,7 @@ func (c *KedaV1alpha1Client) ScaledObjects(namespace string) ScaledObjectInterfa
|
||||
// where httpClient was generated with rest.HTTPClientFor(c).
|
||||
func NewForConfig(c *rest.Config) (*KedaV1alpha1Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
setConfigDefaults(&config)
|
||||
httpClient, err := rest.HTTPClientFor(&config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -59,9 +57,7 @@ func NewForConfig(c *rest.Config) (*KedaV1alpha1Client, error) {
|
||||
// Note the http client provided takes precedence over the configured transport values.
|
||||
func NewForConfigAndClient(c *rest.Config, h *http.Client) (*KedaV1alpha1Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
setConfigDefaults(&config)
|
||||
client, err := rest.RESTClientForConfigAndClient(&config, h)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -84,17 +80,15 @@ func New(c rest.Interface) *KedaV1alpha1Client {
|
||||
return &KedaV1alpha1Client{c}
|
||||
}
|
||||
|
||||
func setConfigDefaults(config *rest.Config) error {
|
||||
gv := v1alpha1.SchemeGroupVersion
|
||||
func setConfigDefaults(config *rest.Config) {
|
||||
gv := kedav1alpha1.SchemeGroupVersion
|
||||
config.GroupVersion = &gv
|
||||
config.APIPath = "/apis"
|
||||
config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
|
||||
config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion()
|
||||
|
||||
if config.UserAgent == "" {
|
||||
config.UserAgent = rest.DefaultKubernetesUserAgent()
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
|
||||
@@ -19,9 +19,9 @@ limitations under the License.
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"context"
|
||||
context "context"
|
||||
|
||||
v1alpha1 "github.com/fluxcd/flagger/pkg/apis/keda/v1alpha1"
|
||||
kedav1alpha1 "github.com/fluxcd/flagger/pkg/apis/keda/v1alpha1"
|
||||
scheme "github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
@@ -37,33 +37,34 @@ type ScaledObjectsGetter interface {
|
||||
|
||||
// ScaledObjectInterface has methods to work with ScaledObject resources.
|
||||
type ScaledObjectInterface interface {
|
||||
Create(ctx context.Context, scaledObject *v1alpha1.ScaledObject, opts v1.CreateOptions) (*v1alpha1.ScaledObject, error)
|
||||
Update(ctx context.Context, scaledObject *v1alpha1.ScaledObject, opts v1.UpdateOptions) (*v1alpha1.ScaledObject, error)
|
||||
Create(ctx context.Context, scaledObject *kedav1alpha1.ScaledObject, opts v1.CreateOptions) (*kedav1alpha1.ScaledObject, error)
|
||||
Update(ctx context.Context, scaledObject *kedav1alpha1.ScaledObject, opts v1.UpdateOptions) (*kedav1alpha1.ScaledObject, error)
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
UpdateStatus(ctx context.Context, scaledObject *v1alpha1.ScaledObject, opts v1.UpdateOptions) (*v1alpha1.ScaledObject, error)
|
||||
UpdateStatus(ctx context.Context, scaledObject *kedav1alpha1.ScaledObject, opts v1.UpdateOptions) (*kedav1alpha1.ScaledObject, 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.ScaledObject, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ScaledObjectList, error)
|
||||
Get(ctx context.Context, name string, opts v1.GetOptions) (*kedav1alpha1.ScaledObject, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*kedav1alpha1.ScaledObjectList, 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.ScaledObject, err error)
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *kedav1alpha1.ScaledObject, err error)
|
||||
ScaledObjectExpansion
|
||||
}
|
||||
|
||||
// scaledObjects implements ScaledObjectInterface
|
||||
type scaledObjects struct {
|
||||
*gentype.ClientWithList[*v1alpha1.ScaledObject, *v1alpha1.ScaledObjectList]
|
||||
*gentype.ClientWithList[*kedav1alpha1.ScaledObject, *kedav1alpha1.ScaledObjectList]
|
||||
}
|
||||
|
||||
// newScaledObjects returns a ScaledObjects
|
||||
func newScaledObjects(c *KedaV1alpha1Client, namespace string) *scaledObjects {
|
||||
return &scaledObjects{
|
||||
gentype.NewClientWithList[*v1alpha1.ScaledObject, *v1alpha1.ScaledObjectList](
|
||||
gentype.NewClientWithList[*kedav1alpha1.ScaledObject, *kedav1alpha1.ScaledObjectList](
|
||||
"scaledobjects",
|
||||
c.RESTClient(),
|
||||
scheme.ParameterCodec,
|
||||
namespace,
|
||||
func() *v1alpha1.ScaledObject { return &v1alpha1.ScaledObject{} },
|
||||
func() *v1alpha1.ScaledObjectList { return &v1alpha1.ScaledObjectList{} }),
|
||||
func() *kedav1alpha1.ScaledObject { return &kedav1alpha1.ScaledObject{} },
|
||||
func() *kedav1alpha1.ScaledObjectList { return &kedav1alpha1.ScaledObjectList{} },
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ type FakeKumaV1alpha1 struct {
|
||||
}
|
||||
|
||||
func (c *FakeKumaV1alpha1) TrafficRoutes() v1alpha1.TrafficRouteInterface {
|
||||
return &FakeTrafficRoutes{c}
|
||||
return newFakeTrafficRoutes(c)
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
|
||||
@@ -19,108 +19,34 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
v1alpha1 "github.com/fluxcd/flagger/pkg/apis/kuma/v1alpha1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
kumav1alpha1 "github.com/fluxcd/flagger/pkg/client/clientset/versioned/typed/kuma/v1alpha1"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
)
|
||||
|
||||
// FakeTrafficRoutes implements TrafficRouteInterface
|
||||
type FakeTrafficRoutes struct {
|
||||
// fakeTrafficRoutes implements TrafficRouteInterface
|
||||
type fakeTrafficRoutes struct {
|
||||
*gentype.FakeClientWithList[*v1alpha1.TrafficRoute, *v1alpha1.TrafficRouteList]
|
||||
Fake *FakeKumaV1alpha1
|
||||
}
|
||||
|
||||
var trafficroutesResource = v1alpha1.SchemeGroupVersion.WithResource("trafficroutes")
|
||||
|
||||
var trafficroutesKind = v1alpha1.SchemeGroupVersion.WithKind("TrafficRoute")
|
||||
|
||||
// Get takes name of the trafficRoute, and returns the corresponding trafficRoute object, and an error if there is any.
|
||||
func (c *FakeTrafficRoutes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.TrafficRoute, err error) {
|
||||
emptyResult := &v1alpha1.TrafficRoute{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootGetActionWithOptions(trafficroutesResource, name, options), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
func newFakeTrafficRoutes(fake *FakeKumaV1alpha1) kumav1alpha1.TrafficRouteInterface {
|
||||
return &fakeTrafficRoutes{
|
||||
gentype.NewFakeClientWithList[*v1alpha1.TrafficRoute, *v1alpha1.TrafficRouteList](
|
||||
fake.Fake,
|
||||
"",
|
||||
v1alpha1.SchemeGroupVersion.WithResource("trafficroutes"),
|
||||
v1alpha1.SchemeGroupVersion.WithKind("TrafficRoute"),
|
||||
func() *v1alpha1.TrafficRoute { return &v1alpha1.TrafficRoute{} },
|
||||
func() *v1alpha1.TrafficRouteList { return &v1alpha1.TrafficRouteList{} },
|
||||
func(dst, src *v1alpha1.TrafficRouteList) { dst.ListMeta = src.ListMeta },
|
||||
func(list *v1alpha1.TrafficRouteList) []*v1alpha1.TrafficRoute {
|
||||
return gentype.ToPointerSlice(list.Items)
|
||||
},
|
||||
func(list *v1alpha1.TrafficRouteList, items []*v1alpha1.TrafficRoute) {
|
||||
list.Items = gentype.FromPointerSlice(items)
|
||||
},
|
||||
),
|
||||
fake,
|
||||
}
|
||||
return obj.(*v1alpha1.TrafficRoute), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of TrafficRoutes that match those selectors.
|
||||
func (c *FakeTrafficRoutes) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.TrafficRouteList, err error) {
|
||||
emptyResult := &v1alpha1.TrafficRouteList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootListActionWithOptions(trafficroutesResource, trafficroutesKind, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1alpha1.TrafficRouteList{ListMeta: obj.(*v1alpha1.TrafficRouteList).ListMeta}
|
||||
for _, item := range obj.(*v1alpha1.TrafficRouteList).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 trafficRoutes.
|
||||
func (c *FakeTrafficRoutes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewRootWatchActionWithOptions(trafficroutesResource, opts))
|
||||
}
|
||||
|
||||
// Create takes the representation of a trafficRoute and creates it. Returns the server's representation of the trafficRoute, and an error, if there is any.
|
||||
func (c *FakeTrafficRoutes) Create(ctx context.Context, trafficRoute *v1alpha1.TrafficRoute, opts v1.CreateOptions) (result *v1alpha1.TrafficRoute, err error) {
|
||||
emptyResult := &v1alpha1.TrafficRoute{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootCreateActionWithOptions(trafficroutesResource, trafficRoute, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1alpha1.TrafficRoute), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a trafficRoute and updates it. Returns the server's representation of the trafficRoute, and an error, if there is any.
|
||||
func (c *FakeTrafficRoutes) Update(ctx context.Context, trafficRoute *v1alpha1.TrafficRoute, opts v1.UpdateOptions) (result *v1alpha1.TrafficRoute, err error) {
|
||||
emptyResult := &v1alpha1.TrafficRoute{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootUpdateActionWithOptions(trafficroutesResource, trafficRoute, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1alpha1.TrafficRoute), err
|
||||
}
|
||||
|
||||
// Delete takes name of the trafficRoute and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeTrafficRoutes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewRootDeleteActionWithOptions(trafficroutesResource, name, opts), &v1alpha1.TrafficRoute{})
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeTrafficRoutes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewRootDeleteCollectionActionWithOptions(trafficroutesResource, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1alpha1.TrafficRouteList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched trafficRoute.
|
||||
func (c *FakeTrafficRoutes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.TrafficRoute, err error) {
|
||||
emptyResult := &v1alpha1.TrafficRoute{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootPatchSubresourceActionWithOptions(trafficroutesResource, name, pt, data, opts, subresources...), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1alpha1.TrafficRoute), err
|
||||
}
|
||||
|
||||
@@ -19,10 +19,10 @@ limitations under the License.
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
http "net/http"
|
||||
|
||||
v1alpha1 "github.com/fluxcd/flagger/pkg/apis/kuma/v1alpha1"
|
||||
"github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
kumav1alpha1 "github.com/fluxcd/flagger/pkg/apis/kuma/v1alpha1"
|
||||
scheme "github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
rest "k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
@@ -45,9 +45,7 @@ func (c *KumaV1alpha1Client) TrafficRoutes() TrafficRouteInterface {
|
||||
// where httpClient was generated with rest.HTTPClientFor(c).
|
||||
func NewForConfig(c *rest.Config) (*KumaV1alpha1Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
setConfigDefaults(&config)
|
||||
httpClient, err := rest.HTTPClientFor(&config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -59,9 +57,7 @@ func NewForConfig(c *rest.Config) (*KumaV1alpha1Client, error) {
|
||||
// Note the http client provided takes precedence over the configured transport values.
|
||||
func NewForConfigAndClient(c *rest.Config, h *http.Client) (*KumaV1alpha1Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
setConfigDefaults(&config)
|
||||
client, err := rest.RESTClientForConfigAndClient(&config, h)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -84,17 +80,15 @@ func New(c rest.Interface) *KumaV1alpha1Client {
|
||||
return &KumaV1alpha1Client{c}
|
||||
}
|
||||
|
||||
func setConfigDefaults(config *rest.Config) error {
|
||||
gv := v1alpha1.SchemeGroupVersion
|
||||
func setConfigDefaults(config *rest.Config) {
|
||||
gv := kumav1alpha1.SchemeGroupVersion
|
||||
config.GroupVersion = &gv
|
||||
config.APIPath = "/apis"
|
||||
config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
|
||||
config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion()
|
||||
|
||||
if config.UserAgent == "" {
|
||||
config.UserAgent = rest.DefaultKubernetesUserAgent()
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
|
||||
@@ -19,9 +19,9 @@ limitations under the License.
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"context"
|
||||
context "context"
|
||||
|
||||
v1alpha1 "github.com/fluxcd/flagger/pkg/apis/kuma/v1alpha1"
|
||||
kumav1alpha1 "github.com/fluxcd/flagger/pkg/apis/kuma/v1alpha1"
|
||||
scheme "github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
@@ -37,31 +37,32 @@ type TrafficRoutesGetter interface {
|
||||
|
||||
// TrafficRouteInterface has methods to work with TrafficRoute resources.
|
||||
type TrafficRouteInterface interface {
|
||||
Create(ctx context.Context, trafficRoute *v1alpha1.TrafficRoute, opts v1.CreateOptions) (*v1alpha1.TrafficRoute, error)
|
||||
Update(ctx context.Context, trafficRoute *v1alpha1.TrafficRoute, opts v1.UpdateOptions) (*v1alpha1.TrafficRoute, error)
|
||||
Create(ctx context.Context, trafficRoute *kumav1alpha1.TrafficRoute, opts v1.CreateOptions) (*kumav1alpha1.TrafficRoute, error)
|
||||
Update(ctx context.Context, trafficRoute *kumav1alpha1.TrafficRoute, opts v1.UpdateOptions) (*kumav1alpha1.TrafficRoute, 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.TrafficRoute, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.TrafficRouteList, error)
|
||||
Get(ctx context.Context, name string, opts v1.GetOptions) (*kumav1alpha1.TrafficRoute, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*kumav1alpha1.TrafficRouteList, 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.TrafficRoute, err error)
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *kumav1alpha1.TrafficRoute, err error)
|
||||
TrafficRouteExpansion
|
||||
}
|
||||
|
||||
// trafficRoutes implements TrafficRouteInterface
|
||||
type trafficRoutes struct {
|
||||
*gentype.ClientWithList[*v1alpha1.TrafficRoute, *v1alpha1.TrafficRouteList]
|
||||
*gentype.ClientWithList[*kumav1alpha1.TrafficRoute, *kumav1alpha1.TrafficRouteList]
|
||||
}
|
||||
|
||||
// newTrafficRoutes returns a TrafficRoutes
|
||||
func newTrafficRoutes(c *KumaV1alpha1Client) *trafficRoutes {
|
||||
return &trafficRoutes{
|
||||
gentype.NewClientWithList[*v1alpha1.TrafficRoute, *v1alpha1.TrafficRouteList](
|
||||
gentype.NewClientWithList[*kumav1alpha1.TrafficRoute, *kumav1alpha1.TrafficRouteList](
|
||||
"trafficroutes",
|
||||
c.RESTClient(),
|
||||
scheme.ParameterCodec,
|
||||
"",
|
||||
func() *v1alpha1.TrafficRoute { return &v1alpha1.TrafficRoute{} },
|
||||
func() *v1alpha1.TrafficRouteList { return &v1alpha1.TrafficRouteList{} }),
|
||||
func() *kumav1alpha1.TrafficRoute { return &kumav1alpha1.TrafficRoute{} },
|
||||
func() *kumav1alpha1.TrafficRouteList { return &kumav1alpha1.TrafficRouteList{} },
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,129 +19,30 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
v1 "github.com/fluxcd/flagger/pkg/apis/projectcontour/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
projectcontourv1 "github.com/fluxcd/flagger/pkg/client/clientset/versioned/typed/projectcontour/v1"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
)
|
||||
|
||||
// FakeHTTPProxies implements HTTPProxyInterface
|
||||
type FakeHTTPProxies struct {
|
||||
// fakeHTTPProxies implements HTTPProxyInterface
|
||||
type fakeHTTPProxies struct {
|
||||
*gentype.FakeClientWithList[*v1.HTTPProxy, *v1.HTTPProxyList]
|
||||
Fake *FakeProjectcontourV1
|
||||
ns string
|
||||
}
|
||||
|
||||
var httpproxiesResource = v1.SchemeGroupVersion.WithResource("httpproxies")
|
||||
|
||||
var httpproxiesKind = v1.SchemeGroupVersion.WithKind("HTTPProxy")
|
||||
|
||||
// Get takes name of the hTTPProxy, and returns the corresponding hTTPProxy object, and an error if there is any.
|
||||
func (c *FakeHTTPProxies) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.HTTPProxy, err error) {
|
||||
emptyResult := &v1.HTTPProxy{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetActionWithOptions(httpproxiesResource, c.ns, name, options), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
func newFakeHTTPProxies(fake *FakeProjectcontourV1, namespace string) projectcontourv1.HTTPProxyInterface {
|
||||
return &fakeHTTPProxies{
|
||||
gentype.NewFakeClientWithList[*v1.HTTPProxy, *v1.HTTPProxyList](
|
||||
fake.Fake,
|
||||
namespace,
|
||||
v1.SchemeGroupVersion.WithResource("httpproxies"),
|
||||
v1.SchemeGroupVersion.WithKind("HTTPProxy"),
|
||||
func() *v1.HTTPProxy { return &v1.HTTPProxy{} },
|
||||
func() *v1.HTTPProxyList { return &v1.HTTPProxyList{} },
|
||||
func(dst, src *v1.HTTPProxyList) { dst.ListMeta = src.ListMeta },
|
||||
func(list *v1.HTTPProxyList) []*v1.HTTPProxy { return gentype.ToPointerSlice(list.Items) },
|
||||
func(list *v1.HTTPProxyList, items []*v1.HTTPProxy) { list.Items = gentype.FromPointerSlice(items) },
|
||||
),
|
||||
fake,
|
||||
}
|
||||
return obj.(*v1.HTTPProxy), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of HTTPProxies that match those selectors.
|
||||
func (c *FakeHTTPProxies) List(ctx context.Context, opts metav1.ListOptions) (result *v1.HTTPProxyList, err error) {
|
||||
emptyResult := &v1.HTTPProxyList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListActionWithOptions(httpproxiesResource, httpproxiesKind, c.ns, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1.HTTPProxyList{ListMeta: obj.(*v1.HTTPProxyList).ListMeta}
|
||||
for _, item := range obj.(*v1.HTTPProxyList).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 hTTPProxies.
|
||||
func (c *FakeHTTPProxies) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchActionWithOptions(httpproxiesResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a hTTPProxy and creates it. Returns the server's representation of the hTTPProxy, and an error, if there is any.
|
||||
func (c *FakeHTTPProxies) Create(ctx context.Context, hTTPProxy *v1.HTTPProxy, opts metav1.CreateOptions) (result *v1.HTTPProxy, err error) {
|
||||
emptyResult := &v1.HTTPProxy{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateActionWithOptions(httpproxiesResource, c.ns, hTTPProxy, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.HTTPProxy), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a hTTPProxy and updates it. Returns the server's representation of the hTTPProxy, and an error, if there is any.
|
||||
func (c *FakeHTTPProxies) Update(ctx context.Context, hTTPProxy *v1.HTTPProxy, opts metav1.UpdateOptions) (result *v1.HTTPProxy, err error) {
|
||||
emptyResult := &v1.HTTPProxy{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateActionWithOptions(httpproxiesResource, c.ns, hTTPProxy, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.HTTPProxy), err
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
func (c *FakeHTTPProxies) UpdateStatus(ctx context.Context, hTTPProxy *v1.HTTPProxy, opts metav1.UpdateOptions) (result *v1.HTTPProxy, err error) {
|
||||
emptyResult := &v1.HTTPProxy{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateSubresourceActionWithOptions(httpproxiesResource, "status", c.ns, hTTPProxy, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.HTTPProxy), err
|
||||
}
|
||||
|
||||
// Delete takes name of the hTTPProxy and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeHTTPProxies) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteActionWithOptions(httpproxiesResource, c.ns, name, opts), &v1.HTTPProxy{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeHTTPProxies) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionActionWithOptions(httpproxiesResource, c.ns, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1.HTTPProxyList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched hTTPProxy.
|
||||
func (c *FakeHTTPProxies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.HTTPProxy, err error) {
|
||||
emptyResult := &v1.HTTPProxy{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(httpproxiesResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.HTTPProxy), err
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ type FakeProjectcontourV1 struct {
|
||||
}
|
||||
|
||||
func (c *FakeProjectcontourV1) HTTPProxies(namespace string) v1.HTTPProxyInterface {
|
||||
return &FakeHTTPProxies{c, namespace}
|
||||
return newFakeHTTPProxies(c, namespace)
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
|
||||
@@ -19,9 +19,9 @@ limitations under the License.
|
||||
package v1
|
||||
|
||||
import (
|
||||
"context"
|
||||
context "context"
|
||||
|
||||
v1 "github.com/fluxcd/flagger/pkg/apis/projectcontour/v1"
|
||||
projectcontourv1 "github.com/fluxcd/flagger/pkg/apis/projectcontour/v1"
|
||||
scheme "github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
@@ -37,33 +37,34 @@ type HTTPProxiesGetter interface {
|
||||
|
||||
// HTTPProxyInterface has methods to work with HTTPProxy resources.
|
||||
type HTTPProxyInterface interface {
|
||||
Create(ctx context.Context, hTTPProxy *v1.HTTPProxy, opts metav1.CreateOptions) (*v1.HTTPProxy, error)
|
||||
Update(ctx context.Context, hTTPProxy *v1.HTTPProxy, opts metav1.UpdateOptions) (*v1.HTTPProxy, error)
|
||||
Create(ctx context.Context, hTTPProxy *projectcontourv1.HTTPProxy, opts metav1.CreateOptions) (*projectcontourv1.HTTPProxy, error)
|
||||
Update(ctx context.Context, hTTPProxy *projectcontourv1.HTTPProxy, opts metav1.UpdateOptions) (*projectcontourv1.HTTPProxy, error)
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
UpdateStatus(ctx context.Context, hTTPProxy *v1.HTTPProxy, opts metav1.UpdateOptions) (*v1.HTTPProxy, error)
|
||||
UpdateStatus(ctx context.Context, hTTPProxy *projectcontourv1.HTTPProxy, opts metav1.UpdateOptions) (*projectcontourv1.HTTPProxy, error)
|
||||
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
|
||||
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.HTTPProxy, error)
|
||||
List(ctx context.Context, opts metav1.ListOptions) (*v1.HTTPProxyList, error)
|
||||
Get(ctx context.Context, name string, opts metav1.GetOptions) (*projectcontourv1.HTTPProxy, error)
|
||||
List(ctx context.Context, opts metav1.ListOptions) (*projectcontourv1.HTTPProxyList, error)
|
||||
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.HTTPProxy, err error)
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *projectcontourv1.HTTPProxy, err error)
|
||||
HTTPProxyExpansion
|
||||
}
|
||||
|
||||
// hTTPProxies implements HTTPProxyInterface
|
||||
type hTTPProxies struct {
|
||||
*gentype.ClientWithList[*v1.HTTPProxy, *v1.HTTPProxyList]
|
||||
*gentype.ClientWithList[*projectcontourv1.HTTPProxy, *projectcontourv1.HTTPProxyList]
|
||||
}
|
||||
|
||||
// newHTTPProxies returns a HTTPProxies
|
||||
func newHTTPProxies(c *ProjectcontourV1Client, namespace string) *hTTPProxies {
|
||||
return &hTTPProxies{
|
||||
gentype.NewClientWithList[*v1.HTTPProxy, *v1.HTTPProxyList](
|
||||
gentype.NewClientWithList[*projectcontourv1.HTTPProxy, *projectcontourv1.HTTPProxyList](
|
||||
"httpproxies",
|
||||
c.RESTClient(),
|
||||
scheme.ParameterCodec,
|
||||
namespace,
|
||||
func() *v1.HTTPProxy { return &v1.HTTPProxy{} },
|
||||
func() *v1.HTTPProxyList { return &v1.HTTPProxyList{} }),
|
||||
func() *projectcontourv1.HTTPProxy { return &projectcontourv1.HTTPProxy{} },
|
||||
func() *projectcontourv1.HTTPProxyList { return &projectcontourv1.HTTPProxyList{} },
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,10 +19,10 @@ limitations under the License.
|
||||
package v1
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
http "net/http"
|
||||
|
||||
v1 "github.com/fluxcd/flagger/pkg/apis/projectcontour/v1"
|
||||
"github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
projectcontourv1 "github.com/fluxcd/flagger/pkg/apis/projectcontour/v1"
|
||||
scheme "github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
rest "k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
@@ -45,9 +45,7 @@ func (c *ProjectcontourV1Client) HTTPProxies(namespace string) HTTPProxyInterfac
|
||||
// where httpClient was generated with rest.HTTPClientFor(c).
|
||||
func NewForConfig(c *rest.Config) (*ProjectcontourV1Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
setConfigDefaults(&config)
|
||||
httpClient, err := rest.HTTPClientFor(&config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -59,9 +57,7 @@ func NewForConfig(c *rest.Config) (*ProjectcontourV1Client, error) {
|
||||
// Note the http client provided takes precedence over the configured transport values.
|
||||
func NewForConfigAndClient(c *rest.Config, h *http.Client) (*ProjectcontourV1Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
setConfigDefaults(&config)
|
||||
client, err := rest.RESTClientForConfigAndClient(&config, h)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -84,17 +80,15 @@ func New(c rest.Interface) *ProjectcontourV1Client {
|
||||
return &ProjectcontourV1Client{c}
|
||||
}
|
||||
|
||||
func setConfigDefaults(config *rest.Config) error {
|
||||
gv := v1.SchemeGroupVersion
|
||||
func setConfigDefaults(config *rest.Config) {
|
||||
gv := projectcontourv1.SchemeGroupVersion
|
||||
config.GroupVersion = &gv
|
||||
config.APIPath = "/apis"
|
||||
config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
|
||||
config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion()
|
||||
|
||||
if config.UserAgent == "" {
|
||||
config.UserAgent = rest.DefaultKubernetesUserAgent()
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
|
||||
@@ -29,7 +29,7 @@ type FakeSplitV1alpha1 struct {
|
||||
}
|
||||
|
||||
func (c *FakeSplitV1alpha1) TrafficSplits(namespace string) v1alpha1.TrafficSplitInterface {
|
||||
return &FakeTrafficSplits{c, namespace}
|
||||
return newFakeTrafficSplits(c, namespace)
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
|
||||
@@ -19,116 +19,34 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
v1alpha1 "github.com/fluxcd/flagger/pkg/apis/smi/v1alpha1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
smiv1alpha1 "github.com/fluxcd/flagger/pkg/client/clientset/versioned/typed/smi/v1alpha1"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
)
|
||||
|
||||
// FakeTrafficSplits implements TrafficSplitInterface
|
||||
type FakeTrafficSplits struct {
|
||||
// fakeTrafficSplits implements TrafficSplitInterface
|
||||
type fakeTrafficSplits struct {
|
||||
*gentype.FakeClientWithList[*v1alpha1.TrafficSplit, *v1alpha1.TrafficSplitList]
|
||||
Fake *FakeSplitV1alpha1
|
||||
ns string
|
||||
}
|
||||
|
||||
var trafficsplitsResource = v1alpha1.SchemeGroupVersion.WithResource("trafficsplits")
|
||||
|
||||
var trafficsplitsKind = v1alpha1.SchemeGroupVersion.WithKind("TrafficSplit")
|
||||
|
||||
// Get takes name of the trafficSplit, and returns the corresponding trafficSplit object, and an error if there is any.
|
||||
func (c *FakeTrafficSplits) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.TrafficSplit, err error) {
|
||||
emptyResult := &v1alpha1.TrafficSplit{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetActionWithOptions(trafficsplitsResource, c.ns, name, options), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
func newFakeTrafficSplits(fake *FakeSplitV1alpha1, namespace string) smiv1alpha1.TrafficSplitInterface {
|
||||
return &fakeTrafficSplits{
|
||||
gentype.NewFakeClientWithList[*v1alpha1.TrafficSplit, *v1alpha1.TrafficSplitList](
|
||||
fake.Fake,
|
||||
namespace,
|
||||
v1alpha1.SchemeGroupVersion.WithResource("trafficsplits"),
|
||||
v1alpha1.SchemeGroupVersion.WithKind("TrafficSplit"),
|
||||
func() *v1alpha1.TrafficSplit { return &v1alpha1.TrafficSplit{} },
|
||||
func() *v1alpha1.TrafficSplitList { return &v1alpha1.TrafficSplitList{} },
|
||||
func(dst, src *v1alpha1.TrafficSplitList) { dst.ListMeta = src.ListMeta },
|
||||
func(list *v1alpha1.TrafficSplitList) []*v1alpha1.TrafficSplit {
|
||||
return gentype.ToPointerSlice(list.Items)
|
||||
},
|
||||
func(list *v1alpha1.TrafficSplitList, items []*v1alpha1.TrafficSplit) {
|
||||
list.Items = gentype.FromPointerSlice(items)
|
||||
},
|
||||
),
|
||||
fake,
|
||||
}
|
||||
return obj.(*v1alpha1.TrafficSplit), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of TrafficSplits that match those selectors.
|
||||
func (c *FakeTrafficSplits) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.TrafficSplitList, err error) {
|
||||
emptyResult := &v1alpha1.TrafficSplitList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListActionWithOptions(trafficsplitsResource, trafficsplitsKind, c.ns, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1alpha1.TrafficSplitList{ListMeta: obj.(*v1alpha1.TrafficSplitList).ListMeta}
|
||||
for _, item := range obj.(*v1alpha1.TrafficSplitList).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 trafficSplits.
|
||||
func (c *FakeTrafficSplits) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchActionWithOptions(trafficsplitsResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a trafficSplit and creates it. Returns the server's representation of the trafficSplit, and an error, if there is any.
|
||||
func (c *FakeTrafficSplits) Create(ctx context.Context, trafficSplit *v1alpha1.TrafficSplit, opts v1.CreateOptions) (result *v1alpha1.TrafficSplit, err error) {
|
||||
emptyResult := &v1alpha1.TrafficSplit{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateActionWithOptions(trafficsplitsResource, c.ns, trafficSplit, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1alpha1.TrafficSplit), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a trafficSplit and updates it. Returns the server's representation of the trafficSplit, and an error, if there is any.
|
||||
func (c *FakeTrafficSplits) Update(ctx context.Context, trafficSplit *v1alpha1.TrafficSplit, opts v1.UpdateOptions) (result *v1alpha1.TrafficSplit, err error) {
|
||||
emptyResult := &v1alpha1.TrafficSplit{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateActionWithOptions(trafficsplitsResource, c.ns, trafficSplit, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1alpha1.TrafficSplit), err
|
||||
}
|
||||
|
||||
// Delete takes name of the trafficSplit and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeTrafficSplits) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteActionWithOptions(trafficsplitsResource, c.ns, name, opts), &v1alpha1.TrafficSplit{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeTrafficSplits) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionActionWithOptions(trafficsplitsResource, c.ns, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1alpha1.TrafficSplitList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched trafficSplit.
|
||||
func (c *FakeTrafficSplits) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.TrafficSplit, err error) {
|
||||
emptyResult := &v1alpha1.TrafficSplit{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(trafficsplitsResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1alpha1.TrafficSplit), err
|
||||
}
|
||||
|
||||
@@ -19,10 +19,10 @@ limitations under the License.
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
http "net/http"
|
||||
|
||||
v1alpha1 "github.com/fluxcd/flagger/pkg/apis/smi/v1alpha1"
|
||||
"github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
smiv1alpha1 "github.com/fluxcd/flagger/pkg/apis/smi/v1alpha1"
|
||||
scheme "github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
rest "k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
@@ -45,9 +45,7 @@ func (c *SplitV1alpha1Client) TrafficSplits(namespace string) TrafficSplitInterf
|
||||
// where httpClient was generated with rest.HTTPClientFor(c).
|
||||
func NewForConfig(c *rest.Config) (*SplitV1alpha1Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
setConfigDefaults(&config)
|
||||
httpClient, err := rest.HTTPClientFor(&config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -59,9 +57,7 @@ func NewForConfig(c *rest.Config) (*SplitV1alpha1Client, error) {
|
||||
// Note the http client provided takes precedence over the configured transport values.
|
||||
func NewForConfigAndClient(c *rest.Config, h *http.Client) (*SplitV1alpha1Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
setConfigDefaults(&config)
|
||||
client, err := rest.RESTClientForConfigAndClient(&config, h)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -84,17 +80,15 @@ func New(c rest.Interface) *SplitV1alpha1Client {
|
||||
return &SplitV1alpha1Client{c}
|
||||
}
|
||||
|
||||
func setConfigDefaults(config *rest.Config) error {
|
||||
gv := v1alpha1.SchemeGroupVersion
|
||||
func setConfigDefaults(config *rest.Config) {
|
||||
gv := smiv1alpha1.SchemeGroupVersion
|
||||
config.GroupVersion = &gv
|
||||
config.APIPath = "/apis"
|
||||
config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
|
||||
config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion()
|
||||
|
||||
if config.UserAgent == "" {
|
||||
config.UserAgent = rest.DefaultKubernetesUserAgent()
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
|
||||
@@ -19,9 +19,9 @@ limitations under the License.
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"context"
|
||||
context "context"
|
||||
|
||||
v1alpha1 "github.com/fluxcd/flagger/pkg/apis/smi/v1alpha1"
|
||||
smiv1alpha1 "github.com/fluxcd/flagger/pkg/apis/smi/v1alpha1"
|
||||
scheme "github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
@@ -37,31 +37,32 @@ type TrafficSplitsGetter interface {
|
||||
|
||||
// TrafficSplitInterface has methods to work with TrafficSplit resources.
|
||||
type TrafficSplitInterface interface {
|
||||
Create(ctx context.Context, trafficSplit *v1alpha1.TrafficSplit, opts v1.CreateOptions) (*v1alpha1.TrafficSplit, error)
|
||||
Update(ctx context.Context, trafficSplit *v1alpha1.TrafficSplit, opts v1.UpdateOptions) (*v1alpha1.TrafficSplit, error)
|
||||
Create(ctx context.Context, trafficSplit *smiv1alpha1.TrafficSplit, opts v1.CreateOptions) (*smiv1alpha1.TrafficSplit, error)
|
||||
Update(ctx context.Context, trafficSplit *smiv1alpha1.TrafficSplit, opts v1.UpdateOptions) (*smiv1alpha1.TrafficSplit, 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.TrafficSplit, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.TrafficSplitList, error)
|
||||
Get(ctx context.Context, name string, opts v1.GetOptions) (*smiv1alpha1.TrafficSplit, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*smiv1alpha1.TrafficSplitList, 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.TrafficSplit, err error)
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *smiv1alpha1.TrafficSplit, err error)
|
||||
TrafficSplitExpansion
|
||||
}
|
||||
|
||||
// trafficSplits implements TrafficSplitInterface
|
||||
type trafficSplits struct {
|
||||
*gentype.ClientWithList[*v1alpha1.TrafficSplit, *v1alpha1.TrafficSplitList]
|
||||
*gentype.ClientWithList[*smiv1alpha1.TrafficSplit, *smiv1alpha1.TrafficSplitList]
|
||||
}
|
||||
|
||||
// newTrafficSplits returns a TrafficSplits
|
||||
func newTrafficSplits(c *SplitV1alpha1Client, namespace string) *trafficSplits {
|
||||
return &trafficSplits{
|
||||
gentype.NewClientWithList[*v1alpha1.TrafficSplit, *v1alpha1.TrafficSplitList](
|
||||
gentype.NewClientWithList[*smiv1alpha1.TrafficSplit, *smiv1alpha1.TrafficSplitList](
|
||||
"trafficsplits",
|
||||
c.RESTClient(),
|
||||
scheme.ParameterCodec,
|
||||
namespace,
|
||||
func() *v1alpha1.TrafficSplit { return &v1alpha1.TrafficSplit{} },
|
||||
func() *v1alpha1.TrafficSplitList { return &v1alpha1.TrafficSplitList{} }),
|
||||
func() *smiv1alpha1.TrafficSplit { return &smiv1alpha1.TrafficSplit{} },
|
||||
func() *smiv1alpha1.TrafficSplitList { return &smiv1alpha1.TrafficSplitList{} },
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ type FakeSplitV1alpha2 struct {
|
||||
}
|
||||
|
||||
func (c *FakeSplitV1alpha2) TrafficSplits(namespace string) v1alpha2.TrafficSplitInterface {
|
||||
return &FakeTrafficSplits{c, namespace}
|
||||
return newFakeTrafficSplits(c, namespace)
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
|
||||
@@ -19,116 +19,34 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
v1alpha2 "github.com/fluxcd/flagger/pkg/apis/smi/v1alpha2"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
smiv1alpha2 "github.com/fluxcd/flagger/pkg/client/clientset/versioned/typed/smi/v1alpha2"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
)
|
||||
|
||||
// FakeTrafficSplits implements TrafficSplitInterface
|
||||
type FakeTrafficSplits struct {
|
||||
// fakeTrafficSplits implements TrafficSplitInterface
|
||||
type fakeTrafficSplits struct {
|
||||
*gentype.FakeClientWithList[*v1alpha2.TrafficSplit, *v1alpha2.TrafficSplitList]
|
||||
Fake *FakeSplitV1alpha2
|
||||
ns string
|
||||
}
|
||||
|
||||
var trafficsplitsResource = v1alpha2.SchemeGroupVersion.WithResource("trafficsplits")
|
||||
|
||||
var trafficsplitsKind = v1alpha2.SchemeGroupVersion.WithKind("TrafficSplit")
|
||||
|
||||
// Get takes name of the trafficSplit, and returns the corresponding trafficSplit object, and an error if there is any.
|
||||
func (c *FakeTrafficSplits) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.TrafficSplit, err error) {
|
||||
emptyResult := &v1alpha2.TrafficSplit{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetActionWithOptions(trafficsplitsResource, c.ns, name, options), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
func newFakeTrafficSplits(fake *FakeSplitV1alpha2, namespace string) smiv1alpha2.TrafficSplitInterface {
|
||||
return &fakeTrafficSplits{
|
||||
gentype.NewFakeClientWithList[*v1alpha2.TrafficSplit, *v1alpha2.TrafficSplitList](
|
||||
fake.Fake,
|
||||
namespace,
|
||||
v1alpha2.SchemeGroupVersion.WithResource("trafficsplits"),
|
||||
v1alpha2.SchemeGroupVersion.WithKind("TrafficSplit"),
|
||||
func() *v1alpha2.TrafficSplit { return &v1alpha2.TrafficSplit{} },
|
||||
func() *v1alpha2.TrafficSplitList { return &v1alpha2.TrafficSplitList{} },
|
||||
func(dst, src *v1alpha2.TrafficSplitList) { dst.ListMeta = src.ListMeta },
|
||||
func(list *v1alpha2.TrafficSplitList) []*v1alpha2.TrafficSplit {
|
||||
return gentype.ToPointerSlice(list.Items)
|
||||
},
|
||||
func(list *v1alpha2.TrafficSplitList, items []*v1alpha2.TrafficSplit) {
|
||||
list.Items = gentype.FromPointerSlice(items)
|
||||
},
|
||||
),
|
||||
fake,
|
||||
}
|
||||
return obj.(*v1alpha2.TrafficSplit), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of TrafficSplits that match those selectors.
|
||||
func (c *FakeTrafficSplits) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.TrafficSplitList, err error) {
|
||||
emptyResult := &v1alpha2.TrafficSplitList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListActionWithOptions(trafficsplitsResource, trafficsplitsKind, c.ns, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1alpha2.TrafficSplitList{ListMeta: obj.(*v1alpha2.TrafficSplitList).ListMeta}
|
||||
for _, item := range obj.(*v1alpha2.TrafficSplitList).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 trafficSplits.
|
||||
func (c *FakeTrafficSplits) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchActionWithOptions(trafficsplitsResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a trafficSplit and creates it. Returns the server's representation of the trafficSplit, and an error, if there is any.
|
||||
func (c *FakeTrafficSplits) Create(ctx context.Context, trafficSplit *v1alpha2.TrafficSplit, opts v1.CreateOptions) (result *v1alpha2.TrafficSplit, err error) {
|
||||
emptyResult := &v1alpha2.TrafficSplit{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateActionWithOptions(trafficsplitsResource, c.ns, trafficSplit, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1alpha2.TrafficSplit), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a trafficSplit and updates it. Returns the server's representation of the trafficSplit, and an error, if there is any.
|
||||
func (c *FakeTrafficSplits) Update(ctx context.Context, trafficSplit *v1alpha2.TrafficSplit, opts v1.UpdateOptions) (result *v1alpha2.TrafficSplit, err error) {
|
||||
emptyResult := &v1alpha2.TrafficSplit{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateActionWithOptions(trafficsplitsResource, c.ns, trafficSplit, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1alpha2.TrafficSplit), err
|
||||
}
|
||||
|
||||
// Delete takes name of the trafficSplit and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeTrafficSplits) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteActionWithOptions(trafficsplitsResource, c.ns, name, opts), &v1alpha2.TrafficSplit{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeTrafficSplits) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionActionWithOptions(trafficsplitsResource, c.ns, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1alpha2.TrafficSplitList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched trafficSplit.
|
||||
func (c *FakeTrafficSplits) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.TrafficSplit, err error) {
|
||||
emptyResult := &v1alpha2.TrafficSplit{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(trafficsplitsResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1alpha2.TrafficSplit), err
|
||||
}
|
||||
|
||||
@@ -19,10 +19,10 @@ limitations under the License.
|
||||
package v1alpha2
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
http "net/http"
|
||||
|
||||
v1alpha2 "github.com/fluxcd/flagger/pkg/apis/smi/v1alpha2"
|
||||
"github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
smiv1alpha2 "github.com/fluxcd/flagger/pkg/apis/smi/v1alpha2"
|
||||
scheme "github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
rest "k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
@@ -45,9 +45,7 @@ func (c *SplitV1alpha2Client) TrafficSplits(namespace string) TrafficSplitInterf
|
||||
// where httpClient was generated with rest.HTTPClientFor(c).
|
||||
func NewForConfig(c *rest.Config) (*SplitV1alpha2Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
setConfigDefaults(&config)
|
||||
httpClient, err := rest.HTTPClientFor(&config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -59,9 +57,7 @@ func NewForConfig(c *rest.Config) (*SplitV1alpha2Client, error) {
|
||||
// Note the http client provided takes precedence over the configured transport values.
|
||||
func NewForConfigAndClient(c *rest.Config, h *http.Client) (*SplitV1alpha2Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
setConfigDefaults(&config)
|
||||
client, err := rest.RESTClientForConfigAndClient(&config, h)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -84,17 +80,15 @@ func New(c rest.Interface) *SplitV1alpha2Client {
|
||||
return &SplitV1alpha2Client{c}
|
||||
}
|
||||
|
||||
func setConfigDefaults(config *rest.Config) error {
|
||||
gv := v1alpha2.SchemeGroupVersion
|
||||
func setConfigDefaults(config *rest.Config) {
|
||||
gv := smiv1alpha2.SchemeGroupVersion
|
||||
config.GroupVersion = &gv
|
||||
config.APIPath = "/apis"
|
||||
config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
|
||||
config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion()
|
||||
|
||||
if config.UserAgent == "" {
|
||||
config.UserAgent = rest.DefaultKubernetesUserAgent()
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
|
||||
@@ -19,9 +19,9 @@ limitations under the License.
|
||||
package v1alpha2
|
||||
|
||||
import (
|
||||
"context"
|
||||
context "context"
|
||||
|
||||
v1alpha2 "github.com/fluxcd/flagger/pkg/apis/smi/v1alpha2"
|
||||
smiv1alpha2 "github.com/fluxcd/flagger/pkg/apis/smi/v1alpha2"
|
||||
scheme "github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
@@ -37,31 +37,32 @@ type TrafficSplitsGetter interface {
|
||||
|
||||
// TrafficSplitInterface has methods to work with TrafficSplit resources.
|
||||
type TrafficSplitInterface interface {
|
||||
Create(ctx context.Context, trafficSplit *v1alpha2.TrafficSplit, opts v1.CreateOptions) (*v1alpha2.TrafficSplit, error)
|
||||
Update(ctx context.Context, trafficSplit *v1alpha2.TrafficSplit, opts v1.UpdateOptions) (*v1alpha2.TrafficSplit, error)
|
||||
Create(ctx context.Context, trafficSplit *smiv1alpha2.TrafficSplit, opts v1.CreateOptions) (*smiv1alpha2.TrafficSplit, error)
|
||||
Update(ctx context.Context, trafficSplit *smiv1alpha2.TrafficSplit, opts v1.UpdateOptions) (*smiv1alpha2.TrafficSplit, 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) (*v1alpha2.TrafficSplit, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.TrafficSplitList, error)
|
||||
Get(ctx context.Context, name string, opts v1.GetOptions) (*smiv1alpha2.TrafficSplit, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*smiv1alpha2.TrafficSplitList, 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 *v1alpha2.TrafficSplit, err error)
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *smiv1alpha2.TrafficSplit, err error)
|
||||
TrafficSplitExpansion
|
||||
}
|
||||
|
||||
// trafficSplits implements TrafficSplitInterface
|
||||
type trafficSplits struct {
|
||||
*gentype.ClientWithList[*v1alpha2.TrafficSplit, *v1alpha2.TrafficSplitList]
|
||||
*gentype.ClientWithList[*smiv1alpha2.TrafficSplit, *smiv1alpha2.TrafficSplitList]
|
||||
}
|
||||
|
||||
// newTrafficSplits returns a TrafficSplits
|
||||
func newTrafficSplits(c *SplitV1alpha2Client, namespace string) *trafficSplits {
|
||||
return &trafficSplits{
|
||||
gentype.NewClientWithList[*v1alpha2.TrafficSplit, *v1alpha2.TrafficSplitList](
|
||||
gentype.NewClientWithList[*smiv1alpha2.TrafficSplit, *smiv1alpha2.TrafficSplitList](
|
||||
"trafficsplits",
|
||||
c.RESTClient(),
|
||||
scheme.ParameterCodec,
|
||||
namespace,
|
||||
func() *v1alpha2.TrafficSplit { return &v1alpha2.TrafficSplit{} },
|
||||
func() *v1alpha2.TrafficSplitList { return &v1alpha2.TrafficSplitList{} }),
|
||||
func() *smiv1alpha2.TrafficSplit { return &smiv1alpha2.TrafficSplit{} },
|
||||
func() *smiv1alpha2.TrafficSplitList { return &smiv1alpha2.TrafficSplitList{} },
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ type FakeSplitV1alpha3 struct {
|
||||
}
|
||||
|
||||
func (c *FakeSplitV1alpha3) TrafficSplits(namespace string) v1alpha3.TrafficSplitInterface {
|
||||
return &FakeTrafficSplits{c, namespace}
|
||||
return newFakeTrafficSplits(c, namespace)
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
|
||||
@@ -19,116 +19,34 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
v1alpha3 "github.com/fluxcd/flagger/pkg/apis/smi/v1alpha3"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
smiv1alpha3 "github.com/fluxcd/flagger/pkg/client/clientset/versioned/typed/smi/v1alpha3"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
)
|
||||
|
||||
// FakeTrafficSplits implements TrafficSplitInterface
|
||||
type FakeTrafficSplits struct {
|
||||
// fakeTrafficSplits implements TrafficSplitInterface
|
||||
type fakeTrafficSplits struct {
|
||||
*gentype.FakeClientWithList[*v1alpha3.TrafficSplit, *v1alpha3.TrafficSplitList]
|
||||
Fake *FakeSplitV1alpha3
|
||||
ns string
|
||||
}
|
||||
|
||||
var trafficsplitsResource = v1alpha3.SchemeGroupVersion.WithResource("trafficsplits")
|
||||
|
||||
var trafficsplitsKind = v1alpha3.SchemeGroupVersion.WithKind("TrafficSplit")
|
||||
|
||||
// Get takes name of the trafficSplit, and returns the corresponding trafficSplit object, and an error if there is any.
|
||||
func (c *FakeTrafficSplits) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha3.TrafficSplit, err error) {
|
||||
emptyResult := &v1alpha3.TrafficSplit{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetActionWithOptions(trafficsplitsResource, c.ns, name, options), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
func newFakeTrafficSplits(fake *FakeSplitV1alpha3, namespace string) smiv1alpha3.TrafficSplitInterface {
|
||||
return &fakeTrafficSplits{
|
||||
gentype.NewFakeClientWithList[*v1alpha3.TrafficSplit, *v1alpha3.TrafficSplitList](
|
||||
fake.Fake,
|
||||
namespace,
|
||||
v1alpha3.SchemeGroupVersion.WithResource("trafficsplits"),
|
||||
v1alpha3.SchemeGroupVersion.WithKind("TrafficSplit"),
|
||||
func() *v1alpha3.TrafficSplit { return &v1alpha3.TrafficSplit{} },
|
||||
func() *v1alpha3.TrafficSplitList { return &v1alpha3.TrafficSplitList{} },
|
||||
func(dst, src *v1alpha3.TrafficSplitList) { dst.ListMeta = src.ListMeta },
|
||||
func(list *v1alpha3.TrafficSplitList) []*v1alpha3.TrafficSplit {
|
||||
return gentype.ToPointerSlice(list.Items)
|
||||
},
|
||||
func(list *v1alpha3.TrafficSplitList, items []*v1alpha3.TrafficSplit) {
|
||||
list.Items = gentype.FromPointerSlice(items)
|
||||
},
|
||||
),
|
||||
fake,
|
||||
}
|
||||
return obj.(*v1alpha3.TrafficSplit), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of TrafficSplits that match those selectors.
|
||||
func (c *FakeTrafficSplits) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha3.TrafficSplitList, err error) {
|
||||
emptyResult := &v1alpha3.TrafficSplitList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListActionWithOptions(trafficsplitsResource, trafficsplitsKind, c.ns, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1alpha3.TrafficSplitList{ListMeta: obj.(*v1alpha3.TrafficSplitList).ListMeta}
|
||||
for _, item := range obj.(*v1alpha3.TrafficSplitList).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 trafficSplits.
|
||||
func (c *FakeTrafficSplits) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchActionWithOptions(trafficsplitsResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a trafficSplit and creates it. Returns the server's representation of the trafficSplit, and an error, if there is any.
|
||||
func (c *FakeTrafficSplits) Create(ctx context.Context, trafficSplit *v1alpha3.TrafficSplit, opts v1.CreateOptions) (result *v1alpha3.TrafficSplit, err error) {
|
||||
emptyResult := &v1alpha3.TrafficSplit{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateActionWithOptions(trafficsplitsResource, c.ns, trafficSplit, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1alpha3.TrafficSplit), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a trafficSplit and updates it. Returns the server's representation of the trafficSplit, and an error, if there is any.
|
||||
func (c *FakeTrafficSplits) Update(ctx context.Context, trafficSplit *v1alpha3.TrafficSplit, opts v1.UpdateOptions) (result *v1alpha3.TrafficSplit, err error) {
|
||||
emptyResult := &v1alpha3.TrafficSplit{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateActionWithOptions(trafficsplitsResource, c.ns, trafficSplit, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1alpha3.TrafficSplit), err
|
||||
}
|
||||
|
||||
// Delete takes name of the trafficSplit and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeTrafficSplits) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteActionWithOptions(trafficsplitsResource, c.ns, name, opts), &v1alpha3.TrafficSplit{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeTrafficSplits) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionActionWithOptions(trafficsplitsResource, c.ns, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1alpha3.TrafficSplitList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched trafficSplit.
|
||||
func (c *FakeTrafficSplits) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.TrafficSplit, err error) {
|
||||
emptyResult := &v1alpha3.TrafficSplit{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(trafficsplitsResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1alpha3.TrafficSplit), err
|
||||
}
|
||||
|
||||
@@ -19,10 +19,10 @@ limitations under the License.
|
||||
package v1alpha3
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
http "net/http"
|
||||
|
||||
v1alpha3 "github.com/fluxcd/flagger/pkg/apis/smi/v1alpha3"
|
||||
"github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
smiv1alpha3 "github.com/fluxcd/flagger/pkg/apis/smi/v1alpha3"
|
||||
scheme "github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
rest "k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
@@ -45,9 +45,7 @@ func (c *SplitV1alpha3Client) TrafficSplits(namespace string) TrafficSplitInterf
|
||||
// where httpClient was generated with rest.HTTPClientFor(c).
|
||||
func NewForConfig(c *rest.Config) (*SplitV1alpha3Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
setConfigDefaults(&config)
|
||||
httpClient, err := rest.HTTPClientFor(&config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -59,9 +57,7 @@ func NewForConfig(c *rest.Config) (*SplitV1alpha3Client, error) {
|
||||
// Note the http client provided takes precedence over the configured transport values.
|
||||
func NewForConfigAndClient(c *rest.Config, h *http.Client) (*SplitV1alpha3Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
setConfigDefaults(&config)
|
||||
client, err := rest.RESTClientForConfigAndClient(&config, h)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -84,17 +80,15 @@ func New(c rest.Interface) *SplitV1alpha3Client {
|
||||
return &SplitV1alpha3Client{c}
|
||||
}
|
||||
|
||||
func setConfigDefaults(config *rest.Config) error {
|
||||
gv := v1alpha3.SchemeGroupVersion
|
||||
func setConfigDefaults(config *rest.Config) {
|
||||
gv := smiv1alpha3.SchemeGroupVersion
|
||||
config.GroupVersion = &gv
|
||||
config.APIPath = "/apis"
|
||||
config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
|
||||
config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion()
|
||||
|
||||
if config.UserAgent == "" {
|
||||
config.UserAgent = rest.DefaultKubernetesUserAgent()
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
|
||||
@@ -19,9 +19,9 @@ limitations under the License.
|
||||
package v1alpha3
|
||||
|
||||
import (
|
||||
"context"
|
||||
context "context"
|
||||
|
||||
v1alpha3 "github.com/fluxcd/flagger/pkg/apis/smi/v1alpha3"
|
||||
smiv1alpha3 "github.com/fluxcd/flagger/pkg/apis/smi/v1alpha3"
|
||||
scheme "github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
@@ -37,31 +37,32 @@ type TrafficSplitsGetter interface {
|
||||
|
||||
// TrafficSplitInterface has methods to work with TrafficSplit resources.
|
||||
type TrafficSplitInterface interface {
|
||||
Create(ctx context.Context, trafficSplit *v1alpha3.TrafficSplit, opts v1.CreateOptions) (*v1alpha3.TrafficSplit, error)
|
||||
Update(ctx context.Context, trafficSplit *v1alpha3.TrafficSplit, opts v1.UpdateOptions) (*v1alpha3.TrafficSplit, error)
|
||||
Create(ctx context.Context, trafficSplit *smiv1alpha3.TrafficSplit, opts v1.CreateOptions) (*smiv1alpha3.TrafficSplit, error)
|
||||
Update(ctx context.Context, trafficSplit *smiv1alpha3.TrafficSplit, opts v1.UpdateOptions) (*smiv1alpha3.TrafficSplit, 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) (*v1alpha3.TrafficSplit, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*v1alpha3.TrafficSplitList, error)
|
||||
Get(ctx context.Context, name string, opts v1.GetOptions) (*smiv1alpha3.TrafficSplit, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*smiv1alpha3.TrafficSplitList, 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 *v1alpha3.TrafficSplit, err error)
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *smiv1alpha3.TrafficSplit, err error)
|
||||
TrafficSplitExpansion
|
||||
}
|
||||
|
||||
// trafficSplits implements TrafficSplitInterface
|
||||
type trafficSplits struct {
|
||||
*gentype.ClientWithList[*v1alpha3.TrafficSplit, *v1alpha3.TrafficSplitList]
|
||||
*gentype.ClientWithList[*smiv1alpha3.TrafficSplit, *smiv1alpha3.TrafficSplitList]
|
||||
}
|
||||
|
||||
// newTrafficSplits returns a TrafficSplits
|
||||
func newTrafficSplits(c *SplitV1alpha3Client, namespace string) *trafficSplits {
|
||||
return &trafficSplits{
|
||||
gentype.NewClientWithList[*v1alpha3.TrafficSplit, *v1alpha3.TrafficSplitList](
|
||||
gentype.NewClientWithList[*smiv1alpha3.TrafficSplit, *smiv1alpha3.TrafficSplitList](
|
||||
"trafficsplits",
|
||||
c.RESTClient(),
|
||||
scheme.ParameterCodec,
|
||||
namespace,
|
||||
func() *v1alpha3.TrafficSplit { return &v1alpha3.TrafficSplit{} },
|
||||
func() *v1alpha3.TrafficSplitList { return &v1alpha3.TrafficSplitList{} }),
|
||||
func() *smiv1alpha3.TrafficSplit { return &smiv1alpha3.TrafficSplit{} },
|
||||
func() *smiv1alpha3.TrafficSplitList { return &smiv1alpha3.TrafficSplitList{} },
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ type FakeTraefikV1alpha1 struct {
|
||||
}
|
||||
|
||||
func (c *FakeTraefikV1alpha1) TraefikServices(namespace string) v1alpha1.TraefikServiceInterface {
|
||||
return &FakeTraefikServices{c, namespace}
|
||||
return newFakeTraefikServices(c, namespace)
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
|
||||
@@ -19,116 +19,34 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
v1alpha1 "github.com/fluxcd/flagger/pkg/apis/traefik/v1alpha1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
traefikv1alpha1 "github.com/fluxcd/flagger/pkg/client/clientset/versioned/typed/traefik/v1alpha1"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
)
|
||||
|
||||
// FakeTraefikServices implements TraefikServiceInterface
|
||||
type FakeTraefikServices struct {
|
||||
// fakeTraefikServices implements TraefikServiceInterface
|
||||
type fakeTraefikServices struct {
|
||||
*gentype.FakeClientWithList[*v1alpha1.TraefikService, *v1alpha1.TraefikServiceList]
|
||||
Fake *FakeTraefikV1alpha1
|
||||
ns string
|
||||
}
|
||||
|
||||
var traefikservicesResource = v1alpha1.SchemeGroupVersion.WithResource("traefikservices")
|
||||
|
||||
var traefikservicesKind = v1alpha1.SchemeGroupVersion.WithKind("TraefikService")
|
||||
|
||||
// Get takes name of the traefikService, and returns the corresponding traefikService object, and an error if there is any.
|
||||
func (c *FakeTraefikServices) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.TraefikService, err error) {
|
||||
emptyResult := &v1alpha1.TraefikService{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetActionWithOptions(traefikservicesResource, c.ns, name, options), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
func newFakeTraefikServices(fake *FakeTraefikV1alpha1, namespace string) traefikv1alpha1.TraefikServiceInterface {
|
||||
return &fakeTraefikServices{
|
||||
gentype.NewFakeClientWithList[*v1alpha1.TraefikService, *v1alpha1.TraefikServiceList](
|
||||
fake.Fake,
|
||||
namespace,
|
||||
v1alpha1.SchemeGroupVersion.WithResource("traefikservices"),
|
||||
v1alpha1.SchemeGroupVersion.WithKind("TraefikService"),
|
||||
func() *v1alpha1.TraefikService { return &v1alpha1.TraefikService{} },
|
||||
func() *v1alpha1.TraefikServiceList { return &v1alpha1.TraefikServiceList{} },
|
||||
func(dst, src *v1alpha1.TraefikServiceList) { dst.ListMeta = src.ListMeta },
|
||||
func(list *v1alpha1.TraefikServiceList) []*v1alpha1.TraefikService {
|
||||
return gentype.ToPointerSlice(list.Items)
|
||||
},
|
||||
func(list *v1alpha1.TraefikServiceList, items []*v1alpha1.TraefikService) {
|
||||
list.Items = gentype.FromPointerSlice(items)
|
||||
},
|
||||
),
|
||||
fake,
|
||||
}
|
||||
return obj.(*v1alpha1.TraefikService), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of TraefikServices that match those selectors.
|
||||
func (c *FakeTraefikServices) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.TraefikServiceList, err error) {
|
||||
emptyResult := &v1alpha1.TraefikServiceList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListActionWithOptions(traefikservicesResource, traefikservicesKind, c.ns, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1alpha1.TraefikServiceList{ListMeta: obj.(*v1alpha1.TraefikServiceList).ListMeta}
|
||||
for _, item := range obj.(*v1alpha1.TraefikServiceList).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 traefikServices.
|
||||
func (c *FakeTraefikServices) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchActionWithOptions(traefikservicesResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a traefikService and creates it. Returns the server's representation of the traefikService, and an error, if there is any.
|
||||
func (c *FakeTraefikServices) Create(ctx context.Context, traefikService *v1alpha1.TraefikService, opts v1.CreateOptions) (result *v1alpha1.TraefikService, err error) {
|
||||
emptyResult := &v1alpha1.TraefikService{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateActionWithOptions(traefikservicesResource, c.ns, traefikService, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1alpha1.TraefikService), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a traefikService and updates it. Returns the server's representation of the traefikService, and an error, if there is any.
|
||||
func (c *FakeTraefikServices) Update(ctx context.Context, traefikService *v1alpha1.TraefikService, opts v1.UpdateOptions) (result *v1alpha1.TraefikService, err error) {
|
||||
emptyResult := &v1alpha1.TraefikService{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateActionWithOptions(traefikservicesResource, c.ns, traefikService, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1alpha1.TraefikService), err
|
||||
}
|
||||
|
||||
// Delete takes name of the traefikService and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeTraefikServices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteActionWithOptions(traefikservicesResource, c.ns, name, opts), &v1alpha1.TraefikService{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeTraefikServices) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionActionWithOptions(traefikservicesResource, c.ns, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1alpha1.TraefikServiceList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched traefikService.
|
||||
func (c *FakeTraefikServices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.TraefikService, err error) {
|
||||
emptyResult := &v1alpha1.TraefikService{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(traefikservicesResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1alpha1.TraefikService), err
|
||||
}
|
||||
|
||||
@@ -19,10 +19,10 @@ limitations under the License.
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
http "net/http"
|
||||
|
||||
v1alpha1 "github.com/fluxcd/flagger/pkg/apis/traefik/v1alpha1"
|
||||
"github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
traefikv1alpha1 "github.com/fluxcd/flagger/pkg/apis/traefik/v1alpha1"
|
||||
scheme "github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
rest "k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
@@ -45,9 +45,7 @@ func (c *TraefikV1alpha1Client) TraefikServices(namespace string) TraefikService
|
||||
// where httpClient was generated with rest.HTTPClientFor(c).
|
||||
func NewForConfig(c *rest.Config) (*TraefikV1alpha1Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
setConfigDefaults(&config)
|
||||
httpClient, err := rest.HTTPClientFor(&config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -59,9 +57,7 @@ func NewForConfig(c *rest.Config) (*TraefikV1alpha1Client, error) {
|
||||
// Note the http client provided takes precedence over the configured transport values.
|
||||
func NewForConfigAndClient(c *rest.Config, h *http.Client) (*TraefikV1alpha1Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
setConfigDefaults(&config)
|
||||
client, err := rest.RESTClientForConfigAndClient(&config, h)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -84,17 +80,15 @@ func New(c rest.Interface) *TraefikV1alpha1Client {
|
||||
return &TraefikV1alpha1Client{c}
|
||||
}
|
||||
|
||||
func setConfigDefaults(config *rest.Config) error {
|
||||
gv := v1alpha1.SchemeGroupVersion
|
||||
func setConfigDefaults(config *rest.Config) {
|
||||
gv := traefikv1alpha1.SchemeGroupVersion
|
||||
config.GroupVersion = &gv
|
||||
config.APIPath = "/apis"
|
||||
config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
|
||||
config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion()
|
||||
|
||||
if config.UserAgent == "" {
|
||||
config.UserAgent = rest.DefaultKubernetesUserAgent()
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
|
||||
@@ -19,9 +19,9 @@ limitations under the License.
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"context"
|
||||
context "context"
|
||||
|
||||
v1alpha1 "github.com/fluxcd/flagger/pkg/apis/traefik/v1alpha1"
|
||||
traefikv1alpha1 "github.com/fluxcd/flagger/pkg/apis/traefik/v1alpha1"
|
||||
scheme "github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
@@ -37,31 +37,32 @@ type TraefikServicesGetter interface {
|
||||
|
||||
// TraefikServiceInterface has methods to work with TraefikService resources.
|
||||
type TraefikServiceInterface interface {
|
||||
Create(ctx context.Context, traefikService *v1alpha1.TraefikService, opts v1.CreateOptions) (*v1alpha1.TraefikService, error)
|
||||
Update(ctx context.Context, traefikService *v1alpha1.TraefikService, opts v1.UpdateOptions) (*v1alpha1.TraefikService, error)
|
||||
Create(ctx context.Context, traefikService *traefikv1alpha1.TraefikService, opts v1.CreateOptions) (*traefikv1alpha1.TraefikService, error)
|
||||
Update(ctx context.Context, traefikService *traefikv1alpha1.TraefikService, opts v1.UpdateOptions) (*traefikv1alpha1.TraefikService, 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.TraefikService, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.TraefikServiceList, error)
|
||||
Get(ctx context.Context, name string, opts v1.GetOptions) (*traefikv1alpha1.TraefikService, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*traefikv1alpha1.TraefikServiceList, 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.TraefikService, err error)
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *traefikv1alpha1.TraefikService, err error)
|
||||
TraefikServiceExpansion
|
||||
}
|
||||
|
||||
// traefikServices implements TraefikServiceInterface
|
||||
type traefikServices struct {
|
||||
*gentype.ClientWithList[*v1alpha1.TraefikService, *v1alpha1.TraefikServiceList]
|
||||
*gentype.ClientWithList[*traefikv1alpha1.TraefikService, *traefikv1alpha1.TraefikServiceList]
|
||||
}
|
||||
|
||||
// newTraefikServices returns a TraefikServices
|
||||
func newTraefikServices(c *TraefikV1alpha1Client, namespace string) *traefikServices {
|
||||
return &traefikServices{
|
||||
gentype.NewClientWithList[*v1alpha1.TraefikService, *v1alpha1.TraefikServiceList](
|
||||
gentype.NewClientWithList[*traefikv1alpha1.TraefikService, *traefikv1alpha1.TraefikServiceList](
|
||||
"traefikservices",
|
||||
c.RESTClient(),
|
||||
scheme.ParameterCodec,
|
||||
namespace,
|
||||
func() *v1alpha1.TraefikService { return &v1alpha1.TraefikService{} },
|
||||
func() *v1alpha1.TraefikServiceList { return &v1alpha1.TraefikServiceList{} }),
|
||||
func() *traefikv1alpha1.TraefikService { return &traefikv1alpha1.TraefikService{} },
|
||||
func() *traefikv1alpha1.TraefikServiceList { return &traefikv1alpha1.TraefikServiceList{} },
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,13 +19,13 @@ limitations under the License.
|
||||
package v2
|
||||
|
||||
import (
|
||||
"context"
|
||||
context "context"
|
||||
time "time"
|
||||
|
||||
apisixv2 "github.com/fluxcd/flagger/pkg/apis/apisix/v2"
|
||||
apisapisixv2 "github.com/fluxcd/flagger/pkg/apis/apisix/v2"
|
||||
versioned "github.com/fluxcd/flagger/pkg/client/clientset/versioned"
|
||||
internalinterfaces "github.com/fluxcd/flagger/pkg/client/informers/externalversions/internalinterfaces"
|
||||
v2 "github.com/fluxcd/flagger/pkg/client/listers/apisix/v2"
|
||||
apisixv2 "github.com/fluxcd/flagger/pkg/client/listers/apisix/v2"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
@@ -36,7 +36,7 @@ import (
|
||||
// ApisixRoutes.
|
||||
type ApisixRouteInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() v2.ApisixRouteLister
|
||||
Lister() apisixv2.ApisixRouteLister
|
||||
}
|
||||
|
||||
type apisixRouteInformer struct {
|
||||
@@ -62,16 +62,28 @@ func NewFilteredApisixRouteInformer(client versioned.Interface, namespace string
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ApisixV2().ApisixRoutes(namespace).List(context.TODO(), options)
|
||||
return client.ApisixV2().ApisixRoutes(namespace).List(context.Background(), options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ApisixV2().ApisixRoutes(namespace).Watch(context.TODO(), options)
|
||||
return client.ApisixV2().ApisixRoutes(namespace).Watch(context.Background(), options)
|
||||
},
|
||||
ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ApisixV2().ApisixRoutes(namespace).List(ctx, options)
|
||||
},
|
||||
WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ApisixV2().ApisixRoutes(namespace).Watch(ctx, options)
|
||||
},
|
||||
},
|
||||
&apisixv2.ApisixRoute{},
|
||||
&apisapisixv2.ApisixRoute{},
|
||||
resyncPeriod,
|
||||
indexers,
|
||||
)
|
||||
@@ -82,9 +94,9 @@ func (f *apisixRouteInformer) defaultInformer(client versioned.Interface, resync
|
||||
}
|
||||
|
||||
func (f *apisixRouteInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&apisixv2.ApisixRoute{}, f.defaultInformer)
|
||||
return f.factory.InformerFor(&apisapisixv2.ApisixRoute{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *apisixRouteInformer) Lister() v2.ApisixRouteLister {
|
||||
return v2.NewApisixRouteLister(f.Informer().GetIndexer())
|
||||
func (f *apisixRouteInformer) Lister() apisixv2.ApisixRouteLister {
|
||||
return apisixv2.NewApisixRouteLister(f.Informer().GetIndexer())
|
||||
}
|
||||
|
||||
@@ -19,13 +19,13 @@ limitations under the License.
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
"context"
|
||||
context "context"
|
||||
time "time"
|
||||
|
||||
appmeshv1beta1 "github.com/fluxcd/flagger/pkg/apis/appmesh/v1beta1"
|
||||
apisappmeshv1beta1 "github.com/fluxcd/flagger/pkg/apis/appmesh/v1beta1"
|
||||
versioned "github.com/fluxcd/flagger/pkg/client/clientset/versioned"
|
||||
internalinterfaces "github.com/fluxcd/flagger/pkg/client/informers/externalversions/internalinterfaces"
|
||||
v1beta1 "github.com/fluxcd/flagger/pkg/client/listers/appmesh/v1beta1"
|
||||
appmeshv1beta1 "github.com/fluxcd/flagger/pkg/client/listers/appmesh/v1beta1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
@@ -36,7 +36,7 @@ import (
|
||||
// Meshes.
|
||||
type MeshInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() v1beta1.MeshLister
|
||||
Lister() appmeshv1beta1.MeshLister
|
||||
}
|
||||
|
||||
type meshInformer struct {
|
||||
@@ -61,16 +61,28 @@ func NewFilteredMeshInformer(client versioned.Interface, resyncPeriod time.Durat
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.AppmeshV1beta1().Meshes().List(context.TODO(), options)
|
||||
return client.AppmeshV1beta1().Meshes().List(context.Background(), options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.AppmeshV1beta1().Meshes().Watch(context.TODO(), options)
|
||||
return client.AppmeshV1beta1().Meshes().Watch(context.Background(), options)
|
||||
},
|
||||
ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.AppmeshV1beta1().Meshes().List(ctx, options)
|
||||
},
|
||||
WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.AppmeshV1beta1().Meshes().Watch(ctx, options)
|
||||
},
|
||||
},
|
||||
&appmeshv1beta1.Mesh{},
|
||||
&apisappmeshv1beta1.Mesh{},
|
||||
resyncPeriod,
|
||||
indexers,
|
||||
)
|
||||
@@ -81,9 +93,9 @@ func (f *meshInformer) defaultInformer(client versioned.Interface, resyncPeriod
|
||||
}
|
||||
|
||||
func (f *meshInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&appmeshv1beta1.Mesh{}, f.defaultInformer)
|
||||
return f.factory.InformerFor(&apisappmeshv1beta1.Mesh{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *meshInformer) Lister() v1beta1.MeshLister {
|
||||
return v1beta1.NewMeshLister(f.Informer().GetIndexer())
|
||||
func (f *meshInformer) Lister() appmeshv1beta1.MeshLister {
|
||||
return appmeshv1beta1.NewMeshLister(f.Informer().GetIndexer())
|
||||
}
|
||||
|
||||
@@ -19,13 +19,13 @@ limitations under the License.
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
"context"
|
||||
context "context"
|
||||
time "time"
|
||||
|
||||
appmeshv1beta1 "github.com/fluxcd/flagger/pkg/apis/appmesh/v1beta1"
|
||||
apisappmeshv1beta1 "github.com/fluxcd/flagger/pkg/apis/appmesh/v1beta1"
|
||||
versioned "github.com/fluxcd/flagger/pkg/client/clientset/versioned"
|
||||
internalinterfaces "github.com/fluxcd/flagger/pkg/client/informers/externalversions/internalinterfaces"
|
||||
v1beta1 "github.com/fluxcd/flagger/pkg/client/listers/appmesh/v1beta1"
|
||||
appmeshv1beta1 "github.com/fluxcd/flagger/pkg/client/listers/appmesh/v1beta1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
@@ -36,7 +36,7 @@ import (
|
||||
// VirtualNodes.
|
||||
type VirtualNodeInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() v1beta1.VirtualNodeLister
|
||||
Lister() appmeshv1beta1.VirtualNodeLister
|
||||
}
|
||||
|
||||
type virtualNodeInformer struct {
|
||||
@@ -62,16 +62,28 @@ func NewFilteredVirtualNodeInformer(client versioned.Interface, namespace string
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.AppmeshV1beta1().VirtualNodes(namespace).List(context.TODO(), options)
|
||||
return client.AppmeshV1beta1().VirtualNodes(namespace).List(context.Background(), options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.AppmeshV1beta1().VirtualNodes(namespace).Watch(context.TODO(), options)
|
||||
return client.AppmeshV1beta1().VirtualNodes(namespace).Watch(context.Background(), options)
|
||||
},
|
||||
ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.AppmeshV1beta1().VirtualNodes(namespace).List(ctx, options)
|
||||
},
|
||||
WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.AppmeshV1beta1().VirtualNodes(namespace).Watch(ctx, options)
|
||||
},
|
||||
},
|
||||
&appmeshv1beta1.VirtualNode{},
|
||||
&apisappmeshv1beta1.VirtualNode{},
|
||||
resyncPeriod,
|
||||
indexers,
|
||||
)
|
||||
@@ -82,9 +94,9 @@ func (f *virtualNodeInformer) defaultInformer(client versioned.Interface, resync
|
||||
}
|
||||
|
||||
func (f *virtualNodeInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&appmeshv1beta1.VirtualNode{}, f.defaultInformer)
|
||||
return f.factory.InformerFor(&apisappmeshv1beta1.VirtualNode{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *virtualNodeInformer) Lister() v1beta1.VirtualNodeLister {
|
||||
return v1beta1.NewVirtualNodeLister(f.Informer().GetIndexer())
|
||||
func (f *virtualNodeInformer) Lister() appmeshv1beta1.VirtualNodeLister {
|
||||
return appmeshv1beta1.NewVirtualNodeLister(f.Informer().GetIndexer())
|
||||
}
|
||||
|
||||
@@ -19,13 +19,13 @@ limitations under the License.
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
"context"
|
||||
context "context"
|
||||
time "time"
|
||||
|
||||
appmeshv1beta1 "github.com/fluxcd/flagger/pkg/apis/appmesh/v1beta1"
|
||||
apisappmeshv1beta1 "github.com/fluxcd/flagger/pkg/apis/appmesh/v1beta1"
|
||||
versioned "github.com/fluxcd/flagger/pkg/client/clientset/versioned"
|
||||
internalinterfaces "github.com/fluxcd/flagger/pkg/client/informers/externalversions/internalinterfaces"
|
||||
v1beta1 "github.com/fluxcd/flagger/pkg/client/listers/appmesh/v1beta1"
|
||||
appmeshv1beta1 "github.com/fluxcd/flagger/pkg/client/listers/appmesh/v1beta1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
@@ -36,7 +36,7 @@ import (
|
||||
// VirtualServices.
|
||||
type VirtualServiceInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() v1beta1.VirtualServiceLister
|
||||
Lister() appmeshv1beta1.VirtualServiceLister
|
||||
}
|
||||
|
||||
type virtualServiceInformer struct {
|
||||
@@ -62,16 +62,28 @@ func NewFilteredVirtualServiceInformer(client versioned.Interface, namespace str
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.AppmeshV1beta1().VirtualServices(namespace).List(context.TODO(), options)
|
||||
return client.AppmeshV1beta1().VirtualServices(namespace).List(context.Background(), options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.AppmeshV1beta1().VirtualServices(namespace).Watch(context.TODO(), options)
|
||||
return client.AppmeshV1beta1().VirtualServices(namespace).Watch(context.Background(), options)
|
||||
},
|
||||
ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.AppmeshV1beta1().VirtualServices(namespace).List(ctx, options)
|
||||
},
|
||||
WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.AppmeshV1beta1().VirtualServices(namespace).Watch(ctx, options)
|
||||
},
|
||||
},
|
||||
&appmeshv1beta1.VirtualService{},
|
||||
&apisappmeshv1beta1.VirtualService{},
|
||||
resyncPeriod,
|
||||
indexers,
|
||||
)
|
||||
@@ -82,9 +94,9 @@ func (f *virtualServiceInformer) defaultInformer(client versioned.Interface, res
|
||||
}
|
||||
|
||||
func (f *virtualServiceInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&appmeshv1beta1.VirtualService{}, f.defaultInformer)
|
||||
return f.factory.InformerFor(&apisappmeshv1beta1.VirtualService{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *virtualServiceInformer) Lister() v1beta1.VirtualServiceLister {
|
||||
return v1beta1.NewVirtualServiceLister(f.Informer().GetIndexer())
|
||||
func (f *virtualServiceInformer) Lister() appmeshv1beta1.VirtualServiceLister {
|
||||
return appmeshv1beta1.NewVirtualServiceLister(f.Informer().GetIndexer())
|
||||
}
|
||||
|
||||
@@ -19,13 +19,13 @@ limitations under the License.
|
||||
package v1beta2
|
||||
|
||||
import (
|
||||
"context"
|
||||
context "context"
|
||||
time "time"
|
||||
|
||||
appmeshv1beta2 "github.com/fluxcd/flagger/pkg/apis/appmesh/v1beta2"
|
||||
apisappmeshv1beta2 "github.com/fluxcd/flagger/pkg/apis/appmesh/v1beta2"
|
||||
versioned "github.com/fluxcd/flagger/pkg/client/clientset/versioned"
|
||||
internalinterfaces "github.com/fluxcd/flagger/pkg/client/informers/externalversions/internalinterfaces"
|
||||
v1beta2 "github.com/fluxcd/flagger/pkg/client/listers/appmesh/v1beta2"
|
||||
appmeshv1beta2 "github.com/fluxcd/flagger/pkg/client/listers/appmesh/v1beta2"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
@@ -36,7 +36,7 @@ import (
|
||||
// VirtualNodes.
|
||||
type VirtualNodeInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() v1beta2.VirtualNodeLister
|
||||
Lister() appmeshv1beta2.VirtualNodeLister
|
||||
}
|
||||
|
||||
type virtualNodeInformer struct {
|
||||
@@ -62,16 +62,28 @@ func NewFilteredVirtualNodeInformer(client versioned.Interface, namespace string
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.AppmeshV1beta2().VirtualNodes(namespace).List(context.TODO(), options)
|
||||
return client.AppmeshV1beta2().VirtualNodes(namespace).List(context.Background(), options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.AppmeshV1beta2().VirtualNodes(namespace).Watch(context.TODO(), options)
|
||||
return client.AppmeshV1beta2().VirtualNodes(namespace).Watch(context.Background(), options)
|
||||
},
|
||||
ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.AppmeshV1beta2().VirtualNodes(namespace).List(ctx, options)
|
||||
},
|
||||
WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.AppmeshV1beta2().VirtualNodes(namespace).Watch(ctx, options)
|
||||
},
|
||||
},
|
||||
&appmeshv1beta2.VirtualNode{},
|
||||
&apisappmeshv1beta2.VirtualNode{},
|
||||
resyncPeriod,
|
||||
indexers,
|
||||
)
|
||||
@@ -82,9 +94,9 @@ func (f *virtualNodeInformer) defaultInformer(client versioned.Interface, resync
|
||||
}
|
||||
|
||||
func (f *virtualNodeInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&appmeshv1beta2.VirtualNode{}, f.defaultInformer)
|
||||
return f.factory.InformerFor(&apisappmeshv1beta2.VirtualNode{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *virtualNodeInformer) Lister() v1beta2.VirtualNodeLister {
|
||||
return v1beta2.NewVirtualNodeLister(f.Informer().GetIndexer())
|
||||
func (f *virtualNodeInformer) Lister() appmeshv1beta2.VirtualNodeLister {
|
||||
return appmeshv1beta2.NewVirtualNodeLister(f.Informer().GetIndexer())
|
||||
}
|
||||
|
||||
@@ -19,13 +19,13 @@ limitations under the License.
|
||||
package v1beta2
|
||||
|
||||
import (
|
||||
"context"
|
||||
context "context"
|
||||
time "time"
|
||||
|
||||
appmeshv1beta2 "github.com/fluxcd/flagger/pkg/apis/appmesh/v1beta2"
|
||||
apisappmeshv1beta2 "github.com/fluxcd/flagger/pkg/apis/appmesh/v1beta2"
|
||||
versioned "github.com/fluxcd/flagger/pkg/client/clientset/versioned"
|
||||
internalinterfaces "github.com/fluxcd/flagger/pkg/client/informers/externalversions/internalinterfaces"
|
||||
v1beta2 "github.com/fluxcd/flagger/pkg/client/listers/appmesh/v1beta2"
|
||||
appmeshv1beta2 "github.com/fluxcd/flagger/pkg/client/listers/appmesh/v1beta2"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
@@ -36,7 +36,7 @@ import (
|
||||
// VirtualRouters.
|
||||
type VirtualRouterInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() v1beta2.VirtualRouterLister
|
||||
Lister() appmeshv1beta2.VirtualRouterLister
|
||||
}
|
||||
|
||||
type virtualRouterInformer struct {
|
||||
@@ -62,16 +62,28 @@ func NewFilteredVirtualRouterInformer(client versioned.Interface, namespace stri
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.AppmeshV1beta2().VirtualRouters(namespace).List(context.TODO(), options)
|
||||
return client.AppmeshV1beta2().VirtualRouters(namespace).List(context.Background(), options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.AppmeshV1beta2().VirtualRouters(namespace).Watch(context.TODO(), options)
|
||||
return client.AppmeshV1beta2().VirtualRouters(namespace).Watch(context.Background(), options)
|
||||
},
|
||||
ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.AppmeshV1beta2().VirtualRouters(namespace).List(ctx, options)
|
||||
},
|
||||
WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.AppmeshV1beta2().VirtualRouters(namespace).Watch(ctx, options)
|
||||
},
|
||||
},
|
||||
&appmeshv1beta2.VirtualRouter{},
|
||||
&apisappmeshv1beta2.VirtualRouter{},
|
||||
resyncPeriod,
|
||||
indexers,
|
||||
)
|
||||
@@ -82,9 +94,9 @@ func (f *virtualRouterInformer) defaultInformer(client versioned.Interface, resy
|
||||
}
|
||||
|
||||
func (f *virtualRouterInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&appmeshv1beta2.VirtualRouter{}, f.defaultInformer)
|
||||
return f.factory.InformerFor(&apisappmeshv1beta2.VirtualRouter{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *virtualRouterInformer) Lister() v1beta2.VirtualRouterLister {
|
||||
return v1beta2.NewVirtualRouterLister(f.Informer().GetIndexer())
|
||||
func (f *virtualRouterInformer) Lister() appmeshv1beta2.VirtualRouterLister {
|
||||
return appmeshv1beta2.NewVirtualRouterLister(f.Informer().GetIndexer())
|
||||
}
|
||||
|
||||
@@ -19,13 +19,13 @@ limitations under the License.
|
||||
package v1beta2
|
||||
|
||||
import (
|
||||
"context"
|
||||
context "context"
|
||||
time "time"
|
||||
|
||||
appmeshv1beta2 "github.com/fluxcd/flagger/pkg/apis/appmesh/v1beta2"
|
||||
apisappmeshv1beta2 "github.com/fluxcd/flagger/pkg/apis/appmesh/v1beta2"
|
||||
versioned "github.com/fluxcd/flagger/pkg/client/clientset/versioned"
|
||||
internalinterfaces "github.com/fluxcd/flagger/pkg/client/informers/externalversions/internalinterfaces"
|
||||
v1beta2 "github.com/fluxcd/flagger/pkg/client/listers/appmesh/v1beta2"
|
||||
appmeshv1beta2 "github.com/fluxcd/flagger/pkg/client/listers/appmesh/v1beta2"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
@@ -36,7 +36,7 @@ import (
|
||||
// VirtualServices.
|
||||
type VirtualServiceInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() v1beta2.VirtualServiceLister
|
||||
Lister() appmeshv1beta2.VirtualServiceLister
|
||||
}
|
||||
|
||||
type virtualServiceInformer struct {
|
||||
@@ -62,16 +62,28 @@ func NewFilteredVirtualServiceInformer(client versioned.Interface, namespace str
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.AppmeshV1beta2().VirtualServices(namespace).List(context.TODO(), options)
|
||||
return client.AppmeshV1beta2().VirtualServices(namespace).List(context.Background(), options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.AppmeshV1beta2().VirtualServices(namespace).Watch(context.TODO(), options)
|
||||
return client.AppmeshV1beta2().VirtualServices(namespace).Watch(context.Background(), options)
|
||||
},
|
||||
ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.AppmeshV1beta2().VirtualServices(namespace).List(ctx, options)
|
||||
},
|
||||
WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.AppmeshV1beta2().VirtualServices(namespace).Watch(ctx, options)
|
||||
},
|
||||
},
|
||||
&appmeshv1beta2.VirtualService{},
|
||||
&apisappmeshv1beta2.VirtualService{},
|
||||
resyncPeriod,
|
||||
indexers,
|
||||
)
|
||||
@@ -82,9 +94,9 @@ func (f *virtualServiceInformer) defaultInformer(client versioned.Interface, res
|
||||
}
|
||||
|
||||
func (f *virtualServiceInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&appmeshv1beta2.VirtualService{}, f.defaultInformer)
|
||||
return f.factory.InformerFor(&apisappmeshv1beta2.VirtualService{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *virtualServiceInformer) Lister() v1beta2.VirtualServiceLister {
|
||||
return v1beta2.NewVirtualServiceLister(f.Informer().GetIndexer())
|
||||
func (f *virtualServiceInformer) Lister() appmeshv1beta2.VirtualServiceLister {
|
||||
return appmeshv1beta2.NewVirtualServiceLister(f.Informer().GetIndexer())
|
||||
}
|
||||
|
||||
@@ -19,13 +19,13 @@ limitations under the License.
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
"context"
|
||||
context "context"
|
||||
time "time"
|
||||
|
||||
flaggerv1beta1 "github.com/fluxcd/flagger/pkg/apis/flagger/v1beta1"
|
||||
apisflaggerv1beta1 "github.com/fluxcd/flagger/pkg/apis/flagger/v1beta1"
|
||||
versioned "github.com/fluxcd/flagger/pkg/client/clientset/versioned"
|
||||
internalinterfaces "github.com/fluxcd/flagger/pkg/client/informers/externalversions/internalinterfaces"
|
||||
v1beta1 "github.com/fluxcd/flagger/pkg/client/listers/flagger/v1beta1"
|
||||
flaggerv1beta1 "github.com/fluxcd/flagger/pkg/client/listers/flagger/v1beta1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
@@ -36,7 +36,7 @@ import (
|
||||
// AlertProviders.
|
||||
type AlertProviderInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() v1beta1.AlertProviderLister
|
||||
Lister() flaggerv1beta1.AlertProviderLister
|
||||
}
|
||||
|
||||
type alertProviderInformer struct {
|
||||
@@ -62,16 +62,28 @@ func NewFilteredAlertProviderInformer(client versioned.Interface, namespace stri
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.FlaggerV1beta1().AlertProviders(namespace).List(context.TODO(), options)
|
||||
return client.FlaggerV1beta1().AlertProviders(namespace).List(context.Background(), options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.FlaggerV1beta1().AlertProviders(namespace).Watch(context.TODO(), options)
|
||||
return client.FlaggerV1beta1().AlertProviders(namespace).Watch(context.Background(), options)
|
||||
},
|
||||
ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.FlaggerV1beta1().AlertProviders(namespace).List(ctx, options)
|
||||
},
|
||||
WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.FlaggerV1beta1().AlertProviders(namespace).Watch(ctx, options)
|
||||
},
|
||||
},
|
||||
&flaggerv1beta1.AlertProvider{},
|
||||
&apisflaggerv1beta1.AlertProvider{},
|
||||
resyncPeriod,
|
||||
indexers,
|
||||
)
|
||||
@@ -82,9 +94,9 @@ func (f *alertProviderInformer) defaultInformer(client versioned.Interface, resy
|
||||
}
|
||||
|
||||
func (f *alertProviderInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&flaggerv1beta1.AlertProvider{}, f.defaultInformer)
|
||||
return f.factory.InformerFor(&apisflaggerv1beta1.AlertProvider{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *alertProviderInformer) Lister() v1beta1.AlertProviderLister {
|
||||
return v1beta1.NewAlertProviderLister(f.Informer().GetIndexer())
|
||||
func (f *alertProviderInformer) Lister() flaggerv1beta1.AlertProviderLister {
|
||||
return flaggerv1beta1.NewAlertProviderLister(f.Informer().GetIndexer())
|
||||
}
|
||||
|
||||
@@ -19,13 +19,13 @@ limitations under the License.
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
"context"
|
||||
context "context"
|
||||
time "time"
|
||||
|
||||
flaggerv1beta1 "github.com/fluxcd/flagger/pkg/apis/flagger/v1beta1"
|
||||
apisflaggerv1beta1 "github.com/fluxcd/flagger/pkg/apis/flagger/v1beta1"
|
||||
versioned "github.com/fluxcd/flagger/pkg/client/clientset/versioned"
|
||||
internalinterfaces "github.com/fluxcd/flagger/pkg/client/informers/externalversions/internalinterfaces"
|
||||
v1beta1 "github.com/fluxcd/flagger/pkg/client/listers/flagger/v1beta1"
|
||||
flaggerv1beta1 "github.com/fluxcd/flagger/pkg/client/listers/flagger/v1beta1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
@@ -36,7 +36,7 @@ import (
|
||||
// Canaries.
|
||||
type CanaryInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() v1beta1.CanaryLister
|
||||
Lister() flaggerv1beta1.CanaryLister
|
||||
}
|
||||
|
||||
type canaryInformer struct {
|
||||
@@ -62,16 +62,28 @@ func NewFilteredCanaryInformer(client versioned.Interface, namespace string, res
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.FlaggerV1beta1().Canaries(namespace).List(context.TODO(), options)
|
||||
return client.FlaggerV1beta1().Canaries(namespace).List(context.Background(), options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.FlaggerV1beta1().Canaries(namespace).Watch(context.TODO(), options)
|
||||
return client.FlaggerV1beta1().Canaries(namespace).Watch(context.Background(), options)
|
||||
},
|
||||
ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.FlaggerV1beta1().Canaries(namespace).List(ctx, options)
|
||||
},
|
||||
WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.FlaggerV1beta1().Canaries(namespace).Watch(ctx, options)
|
||||
},
|
||||
},
|
||||
&flaggerv1beta1.Canary{},
|
||||
&apisflaggerv1beta1.Canary{},
|
||||
resyncPeriod,
|
||||
indexers,
|
||||
)
|
||||
@@ -82,9 +94,9 @@ func (f *canaryInformer) defaultInformer(client versioned.Interface, resyncPerio
|
||||
}
|
||||
|
||||
func (f *canaryInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&flaggerv1beta1.Canary{}, f.defaultInformer)
|
||||
return f.factory.InformerFor(&apisflaggerv1beta1.Canary{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *canaryInformer) Lister() v1beta1.CanaryLister {
|
||||
return v1beta1.NewCanaryLister(f.Informer().GetIndexer())
|
||||
func (f *canaryInformer) Lister() flaggerv1beta1.CanaryLister {
|
||||
return flaggerv1beta1.NewCanaryLister(f.Informer().GetIndexer())
|
||||
}
|
||||
|
||||
@@ -19,13 +19,13 @@ limitations under the License.
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
"context"
|
||||
context "context"
|
||||
time "time"
|
||||
|
||||
flaggerv1beta1 "github.com/fluxcd/flagger/pkg/apis/flagger/v1beta1"
|
||||
apisflaggerv1beta1 "github.com/fluxcd/flagger/pkg/apis/flagger/v1beta1"
|
||||
versioned "github.com/fluxcd/flagger/pkg/client/clientset/versioned"
|
||||
internalinterfaces "github.com/fluxcd/flagger/pkg/client/informers/externalversions/internalinterfaces"
|
||||
v1beta1 "github.com/fluxcd/flagger/pkg/client/listers/flagger/v1beta1"
|
||||
flaggerv1beta1 "github.com/fluxcd/flagger/pkg/client/listers/flagger/v1beta1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
@@ -36,7 +36,7 @@ import (
|
||||
// MetricTemplates.
|
||||
type MetricTemplateInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() v1beta1.MetricTemplateLister
|
||||
Lister() flaggerv1beta1.MetricTemplateLister
|
||||
}
|
||||
|
||||
type metricTemplateInformer struct {
|
||||
@@ -62,16 +62,28 @@ func NewFilteredMetricTemplateInformer(client versioned.Interface, namespace str
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.FlaggerV1beta1().MetricTemplates(namespace).List(context.TODO(), options)
|
||||
return client.FlaggerV1beta1().MetricTemplates(namespace).List(context.Background(), options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.FlaggerV1beta1().MetricTemplates(namespace).Watch(context.TODO(), options)
|
||||
return client.FlaggerV1beta1().MetricTemplates(namespace).Watch(context.Background(), options)
|
||||
},
|
||||
ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.FlaggerV1beta1().MetricTemplates(namespace).List(ctx, options)
|
||||
},
|
||||
WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.FlaggerV1beta1().MetricTemplates(namespace).Watch(ctx, options)
|
||||
},
|
||||
},
|
||||
&flaggerv1beta1.MetricTemplate{},
|
||||
&apisflaggerv1beta1.MetricTemplate{},
|
||||
resyncPeriod,
|
||||
indexers,
|
||||
)
|
||||
@@ -82,9 +94,9 @@ func (f *metricTemplateInformer) defaultInformer(client versioned.Interface, res
|
||||
}
|
||||
|
||||
func (f *metricTemplateInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&flaggerv1beta1.MetricTemplate{}, f.defaultInformer)
|
||||
return f.factory.InformerFor(&apisflaggerv1beta1.MetricTemplate{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *metricTemplateInformer) Lister() v1beta1.MetricTemplateLister {
|
||||
return v1beta1.NewMetricTemplateLister(f.Informer().GetIndexer())
|
||||
func (f *metricTemplateInformer) Lister() flaggerv1beta1.MetricTemplateLister {
|
||||
return flaggerv1beta1.NewMetricTemplateLister(f.Informer().GetIndexer())
|
||||
}
|
||||
|
||||
@@ -19,13 +19,13 @@ limitations under the License.
|
||||
package v1
|
||||
|
||||
import (
|
||||
"context"
|
||||
context "context"
|
||||
time "time"
|
||||
|
||||
gatewayapiv1 "github.com/fluxcd/flagger/pkg/apis/gatewayapi/v1"
|
||||
apisgatewayapiv1 "github.com/fluxcd/flagger/pkg/apis/gatewayapi/v1"
|
||||
versioned "github.com/fluxcd/flagger/pkg/client/clientset/versioned"
|
||||
internalinterfaces "github.com/fluxcd/flagger/pkg/client/informers/externalversions/internalinterfaces"
|
||||
v1 "github.com/fluxcd/flagger/pkg/client/listers/gatewayapi/v1"
|
||||
gatewayapiv1 "github.com/fluxcd/flagger/pkg/client/listers/gatewayapi/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
@@ -36,7 +36,7 @@ import (
|
||||
// HTTPRoutes.
|
||||
type HTTPRouteInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() v1.HTTPRouteLister
|
||||
Lister() gatewayapiv1.HTTPRouteLister
|
||||
}
|
||||
|
||||
type hTTPRouteInformer struct {
|
||||
@@ -62,16 +62,28 @@ func NewFilteredHTTPRouteInformer(client versioned.Interface, namespace string,
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.GatewayapiV1().HTTPRoutes(namespace).List(context.TODO(), options)
|
||||
return client.GatewayapiV1().HTTPRoutes(namespace).List(context.Background(), options)
|
||||
},
|
||||
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.GatewayapiV1().HTTPRoutes(namespace).Watch(context.TODO(), options)
|
||||
return client.GatewayapiV1().HTTPRoutes(namespace).Watch(context.Background(), options)
|
||||
},
|
||||
ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.GatewayapiV1().HTTPRoutes(namespace).List(ctx, options)
|
||||
},
|
||||
WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.GatewayapiV1().HTTPRoutes(namespace).Watch(ctx, options)
|
||||
},
|
||||
},
|
||||
&gatewayapiv1.HTTPRoute{},
|
||||
&apisgatewayapiv1.HTTPRoute{},
|
||||
resyncPeriod,
|
||||
indexers,
|
||||
)
|
||||
@@ -82,9 +94,9 @@ func (f *hTTPRouteInformer) defaultInformer(client versioned.Interface, resyncPe
|
||||
}
|
||||
|
||||
func (f *hTTPRouteInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&gatewayapiv1.HTTPRoute{}, f.defaultInformer)
|
||||
return f.factory.InformerFor(&apisgatewayapiv1.HTTPRoute{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *hTTPRouteInformer) Lister() v1.HTTPRouteLister {
|
||||
return v1.NewHTTPRouteLister(f.Informer().GetIndexer())
|
||||
func (f *hTTPRouteInformer) Lister() gatewayapiv1.HTTPRouteLister {
|
||||
return gatewayapiv1.NewHTTPRouteLister(f.Informer().GetIndexer())
|
||||
}
|
||||
|
||||
@@ -19,13 +19,13 @@ limitations under the License.
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
"context"
|
||||
context "context"
|
||||
time "time"
|
||||
|
||||
gatewayapiv1beta1 "github.com/fluxcd/flagger/pkg/apis/gatewayapi/v1beta1"
|
||||
apisgatewayapiv1beta1 "github.com/fluxcd/flagger/pkg/apis/gatewayapi/v1beta1"
|
||||
versioned "github.com/fluxcd/flagger/pkg/client/clientset/versioned"
|
||||
internalinterfaces "github.com/fluxcd/flagger/pkg/client/informers/externalversions/internalinterfaces"
|
||||
v1beta1 "github.com/fluxcd/flagger/pkg/client/listers/gatewayapi/v1beta1"
|
||||
gatewayapiv1beta1 "github.com/fluxcd/flagger/pkg/client/listers/gatewayapi/v1beta1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
@@ -36,7 +36,7 @@ import (
|
||||
// HTTPRoutes.
|
||||
type HTTPRouteInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() v1beta1.HTTPRouteLister
|
||||
Lister() gatewayapiv1beta1.HTTPRouteLister
|
||||
}
|
||||
|
||||
type hTTPRouteInformer struct {
|
||||
@@ -62,16 +62,28 @@ func NewFilteredHTTPRouteInformer(client versioned.Interface, namespace string,
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.GatewayapiV1beta1().HTTPRoutes(namespace).List(context.TODO(), options)
|
||||
return client.GatewayapiV1beta1().HTTPRoutes(namespace).List(context.Background(), options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.GatewayapiV1beta1().HTTPRoutes(namespace).Watch(context.TODO(), options)
|
||||
return client.GatewayapiV1beta1().HTTPRoutes(namespace).Watch(context.Background(), options)
|
||||
},
|
||||
ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.GatewayapiV1beta1().HTTPRoutes(namespace).List(ctx, options)
|
||||
},
|
||||
WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.GatewayapiV1beta1().HTTPRoutes(namespace).Watch(ctx, options)
|
||||
},
|
||||
},
|
||||
&gatewayapiv1beta1.HTTPRoute{},
|
||||
&apisgatewayapiv1beta1.HTTPRoute{},
|
||||
resyncPeriod,
|
||||
indexers,
|
||||
)
|
||||
@@ -82,9 +94,9 @@ func (f *hTTPRouteInformer) defaultInformer(client versioned.Interface, resyncPe
|
||||
}
|
||||
|
||||
func (f *hTTPRouteInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&gatewayapiv1beta1.HTTPRoute{}, f.defaultInformer)
|
||||
return f.factory.InformerFor(&apisgatewayapiv1beta1.HTTPRoute{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *hTTPRouteInformer) Lister() v1beta1.HTTPRouteLister {
|
||||
return v1beta1.NewHTTPRouteLister(f.Informer().GetIndexer())
|
||||
func (f *hTTPRouteInformer) Lister() gatewayapiv1beta1.HTTPRouteLister {
|
||||
return gatewayapiv1beta1.NewHTTPRouteLister(f.Informer().GetIndexer())
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ limitations under the License.
|
||||
package externalversions
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
fmt "fmt"
|
||||
|
||||
v2 "github.com/fluxcd/flagger/pkg/apis/apisix/v2"
|
||||
v1beta1 "github.com/fluxcd/flagger/pkg/apis/appmesh/v1beta1"
|
||||
|
||||
@@ -19,13 +19,13 @@ limitations under the License.
|
||||
package v1
|
||||
|
||||
import (
|
||||
"context"
|
||||
context "context"
|
||||
time "time"
|
||||
|
||||
gloov1 "github.com/fluxcd/flagger/pkg/apis/gloo/v1"
|
||||
apisgloov1 "github.com/fluxcd/flagger/pkg/apis/gloo/v1"
|
||||
versioned "github.com/fluxcd/flagger/pkg/client/clientset/versioned"
|
||||
internalinterfaces "github.com/fluxcd/flagger/pkg/client/informers/externalversions/internalinterfaces"
|
||||
v1 "github.com/fluxcd/flagger/pkg/client/listers/gloo/v1"
|
||||
gloov1 "github.com/fluxcd/flagger/pkg/client/listers/gloo/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
@@ -36,7 +36,7 @@ import (
|
||||
// Upstreams.
|
||||
type UpstreamInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() v1.UpstreamLister
|
||||
Lister() gloov1.UpstreamLister
|
||||
}
|
||||
|
||||
type upstreamInformer struct {
|
||||
@@ -62,16 +62,28 @@ func NewFilteredUpstreamInformer(client versioned.Interface, namespace string, r
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.GlooV1().Upstreams(namespace).List(context.TODO(), options)
|
||||
return client.GlooV1().Upstreams(namespace).List(context.Background(), options)
|
||||
},
|
||||
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.GlooV1().Upstreams(namespace).Watch(context.TODO(), options)
|
||||
return client.GlooV1().Upstreams(namespace).Watch(context.Background(), options)
|
||||
},
|
||||
ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.GlooV1().Upstreams(namespace).List(ctx, options)
|
||||
},
|
||||
WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.GlooV1().Upstreams(namespace).Watch(ctx, options)
|
||||
},
|
||||
},
|
||||
&gloov1.Upstream{},
|
||||
&apisgloov1.Upstream{},
|
||||
resyncPeriod,
|
||||
indexers,
|
||||
)
|
||||
@@ -82,9 +94,9 @@ func (f *upstreamInformer) defaultInformer(client versioned.Interface, resyncPer
|
||||
}
|
||||
|
||||
func (f *upstreamInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&gloov1.Upstream{}, f.defaultInformer)
|
||||
return f.factory.InformerFor(&apisgloov1.Upstream{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *upstreamInformer) Lister() v1.UpstreamLister {
|
||||
return v1.NewUpstreamLister(f.Informer().GetIndexer())
|
||||
func (f *upstreamInformer) Lister() gloov1.UpstreamLister {
|
||||
return gloov1.NewUpstreamLister(f.Informer().GetIndexer())
|
||||
}
|
||||
|
||||
@@ -19,13 +19,13 @@ limitations under the License.
|
||||
package v1
|
||||
|
||||
import (
|
||||
"context"
|
||||
context "context"
|
||||
time "time"
|
||||
|
||||
gloogatewayv1 "github.com/fluxcd/flagger/pkg/apis/gloogateway/v1"
|
||||
apisgloogatewayv1 "github.com/fluxcd/flagger/pkg/apis/gloogateway/v1"
|
||||
versioned "github.com/fluxcd/flagger/pkg/client/clientset/versioned"
|
||||
internalinterfaces "github.com/fluxcd/flagger/pkg/client/informers/externalversions/internalinterfaces"
|
||||
v1 "github.com/fluxcd/flagger/pkg/client/listers/gloogateway/v1"
|
||||
gloogatewayv1 "github.com/fluxcd/flagger/pkg/client/listers/gloogateway/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
@@ -36,7 +36,7 @@ import (
|
||||
// RouteTables.
|
||||
type RouteTableInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() v1.RouteTableLister
|
||||
Lister() gloogatewayv1.RouteTableLister
|
||||
}
|
||||
|
||||
type routeTableInformer struct {
|
||||
@@ -62,16 +62,28 @@ func NewFilteredRouteTableInformer(client versioned.Interface, namespace string,
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.GatewayV1().RouteTables(namespace).List(context.TODO(), options)
|
||||
return client.GatewayV1().RouteTables(namespace).List(context.Background(), options)
|
||||
},
|
||||
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.GatewayV1().RouteTables(namespace).Watch(context.TODO(), options)
|
||||
return client.GatewayV1().RouteTables(namespace).Watch(context.Background(), options)
|
||||
},
|
||||
ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.GatewayV1().RouteTables(namespace).List(ctx, options)
|
||||
},
|
||||
WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.GatewayV1().RouteTables(namespace).Watch(ctx, options)
|
||||
},
|
||||
},
|
||||
&gloogatewayv1.RouteTable{},
|
||||
&apisgloogatewayv1.RouteTable{},
|
||||
resyncPeriod,
|
||||
indexers,
|
||||
)
|
||||
@@ -82,9 +94,9 @@ func (f *routeTableInformer) defaultInformer(client versioned.Interface, resyncP
|
||||
}
|
||||
|
||||
func (f *routeTableInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&gloogatewayv1.RouteTable{}, f.defaultInformer)
|
||||
return f.factory.InformerFor(&apisgloogatewayv1.RouteTable{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *routeTableInformer) Lister() v1.RouteTableLister {
|
||||
return v1.NewRouteTableLister(f.Informer().GetIndexer())
|
||||
func (f *routeTableInformer) Lister() gloogatewayv1.RouteTableLister {
|
||||
return gloogatewayv1.NewRouteTableLister(f.Informer().GetIndexer())
|
||||
}
|
||||
|
||||
@@ -19,13 +19,13 @@ limitations under the License.
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
"context"
|
||||
context "context"
|
||||
time "time"
|
||||
|
||||
istiov1beta1 "github.com/fluxcd/flagger/pkg/apis/istio/v1beta1"
|
||||
apisistiov1beta1 "github.com/fluxcd/flagger/pkg/apis/istio/v1beta1"
|
||||
versioned "github.com/fluxcd/flagger/pkg/client/clientset/versioned"
|
||||
internalinterfaces "github.com/fluxcd/flagger/pkg/client/informers/externalversions/internalinterfaces"
|
||||
v1beta1 "github.com/fluxcd/flagger/pkg/client/listers/istio/v1beta1"
|
||||
istiov1beta1 "github.com/fluxcd/flagger/pkg/client/listers/istio/v1beta1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
@@ -36,7 +36,7 @@ import (
|
||||
// DestinationRules.
|
||||
type DestinationRuleInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() v1beta1.DestinationRuleLister
|
||||
Lister() istiov1beta1.DestinationRuleLister
|
||||
}
|
||||
|
||||
type destinationRuleInformer struct {
|
||||
@@ -62,16 +62,28 @@ func NewFilteredDestinationRuleInformer(client versioned.Interface, namespace st
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.NetworkingV1beta1().DestinationRules(namespace).List(context.TODO(), options)
|
||||
return client.NetworkingV1beta1().DestinationRules(namespace).List(context.Background(), options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.NetworkingV1beta1().DestinationRules(namespace).Watch(context.TODO(), options)
|
||||
return client.NetworkingV1beta1().DestinationRules(namespace).Watch(context.Background(), options)
|
||||
},
|
||||
ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.NetworkingV1beta1().DestinationRules(namespace).List(ctx, options)
|
||||
},
|
||||
WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.NetworkingV1beta1().DestinationRules(namespace).Watch(ctx, options)
|
||||
},
|
||||
},
|
||||
&istiov1beta1.DestinationRule{},
|
||||
&apisistiov1beta1.DestinationRule{},
|
||||
resyncPeriod,
|
||||
indexers,
|
||||
)
|
||||
@@ -82,9 +94,9 @@ func (f *destinationRuleInformer) defaultInformer(client versioned.Interface, re
|
||||
}
|
||||
|
||||
func (f *destinationRuleInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&istiov1beta1.DestinationRule{}, f.defaultInformer)
|
||||
return f.factory.InformerFor(&apisistiov1beta1.DestinationRule{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *destinationRuleInformer) Lister() v1beta1.DestinationRuleLister {
|
||||
return v1beta1.NewDestinationRuleLister(f.Informer().GetIndexer())
|
||||
func (f *destinationRuleInformer) Lister() istiov1beta1.DestinationRuleLister {
|
||||
return istiov1beta1.NewDestinationRuleLister(f.Informer().GetIndexer())
|
||||
}
|
||||
|
||||
@@ -19,13 +19,13 @@ limitations under the License.
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
"context"
|
||||
context "context"
|
||||
time "time"
|
||||
|
||||
istiov1beta1 "github.com/fluxcd/flagger/pkg/apis/istio/v1beta1"
|
||||
apisistiov1beta1 "github.com/fluxcd/flagger/pkg/apis/istio/v1beta1"
|
||||
versioned "github.com/fluxcd/flagger/pkg/client/clientset/versioned"
|
||||
internalinterfaces "github.com/fluxcd/flagger/pkg/client/informers/externalversions/internalinterfaces"
|
||||
v1beta1 "github.com/fluxcd/flagger/pkg/client/listers/istio/v1beta1"
|
||||
istiov1beta1 "github.com/fluxcd/flagger/pkg/client/listers/istio/v1beta1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
@@ -36,7 +36,7 @@ import (
|
||||
// VirtualServices.
|
||||
type VirtualServiceInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() v1beta1.VirtualServiceLister
|
||||
Lister() istiov1beta1.VirtualServiceLister
|
||||
}
|
||||
|
||||
type virtualServiceInformer struct {
|
||||
@@ -62,16 +62,28 @@ func NewFilteredVirtualServiceInformer(client versioned.Interface, namespace str
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.NetworkingV1beta1().VirtualServices(namespace).List(context.TODO(), options)
|
||||
return client.NetworkingV1beta1().VirtualServices(namespace).List(context.Background(), options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.NetworkingV1beta1().VirtualServices(namespace).Watch(context.TODO(), options)
|
||||
return client.NetworkingV1beta1().VirtualServices(namespace).Watch(context.Background(), options)
|
||||
},
|
||||
ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.NetworkingV1beta1().VirtualServices(namespace).List(ctx, options)
|
||||
},
|
||||
WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.NetworkingV1beta1().VirtualServices(namespace).Watch(ctx, options)
|
||||
},
|
||||
},
|
||||
&istiov1beta1.VirtualService{},
|
||||
&apisistiov1beta1.VirtualService{},
|
||||
resyncPeriod,
|
||||
indexers,
|
||||
)
|
||||
@@ -82,9 +94,9 @@ func (f *virtualServiceInformer) defaultInformer(client versioned.Interface, res
|
||||
}
|
||||
|
||||
func (f *virtualServiceInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&istiov1beta1.VirtualService{}, f.defaultInformer)
|
||||
return f.factory.InformerFor(&apisistiov1beta1.VirtualService{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *virtualServiceInformer) Lister() v1beta1.VirtualServiceLister {
|
||||
return v1beta1.NewVirtualServiceLister(f.Informer().GetIndexer())
|
||||
func (f *virtualServiceInformer) Lister() istiov1beta1.VirtualServiceLister {
|
||||
return istiov1beta1.NewVirtualServiceLister(f.Informer().GetIndexer())
|
||||
}
|
||||
|
||||
@@ -19,13 +19,13 @@ limitations under the License.
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"context"
|
||||
context "context"
|
||||
time "time"
|
||||
|
||||
kedav1alpha1 "github.com/fluxcd/flagger/pkg/apis/keda/v1alpha1"
|
||||
apiskedav1alpha1 "github.com/fluxcd/flagger/pkg/apis/keda/v1alpha1"
|
||||
versioned "github.com/fluxcd/flagger/pkg/client/clientset/versioned"
|
||||
internalinterfaces "github.com/fluxcd/flagger/pkg/client/informers/externalversions/internalinterfaces"
|
||||
v1alpha1 "github.com/fluxcd/flagger/pkg/client/listers/keda/v1alpha1"
|
||||
kedav1alpha1 "github.com/fluxcd/flagger/pkg/client/listers/keda/v1alpha1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
@@ -36,7 +36,7 @@ import (
|
||||
// ScaledObjects.
|
||||
type ScaledObjectInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() v1alpha1.ScaledObjectLister
|
||||
Lister() kedav1alpha1.ScaledObjectLister
|
||||
}
|
||||
|
||||
type scaledObjectInformer struct {
|
||||
@@ -62,16 +62,28 @@ func NewFilteredScaledObjectInformer(client versioned.Interface, namespace strin
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.KedaV1alpha1().ScaledObjects(namespace).List(context.TODO(), options)
|
||||
return client.KedaV1alpha1().ScaledObjects(namespace).List(context.Background(), options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.KedaV1alpha1().ScaledObjects(namespace).Watch(context.TODO(), options)
|
||||
return client.KedaV1alpha1().ScaledObjects(namespace).Watch(context.Background(), options)
|
||||
},
|
||||
ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.KedaV1alpha1().ScaledObjects(namespace).List(ctx, options)
|
||||
},
|
||||
WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.KedaV1alpha1().ScaledObjects(namespace).Watch(ctx, options)
|
||||
},
|
||||
},
|
||||
&kedav1alpha1.ScaledObject{},
|
||||
&apiskedav1alpha1.ScaledObject{},
|
||||
resyncPeriod,
|
||||
indexers,
|
||||
)
|
||||
@@ -82,9 +94,9 @@ func (f *scaledObjectInformer) defaultInformer(client versioned.Interface, resyn
|
||||
}
|
||||
|
||||
func (f *scaledObjectInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&kedav1alpha1.ScaledObject{}, f.defaultInformer)
|
||||
return f.factory.InformerFor(&apiskedav1alpha1.ScaledObject{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *scaledObjectInformer) Lister() v1alpha1.ScaledObjectLister {
|
||||
return v1alpha1.NewScaledObjectLister(f.Informer().GetIndexer())
|
||||
func (f *scaledObjectInformer) Lister() kedav1alpha1.ScaledObjectLister {
|
||||
return kedav1alpha1.NewScaledObjectLister(f.Informer().GetIndexer())
|
||||
}
|
||||
|
||||
@@ -19,13 +19,13 @@ limitations under the License.
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"context"
|
||||
context "context"
|
||||
time "time"
|
||||
|
||||
kumav1alpha1 "github.com/fluxcd/flagger/pkg/apis/kuma/v1alpha1"
|
||||
apiskumav1alpha1 "github.com/fluxcd/flagger/pkg/apis/kuma/v1alpha1"
|
||||
versioned "github.com/fluxcd/flagger/pkg/client/clientset/versioned"
|
||||
internalinterfaces "github.com/fluxcd/flagger/pkg/client/informers/externalversions/internalinterfaces"
|
||||
v1alpha1 "github.com/fluxcd/flagger/pkg/client/listers/kuma/v1alpha1"
|
||||
kumav1alpha1 "github.com/fluxcd/flagger/pkg/client/listers/kuma/v1alpha1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
@@ -36,7 +36,7 @@ import (
|
||||
// TrafficRoutes.
|
||||
type TrafficRouteInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() v1alpha1.TrafficRouteLister
|
||||
Lister() kumav1alpha1.TrafficRouteLister
|
||||
}
|
||||
|
||||
type trafficRouteInformer struct {
|
||||
@@ -61,16 +61,28 @@ func NewFilteredTrafficRouteInformer(client versioned.Interface, resyncPeriod ti
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.KumaV1alpha1().TrafficRoutes().List(context.TODO(), options)
|
||||
return client.KumaV1alpha1().TrafficRoutes().List(context.Background(), options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.KumaV1alpha1().TrafficRoutes().Watch(context.TODO(), options)
|
||||
return client.KumaV1alpha1().TrafficRoutes().Watch(context.Background(), options)
|
||||
},
|
||||
ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.KumaV1alpha1().TrafficRoutes().List(ctx, options)
|
||||
},
|
||||
WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.KumaV1alpha1().TrafficRoutes().Watch(ctx, options)
|
||||
},
|
||||
},
|
||||
&kumav1alpha1.TrafficRoute{},
|
||||
&apiskumav1alpha1.TrafficRoute{},
|
||||
resyncPeriod,
|
||||
indexers,
|
||||
)
|
||||
@@ -81,9 +93,9 @@ func (f *trafficRouteInformer) defaultInformer(client versioned.Interface, resyn
|
||||
}
|
||||
|
||||
func (f *trafficRouteInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&kumav1alpha1.TrafficRoute{}, f.defaultInformer)
|
||||
return f.factory.InformerFor(&apiskumav1alpha1.TrafficRoute{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *trafficRouteInformer) Lister() v1alpha1.TrafficRouteLister {
|
||||
return v1alpha1.NewTrafficRouteLister(f.Informer().GetIndexer())
|
||||
func (f *trafficRouteInformer) Lister() kumav1alpha1.TrafficRouteLister {
|
||||
return kumav1alpha1.NewTrafficRouteLister(f.Informer().GetIndexer())
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user