diff --git a/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/fake/BUILD b/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/fake/BUILD new file mode 100644 index 0000000000..a971f005e6 --- /dev/null +++ b/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/fake/BUILD @@ -0,0 +1,30 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "fake", + srcs = [ + "clientset_generated.go", + "doc.go", + "register.go", + ], + importpath = "k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/fake", + visibility = ["//visibility:public"], + deps = [ + "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:meta", + "//vendor/k8s.io/apimachinery/pkg/runtime", + "//vendor/k8s.io/apimachinery/pkg/runtime/schema", + "//vendor/k8s.io/apimachinery/pkg/runtime/serializer", + "//vendor/k8s.io/apimachinery/pkg/util/runtime", + "//vendor/k8s.io/apimachinery/pkg/watch", + "//vendor/k8s.io/client-go/discovery", + "//vendor/k8s.io/client-go/discovery/fake", + "//vendor/k8s.io/client-go/testing", + "//vendor/k8s.io/cloud-provider-gcp/crd/apis/network/v1:network", + "//vendor/k8s.io/cloud-provider-gcp/crd/apis/network/v1alpha1", + "//vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned", + "//vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1:network", + "//vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1/fake", + "//vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1alpha1", + "//vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1alpha1/fake", + ], +) diff --git a/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/fake/clientset_generated.go b/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/fake/clientset_generated.go new file mode 100644 index 0000000000..43b70b3058 --- /dev/null +++ b/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/fake/clientset_generated.go @@ -0,0 +1,89 @@ +/* +Copyright 2023 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/discovery" + fakediscovery "k8s.io/client-go/discovery/fake" + "k8s.io/client-go/testing" + clientset "k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned" + networkingv1 "k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1" + fakenetworkingv1 "k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1/fake" + networkingv1alpha1 "k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1alpha1" + fakenetworkingv1alpha1 "k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1alpha1/fake" +) + +// NewSimpleClientset returns a clientset that will respond with the provided objects. +// It's backed by a very simple object tracker that processes creates, updates and deletions as-is, +// without applying any validations and/or defaults. It shouldn't be considered a replacement +// for a real clientset and is mostly useful in simple unit tests. +func NewSimpleClientset(objects ...runtime.Object) *Clientset { + o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) + for _, obj := range objects { + if err := o.Add(obj); err != nil { + panic(err) + } + } + + cs := &Clientset{tracker: o} + cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} + cs.AddReactor("*", "*", testing.ObjectReaction(o)) + cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { + gvr := action.GetResource() + ns := action.GetNamespace() + watch, err := o.Watch(gvr, ns) + if err != nil { + return false, nil, err + } + return true, watch, nil + }) + + return cs +} + +// Clientset implements clientset.Interface. Meant to be embedded into a +// struct to get a default implementation. This makes faking out just the method +// you want to test easier. +type Clientset struct { + testing.Fake + discovery *fakediscovery.FakeDiscovery + tracker testing.ObjectTracker +} + +func (c *Clientset) Discovery() discovery.DiscoveryInterface { + return c.discovery +} + +func (c *Clientset) Tracker() testing.ObjectTracker { + return c.tracker +} + +var _ clientset.Interface = &Clientset{} + +// NetworkingV1alpha1 retrieves the NetworkingV1alpha1Client +func (c *Clientset) NetworkingV1alpha1() networkingv1alpha1.NetworkingV1alpha1Interface { + return &fakenetworkingv1alpha1.FakeNetworkingV1alpha1{Fake: &c.Fake} +} + +// NetworkingV1 retrieves the NetworkingV1Client +func (c *Clientset) NetworkingV1() networkingv1.NetworkingV1Interface { + return &fakenetworkingv1.FakeNetworkingV1{Fake: &c.Fake} +} diff --git a/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/fake/doc.go b/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/fake/doc.go new file mode 100644 index 0000000000..50d0812d7f --- /dev/null +++ b/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2023 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated fake clientset. +package fake diff --git a/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/fake/register.go b/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/fake/register.go new file mode 100644 index 0000000000..26726b8d9f --- /dev/null +++ b/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/fake/register.go @@ -0,0 +1,58 @@ +/* +Copyright 2023 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + serializer "k8s.io/apimachinery/pkg/runtime/serializer" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" + networkingv1 "k8s.io/cloud-provider-gcp/crd/apis/network/v1" + networkingv1alpha1 "k8s.io/cloud-provider-gcp/crd/apis/network/v1alpha1" +) + +var scheme = runtime.NewScheme() +var codecs = serializer.NewCodecFactory(scheme) + +var localSchemeBuilder = runtime.SchemeBuilder{ + networkingv1alpha1.AddToScheme, + networkingv1.AddToScheme, +} + +// AddToScheme adds all types of this clientset into the given scheme. This allows composition +// of clientsets, like in: +// +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) +// +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// +// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types +// correctly. +var AddToScheme = localSchemeBuilder.AddToScheme + +func init() { + v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) + utilruntime.Must(AddToScheme(scheme)) +} diff --git a/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1/fake/BUILD b/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1/fake/BUILD new file mode 100644 index 0000000000..39fe2a3bbb --- /dev/null +++ b/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1/fake/BUILD @@ -0,0 +1,26 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "fake", + srcs = [ + "doc.go", + "fake_network.go", + "fake_network_client.go", + "fake_networkinterface.go", + "fake_networkinterfacelist.go", + "fake_networklist.go", + ], + importpath = "k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1/fake", + visibility = ["//visibility:public"], + deps = [ + "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:meta", + "//vendor/k8s.io/apimachinery/pkg/labels", + "//vendor/k8s.io/apimachinery/pkg/runtime/schema", + "//vendor/k8s.io/apimachinery/pkg/types", + "//vendor/k8s.io/apimachinery/pkg/watch", + "//vendor/k8s.io/client-go/rest", + "//vendor/k8s.io/client-go/testing", + "//vendor/k8s.io/cloud-provider-gcp/crd/apis/network/v1:network", + "//vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1:network", + ], +) diff --git a/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1/fake/doc.go b/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1/fake/doc.go new file mode 100644 index 0000000000..1672f9cfa1 --- /dev/null +++ b/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2023 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1/fake/fake_network.go b/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1/fake/fake_network.go new file mode 100644 index 0000000000..29a26c60f7 --- /dev/null +++ b/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1/fake/fake_network.go @@ -0,0 +1,133 @@ +/* +Copyright 2023 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + networkv1 "k8s.io/cloud-provider-gcp/crd/apis/network/v1" +) + +// FakeNetworks implements NetworkInterface +type FakeNetworks struct { + Fake *FakeNetworkingV1 +} + +var networksResource = schema.GroupVersionResource{Group: "networking.gke.io", Version: "v1", Resource: "networks"} + +var networksKind = schema.GroupVersionKind{Group: "networking.gke.io", Version: "v1", Kind: "Network"} + +// Get takes name of the network, and returns the corresponding network object, and an error if there is any. +func (c *FakeNetworks) Get(ctx context.Context, name string, options v1.GetOptions) (result *networkv1.Network, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(networksResource, name), &networkv1.Network{}) + if obj == nil { + return nil, err + } + return obj.(*networkv1.Network), err +} + +// List takes label and field selectors, and returns the list of Networks that match those selectors. +func (c *FakeNetworks) List(ctx context.Context, opts v1.ListOptions) (result *networkv1.NetworkList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(networksResource, networksKind, opts), &networkv1.NetworkList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &networkv1.NetworkList{ListMeta: obj.(*networkv1.NetworkList).ListMeta} + for _, item := range obj.(*networkv1.NetworkList).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 networks. +func (c *FakeNetworks) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(networksResource, opts)) +} + +// Create takes the representation of a network and creates it. Returns the server's representation of the network, and an error, if there is any. +func (c *FakeNetworks) Create(ctx context.Context, network *networkv1.Network, opts v1.CreateOptions) (result *networkv1.Network, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(networksResource, network), &networkv1.Network{}) + if obj == nil { + return nil, err + } + return obj.(*networkv1.Network), err +} + +// Update takes the representation of a network and updates it. Returns the server's representation of the network, and an error, if there is any. +func (c *FakeNetworks) Update(ctx context.Context, network *networkv1.Network, opts v1.UpdateOptions) (result *networkv1.Network, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(networksResource, network), &networkv1.Network{}) + if obj == nil { + return nil, err + } + return obj.(*networkv1.Network), 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 *FakeNetworks) UpdateStatus(ctx context.Context, network *networkv1.Network, opts v1.UpdateOptions) (*networkv1.Network, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(networksResource, "status", network), &networkv1.Network{}) + if obj == nil { + return nil, err + } + return obj.(*networkv1.Network), err +} + +// Delete takes name of the network and deletes it. Returns an error if one occurs. +func (c *FakeNetworks) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(networksResource, name), &networkv1.Network{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeNetworks) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(networksResource, listOpts) + + _, err := c.Fake.Invokes(action, &networkv1.NetworkList{}) + return err +} + +// Patch applies the patch and returns the patched network. +func (c *FakeNetworks) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *networkv1.Network, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(networksResource, name, pt, data, subresources...), &networkv1.Network{}) + if obj == nil { + return nil, err + } + return obj.(*networkv1.Network), err +} diff --git a/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1/fake/fake_network_client.go b/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1/fake/fake_network_client.go new file mode 100644 index 0000000000..293c61735c --- /dev/null +++ b/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1/fake/fake_network_client.go @@ -0,0 +1,52 @@ +/* +Copyright 2023 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" + v1 "k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1" +) + +type FakeNetworkingV1 struct { + *testing.Fake +} + +func (c *FakeNetworkingV1) Networks() v1.NetworkInterface { + return &FakeNetworks{c} +} + +func (c *FakeNetworkingV1) NetworkInterfaces(namespace string) v1.NetworkInterfaceInterface { + return &FakeNetworkInterfaces{c, namespace} +} + +func (c *FakeNetworkingV1) NetworkInterfaceLists(namespace string) v1.NetworkInterfaceListInterface { + return &FakeNetworkInterfaceLists{c, namespace} +} + +func (c *FakeNetworkingV1) NetworkLists() v1.NetworkListInterface { + return &FakeNetworkLists{c} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeNetworkingV1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1/fake/fake_networkinterface.go b/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1/fake/fake_networkinterface.go new file mode 100644 index 0000000000..f39d5e3e75 --- /dev/null +++ b/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1/fake/fake_networkinterface.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + networkv1 "k8s.io/cloud-provider-gcp/crd/apis/network/v1" +) + +// FakeNetworkInterfaces implements NetworkInterfaceInterface +type FakeNetworkInterfaces struct { + Fake *FakeNetworkingV1 + ns string +} + +var networkinterfacesResource = schema.GroupVersionResource{Group: "networking.gke.io", Version: "v1", Resource: "networkinterfaces"} + +var networkinterfacesKind = schema.GroupVersionKind{Group: "networking.gke.io", Version: "v1", Kind: "NetworkInterface"} + +// Get takes name of the networkInterface, and returns the corresponding networkInterface object, and an error if there is any. +func (c *FakeNetworkInterfaces) Get(ctx context.Context, name string, options v1.GetOptions) (result *networkv1.NetworkInterface, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(networkinterfacesResource, c.ns, name), &networkv1.NetworkInterface{}) + + if obj == nil { + return nil, err + } + return obj.(*networkv1.NetworkInterface), err +} + +// List takes label and field selectors, and returns the list of NetworkInterfaces that match those selectors. +func (c *FakeNetworkInterfaces) List(ctx context.Context, opts v1.ListOptions) (result *networkv1.NetworkInterfaceList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(networkinterfacesResource, networkinterfacesKind, c.ns, opts), &networkv1.NetworkInterfaceList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &networkv1.NetworkInterfaceList{ListMeta: obj.(*networkv1.NetworkInterfaceList).ListMeta} + for _, item := range obj.(*networkv1.NetworkInterfaceList).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 networkInterfaces. +func (c *FakeNetworkInterfaces) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(networkinterfacesResource, c.ns, opts)) + +} + +// Create takes the representation of a networkInterface and creates it. Returns the server's representation of the networkInterface, and an error, if there is any. +func (c *FakeNetworkInterfaces) Create(ctx context.Context, networkInterface *networkv1.NetworkInterface, opts v1.CreateOptions) (result *networkv1.NetworkInterface, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(networkinterfacesResource, c.ns, networkInterface), &networkv1.NetworkInterface{}) + + if obj == nil { + return nil, err + } + return obj.(*networkv1.NetworkInterface), err +} + +// Update takes the representation of a networkInterface and updates it. Returns the server's representation of the networkInterface, and an error, if there is any. +func (c *FakeNetworkInterfaces) Update(ctx context.Context, networkInterface *networkv1.NetworkInterface, opts v1.UpdateOptions) (result *networkv1.NetworkInterface, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(networkinterfacesResource, c.ns, networkInterface), &networkv1.NetworkInterface{}) + + if obj == nil { + return nil, err + } + return obj.(*networkv1.NetworkInterface), 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 *FakeNetworkInterfaces) UpdateStatus(ctx context.Context, networkInterface *networkv1.NetworkInterface, opts v1.UpdateOptions) (*networkv1.NetworkInterface, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(networkinterfacesResource, "status", c.ns, networkInterface), &networkv1.NetworkInterface{}) + + if obj == nil { + return nil, err + } + return obj.(*networkv1.NetworkInterface), err +} + +// Delete takes name of the networkInterface and deletes it. Returns an error if one occurs. +func (c *FakeNetworkInterfaces) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(networkinterfacesResource, c.ns, name), &networkv1.NetworkInterface{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeNetworkInterfaces) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(networkinterfacesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &networkv1.NetworkInterfaceList{}) + return err +} + +// Patch applies the patch and returns the patched networkInterface. +func (c *FakeNetworkInterfaces) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *networkv1.NetworkInterface, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(networkinterfacesResource, c.ns, name, pt, data, subresources...), &networkv1.NetworkInterface{}) + + if obj == nil { + return nil, err + } + return obj.(*networkv1.NetworkInterface), err +} diff --git a/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1/fake/fake_networkinterfacelist.go b/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1/fake/fake_networkinterfacelist.go new file mode 100644 index 0000000000..940cfa7522 --- /dev/null +++ b/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1/fake/fake_networkinterfacelist.go @@ -0,0 +1,49 @@ +/* +Copyright 2023 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + schema "k8s.io/apimachinery/pkg/runtime/schema" + testing "k8s.io/client-go/testing" + networkv1 "k8s.io/cloud-provider-gcp/crd/apis/network/v1" +) + +// FakeNetworkInterfaceLists implements NetworkInterfaceListInterface +type FakeNetworkInterfaceLists struct { + Fake *FakeNetworkingV1 + ns string +} + +var networkinterfacelistsResource = schema.GroupVersionResource{Group: "networking.gke.io", Version: "v1", Resource: "networkinterfacelists"} + +var networkinterfacelistsKind = schema.GroupVersionKind{Group: "networking.gke.io", Version: "v1", Kind: "NetworkInterfaceList"} + +// Get takes name of the networkInterfaceList, and returns the corresponding networkInterfaceList object, and an error if there is any. +func (c *FakeNetworkInterfaceLists) Get(ctx context.Context, name string, options v1.GetOptions) (result *networkv1.NetworkInterfaceList, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(networkinterfacelistsResource, c.ns, name), &networkv1.NetworkInterfaceList{}) + + if obj == nil { + return nil, err + } + return obj.(*networkv1.NetworkInterfaceList), err +} diff --git a/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1/fake/fake_networklist.go b/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1/fake/fake_networklist.go new file mode 100644 index 0000000000..adf9b5767e --- /dev/null +++ b/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1/fake/fake_networklist.go @@ -0,0 +1,47 @@ +/* +Copyright 2023 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + schema "k8s.io/apimachinery/pkg/runtime/schema" + testing "k8s.io/client-go/testing" + networkv1 "k8s.io/cloud-provider-gcp/crd/apis/network/v1" +) + +// FakeNetworkLists implements NetworkListInterface +type FakeNetworkLists struct { + Fake *FakeNetworkingV1 +} + +var networklistsResource = schema.GroupVersionResource{Group: "networking.gke.io", Version: "v1", Resource: "networklists"} + +var networklistsKind = schema.GroupVersionKind{Group: "networking.gke.io", Version: "v1", Kind: "NetworkList"} + +// Get takes name of the networkList, and returns the corresponding networkList object, and an error if there is any. +func (c *FakeNetworkLists) Get(ctx context.Context, name string, options v1.GetOptions) (result *networkv1.NetworkList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(networklistsResource, name), &networkv1.NetworkList{}) + if obj == nil { + return nil, err + } + return obj.(*networkv1.NetworkList), err +} diff --git a/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1alpha1/fake/BUILD b/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1alpha1/fake/BUILD new file mode 100644 index 0000000000..c396b2742c --- /dev/null +++ b/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1alpha1/fake/BUILD @@ -0,0 +1,28 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "fake", + srcs = [ + "doc.go", + "fake_gkenetworkparamset.go", + "fake_gkenetworkparamsetlist.go", + "fake_network.go", + "fake_network_client.go", + "fake_networkinterface.go", + "fake_networkinterfacelist.go", + "fake_networklist.go", + ], + importpath = "k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1alpha1/fake", + visibility = ["//visibility:public"], + deps = [ + "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:meta", + "//vendor/k8s.io/apimachinery/pkg/labels", + "//vendor/k8s.io/apimachinery/pkg/runtime/schema", + "//vendor/k8s.io/apimachinery/pkg/types", + "//vendor/k8s.io/apimachinery/pkg/watch", + "//vendor/k8s.io/client-go/rest", + "//vendor/k8s.io/client-go/testing", + "//vendor/k8s.io/cloud-provider-gcp/crd/apis/network/v1alpha1", + "//vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1alpha1", + ], +) diff --git a/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1alpha1/fake/doc.go b/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1alpha1/fake/doc.go new file mode 100644 index 0000000000..1672f9cfa1 --- /dev/null +++ b/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1alpha1/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2023 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1alpha1/fake/fake_gkenetworkparamset.go b/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1alpha1/fake/fake_gkenetworkparamset.go new file mode 100644 index 0000000000..f062e4f35f --- /dev/null +++ b/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1alpha1/fake/fake_gkenetworkparamset.go @@ -0,0 +1,133 @@ +/* +Copyright 2023 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + v1alpha1 "k8s.io/cloud-provider-gcp/crd/apis/network/v1alpha1" +) + +// FakeGKENetworkParamSets implements GKENetworkParamSetInterface +type FakeGKENetworkParamSets struct { + Fake *FakeNetworkingV1alpha1 +} + +var gkenetworkparamsetsResource = schema.GroupVersionResource{Group: "networking.gke.io", Version: "v1alpha1", Resource: "gkenetworkparamsets"} + +var gkenetworkparamsetsKind = schema.GroupVersionKind{Group: "networking.gke.io", Version: "v1alpha1", Kind: "GKENetworkParamSet"} + +// Get takes name of the gKENetworkParamSet, and returns the corresponding gKENetworkParamSet object, and an error if there is any. +func (c *FakeGKENetworkParamSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.GKENetworkParamSet, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(gkenetworkparamsetsResource, name), &v1alpha1.GKENetworkParamSet{}) + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.GKENetworkParamSet), err +} + +// List takes label and field selectors, and returns the list of GKENetworkParamSets that match those selectors. +func (c *FakeGKENetworkParamSets) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.GKENetworkParamSetList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(gkenetworkparamsetsResource, gkenetworkparamsetsKind, opts), &v1alpha1.GKENetworkParamSetList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha1.GKENetworkParamSetList{ListMeta: obj.(*v1alpha1.GKENetworkParamSetList).ListMeta} + for _, item := range obj.(*v1alpha1.GKENetworkParamSetList).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 gKENetworkParamSets. +func (c *FakeGKENetworkParamSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(gkenetworkparamsetsResource, opts)) +} + +// Create takes the representation of a gKENetworkParamSet and creates it. Returns the server's representation of the gKENetworkParamSet, and an error, if there is any. +func (c *FakeGKENetworkParamSets) Create(ctx context.Context, gKENetworkParamSet *v1alpha1.GKENetworkParamSet, opts v1.CreateOptions) (result *v1alpha1.GKENetworkParamSet, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(gkenetworkparamsetsResource, gKENetworkParamSet), &v1alpha1.GKENetworkParamSet{}) + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.GKENetworkParamSet), err +} + +// Update takes the representation of a gKENetworkParamSet and updates it. Returns the server's representation of the gKENetworkParamSet, and an error, if there is any. +func (c *FakeGKENetworkParamSets) Update(ctx context.Context, gKENetworkParamSet *v1alpha1.GKENetworkParamSet, opts v1.UpdateOptions) (result *v1alpha1.GKENetworkParamSet, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(gkenetworkparamsetsResource, gKENetworkParamSet), &v1alpha1.GKENetworkParamSet{}) + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.GKENetworkParamSet), 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 *FakeGKENetworkParamSets) UpdateStatus(ctx context.Context, gKENetworkParamSet *v1alpha1.GKENetworkParamSet, opts v1.UpdateOptions) (*v1alpha1.GKENetworkParamSet, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(gkenetworkparamsetsResource, "status", gKENetworkParamSet), &v1alpha1.GKENetworkParamSet{}) + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.GKENetworkParamSet), err +} + +// Delete takes name of the gKENetworkParamSet and deletes it. Returns an error if one occurs. +func (c *FakeGKENetworkParamSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(gkenetworkparamsetsResource, name), &v1alpha1.GKENetworkParamSet{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeGKENetworkParamSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(gkenetworkparamsetsResource, listOpts) + + _, err := c.Fake.Invokes(action, &v1alpha1.GKENetworkParamSetList{}) + return err +} + +// Patch applies the patch and returns the patched gKENetworkParamSet. +func (c *FakeGKENetworkParamSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.GKENetworkParamSet, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(gkenetworkparamsetsResource, name, pt, data, subresources...), &v1alpha1.GKENetworkParamSet{}) + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.GKENetworkParamSet), err +} diff --git a/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1alpha1/fake/fake_gkenetworkparamsetlist.go b/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1alpha1/fake/fake_gkenetworkparamsetlist.go new file mode 100644 index 0000000000..dc34adf5ea --- /dev/null +++ b/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1alpha1/fake/fake_gkenetworkparamsetlist.go @@ -0,0 +1,47 @@ +/* +Copyright 2023 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + schema "k8s.io/apimachinery/pkg/runtime/schema" + testing "k8s.io/client-go/testing" + v1alpha1 "k8s.io/cloud-provider-gcp/crd/apis/network/v1alpha1" +) + +// FakeGKENetworkParamSetLists implements GKENetworkParamSetListInterface +type FakeGKENetworkParamSetLists struct { + Fake *FakeNetworkingV1alpha1 +} + +var gkenetworkparamsetlistsResource = schema.GroupVersionResource{Group: "networking.gke.io", Version: "v1alpha1", Resource: "gkenetworkparamsetlists"} + +var gkenetworkparamsetlistsKind = schema.GroupVersionKind{Group: "networking.gke.io", Version: "v1alpha1", Kind: "GKENetworkParamSetList"} + +// Get takes name of the gKENetworkParamSetList, and returns the corresponding gKENetworkParamSetList object, and an error if there is any. +func (c *FakeGKENetworkParamSetLists) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.GKENetworkParamSetList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(gkenetworkparamsetlistsResource, name), &v1alpha1.GKENetworkParamSetList{}) + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.GKENetworkParamSetList), err +} diff --git a/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1alpha1/fake/fake_network.go b/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1alpha1/fake/fake_network.go new file mode 100644 index 0000000000..32dbd1d6d4 --- /dev/null +++ b/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1alpha1/fake/fake_network.go @@ -0,0 +1,133 @@ +/* +Copyright 2023 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + v1alpha1 "k8s.io/cloud-provider-gcp/crd/apis/network/v1alpha1" +) + +// FakeNetworks implements NetworkInterface +type FakeNetworks struct { + Fake *FakeNetworkingV1alpha1 +} + +var networksResource = schema.GroupVersionResource{Group: "networking.gke.io", Version: "v1alpha1", Resource: "networks"} + +var networksKind = schema.GroupVersionKind{Group: "networking.gke.io", Version: "v1alpha1", Kind: "Network"} + +// Get takes name of the network, and returns the corresponding network object, and an error if there is any. +func (c *FakeNetworks) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Network, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(networksResource, name), &v1alpha1.Network{}) + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.Network), err +} + +// List takes label and field selectors, and returns the list of Networks that match those selectors. +func (c *FakeNetworks) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.NetworkList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(networksResource, networksKind, opts), &v1alpha1.NetworkList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha1.NetworkList{ListMeta: obj.(*v1alpha1.NetworkList).ListMeta} + for _, item := range obj.(*v1alpha1.NetworkList).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 networks. +func (c *FakeNetworks) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(networksResource, opts)) +} + +// Create takes the representation of a network and creates it. Returns the server's representation of the network, and an error, if there is any. +func (c *FakeNetworks) Create(ctx context.Context, network *v1alpha1.Network, opts v1.CreateOptions) (result *v1alpha1.Network, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(networksResource, network), &v1alpha1.Network{}) + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.Network), err +} + +// Update takes the representation of a network and updates it. Returns the server's representation of the network, and an error, if there is any. +func (c *FakeNetworks) Update(ctx context.Context, network *v1alpha1.Network, opts v1.UpdateOptions) (result *v1alpha1.Network, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(networksResource, network), &v1alpha1.Network{}) + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.Network), 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 *FakeNetworks) UpdateStatus(ctx context.Context, network *v1alpha1.Network, opts v1.UpdateOptions) (*v1alpha1.Network, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(networksResource, "status", network), &v1alpha1.Network{}) + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.Network), err +} + +// Delete takes name of the network and deletes it. Returns an error if one occurs. +func (c *FakeNetworks) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(networksResource, name), &v1alpha1.Network{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeNetworks) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(networksResource, listOpts) + + _, err := c.Fake.Invokes(action, &v1alpha1.NetworkList{}) + return err +} + +// Patch applies the patch and returns the patched network. +func (c *FakeNetworks) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Network, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(networksResource, name, pt, data, subresources...), &v1alpha1.Network{}) + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.Network), err +} diff --git a/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1alpha1/fake/fake_network_client.go b/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1alpha1/fake/fake_network_client.go new file mode 100644 index 0000000000..93e706e95a --- /dev/null +++ b/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1alpha1/fake/fake_network_client.go @@ -0,0 +1,60 @@ +/* +Copyright 2023 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" + v1alpha1 "k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1alpha1" +) + +type FakeNetworkingV1alpha1 struct { + *testing.Fake +} + +func (c *FakeNetworkingV1alpha1) GKENetworkParamSets() v1alpha1.GKENetworkParamSetInterface { + return &FakeGKENetworkParamSets{c} +} + +func (c *FakeNetworkingV1alpha1) GKENetworkParamSetLists() v1alpha1.GKENetworkParamSetListInterface { + return &FakeGKENetworkParamSetLists{c} +} + +func (c *FakeNetworkingV1alpha1) Networks() v1alpha1.NetworkInterface { + return &FakeNetworks{c} +} + +func (c *FakeNetworkingV1alpha1) NetworkInterfaces(namespace string) v1alpha1.NetworkInterfaceInterface { + return &FakeNetworkInterfaces{c, namespace} +} + +func (c *FakeNetworkingV1alpha1) NetworkInterfaceLists(namespace string) v1alpha1.NetworkInterfaceListInterface { + return &FakeNetworkInterfaceLists{c, namespace} +} + +func (c *FakeNetworkingV1alpha1) NetworkLists() v1alpha1.NetworkListInterface { + return &FakeNetworkLists{c} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeNetworkingV1alpha1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1alpha1/fake/fake_networkinterface.go b/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1alpha1/fake/fake_networkinterface.go new file mode 100644 index 0000000000..cdd481b256 --- /dev/null +++ b/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1alpha1/fake/fake_networkinterface.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + v1alpha1 "k8s.io/cloud-provider-gcp/crd/apis/network/v1alpha1" +) + +// FakeNetworkInterfaces implements NetworkInterfaceInterface +type FakeNetworkInterfaces struct { + Fake *FakeNetworkingV1alpha1 + ns string +} + +var networkinterfacesResource = schema.GroupVersionResource{Group: "networking.gke.io", Version: "v1alpha1", Resource: "networkinterfaces"} + +var networkinterfacesKind = schema.GroupVersionKind{Group: "networking.gke.io", Version: "v1alpha1", Kind: "NetworkInterface"} + +// Get takes name of the networkInterface, and returns the corresponding networkInterface object, and an error if there is any. +func (c *FakeNetworkInterfaces) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.NetworkInterface, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(networkinterfacesResource, c.ns, name), &v1alpha1.NetworkInterface{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.NetworkInterface), err +} + +// List takes label and field selectors, and returns the list of NetworkInterfaces that match those selectors. +func (c *FakeNetworkInterfaces) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.NetworkInterfaceList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(networkinterfacesResource, networkinterfacesKind, c.ns, opts), &v1alpha1.NetworkInterfaceList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha1.NetworkInterfaceList{ListMeta: obj.(*v1alpha1.NetworkInterfaceList).ListMeta} + for _, item := range obj.(*v1alpha1.NetworkInterfaceList).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 networkInterfaces. +func (c *FakeNetworkInterfaces) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(networkinterfacesResource, c.ns, opts)) + +} + +// Create takes the representation of a networkInterface and creates it. Returns the server's representation of the networkInterface, and an error, if there is any. +func (c *FakeNetworkInterfaces) Create(ctx context.Context, networkInterface *v1alpha1.NetworkInterface, opts v1.CreateOptions) (result *v1alpha1.NetworkInterface, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(networkinterfacesResource, c.ns, networkInterface), &v1alpha1.NetworkInterface{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.NetworkInterface), err +} + +// Update takes the representation of a networkInterface and updates it. Returns the server's representation of the networkInterface, and an error, if there is any. +func (c *FakeNetworkInterfaces) Update(ctx context.Context, networkInterface *v1alpha1.NetworkInterface, opts v1.UpdateOptions) (result *v1alpha1.NetworkInterface, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(networkinterfacesResource, c.ns, networkInterface), &v1alpha1.NetworkInterface{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.NetworkInterface), 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 *FakeNetworkInterfaces) UpdateStatus(ctx context.Context, networkInterface *v1alpha1.NetworkInterface, opts v1.UpdateOptions) (*v1alpha1.NetworkInterface, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(networkinterfacesResource, "status", c.ns, networkInterface), &v1alpha1.NetworkInterface{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.NetworkInterface), err +} + +// Delete takes name of the networkInterface and deletes it. Returns an error if one occurs. +func (c *FakeNetworkInterfaces) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(networkinterfacesResource, c.ns, name), &v1alpha1.NetworkInterface{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeNetworkInterfaces) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(networkinterfacesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1alpha1.NetworkInterfaceList{}) + return err +} + +// Patch applies the patch and returns the patched networkInterface. +func (c *FakeNetworkInterfaces) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.NetworkInterface, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(networkinterfacesResource, c.ns, name, pt, data, subresources...), &v1alpha1.NetworkInterface{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.NetworkInterface), err +} diff --git a/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1alpha1/fake/fake_networkinterfacelist.go b/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1alpha1/fake/fake_networkinterfacelist.go new file mode 100644 index 0000000000..65be024427 --- /dev/null +++ b/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1alpha1/fake/fake_networkinterfacelist.go @@ -0,0 +1,49 @@ +/* +Copyright 2023 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + schema "k8s.io/apimachinery/pkg/runtime/schema" + testing "k8s.io/client-go/testing" + v1alpha1 "k8s.io/cloud-provider-gcp/crd/apis/network/v1alpha1" +) + +// FakeNetworkInterfaceLists implements NetworkInterfaceListInterface +type FakeNetworkInterfaceLists struct { + Fake *FakeNetworkingV1alpha1 + ns string +} + +var networkinterfacelistsResource = schema.GroupVersionResource{Group: "networking.gke.io", Version: "v1alpha1", Resource: "networkinterfacelists"} + +var networkinterfacelistsKind = schema.GroupVersionKind{Group: "networking.gke.io", Version: "v1alpha1", Kind: "NetworkInterfaceList"} + +// Get takes name of the networkInterfaceList, and returns the corresponding networkInterfaceList object, and an error if there is any. +func (c *FakeNetworkInterfaceLists) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.NetworkInterfaceList, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(networkinterfacelistsResource, c.ns, name), &v1alpha1.NetworkInterfaceList{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.NetworkInterfaceList), err +} diff --git a/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1alpha1/fake/fake_networklist.go b/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1alpha1/fake/fake_networklist.go new file mode 100644 index 0000000000..a3d52b5573 --- /dev/null +++ b/vendor/k8s.io/cloud-provider-gcp/crd/client/network/clientset/versioned/typed/network/v1alpha1/fake/fake_networklist.go @@ -0,0 +1,47 @@ +/* +Copyright 2023 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + schema "k8s.io/apimachinery/pkg/runtime/schema" + testing "k8s.io/client-go/testing" + v1alpha1 "k8s.io/cloud-provider-gcp/crd/apis/network/v1alpha1" +) + +// FakeNetworkLists implements NetworkListInterface +type FakeNetworkLists struct { + Fake *FakeNetworkingV1alpha1 +} + +var networklistsResource = schema.GroupVersionResource{Group: "networking.gke.io", Version: "v1alpha1", Resource: "networklists"} + +var networklistsKind = schema.GroupVersionKind{Group: "networking.gke.io", Version: "v1alpha1", Kind: "NetworkList"} + +// Get takes name of the networkList, and returns the corresponding networkList object, and an error if there is any. +func (c *FakeNetworkLists) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.NetworkList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(networklistsResource, name), &v1alpha1.NetworkList{}) + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.NetworkList), err +}