diff --git a/dist/images/install.sh b/dist/images/install.sh index 68370d30e91..2d671d4af79 100755 --- a/dist/images/install.sh +++ b/dist/images/install.sh @@ -720,6 +720,10 @@ spec: type: array items: type: string + notReadyNodes: + type: array + items: + type: string vlans: type: array items: diff --git a/pkg/apis/kubeovn/v1/types.go b/pkg/apis/kubeovn/v1/types.go index a7fa4a99b24..5388c0e930f 100644 --- a/pkg/apis/kubeovn/v1/types.go +++ b/pkg/apis/kubeovn/v1/types.go @@ -270,6 +270,9 @@ type ProviderNetworkStatus struct { // +optional ReadyNodes []string `json:"readyNodes,omitempty"` + // +optional + NotReadyNodes []string `json:"notReadyNodes,omitempty"` + // +optional Vlans []string `json:"vlans,omitempty"` diff --git a/pkg/apis/kubeovn/v1/zz_generated.deepcopy.go b/pkg/apis/kubeovn/v1/zz_generated.deepcopy.go index fd50af71cc3..0c2a2ce6b1b 100644 --- a/pkg/apis/kubeovn/v1/zz_generated.deepcopy.go +++ b/pkg/apis/kubeovn/v1/zz_generated.deepcopy.go @@ -392,6 +392,11 @@ func (in *ProviderNetworkStatus) DeepCopyInto(out *ProviderNetworkStatus) { *out = make([]string, len(*in)) copy(*out, *in) } + if in.NotReadyNodes != nil { + in, out := &in.NotReadyNodes, &out.NotReadyNodes + *out = make([]string, len(*in)) + copy(*out, *in) + } if in.Vlans != nil { in, out := &in.Vlans, &out.Vlans *out = make([]string, len(*in)) diff --git a/pkg/client/listers/clientset/versioned/clientset.go b/pkg/client/listers/clientset/versioned/clientset.go new file mode 100644 index 00000000000..4dfab592983 --- /dev/null +++ b/pkg/client/listers/clientset/versioned/clientset.go @@ -0,0 +1,121 @@ +/* +Copyright 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 versioned + +import ( + "fmt" + "net/http" + + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned/typed/kubeovn/v1" + discovery "k8s.io/client-go/discovery" + rest "k8s.io/client-go/rest" + flowcontrol "k8s.io/client-go/util/flowcontrol" +) + +type Interface interface { + Discovery() discovery.DiscoveryInterface + KubeovnV1() kubeovnv1.KubeovnV1Interface +} + +// Clientset contains the clients for groups. Each group has exactly one +// version included in a Clientset. +type Clientset struct { + *discovery.DiscoveryClient + kubeovnV1 *kubeovnv1.KubeovnV1Client +} + +// KubeovnV1 retrieves the KubeovnV1Client +func (c *Clientset) KubeovnV1() kubeovnv1.KubeovnV1Interface { + return c.kubeovnV1 +} + +// Discovery retrieves the DiscoveryClient +func (c *Clientset) Discovery() discovery.DiscoveryInterface { + if c == nil { + return nil + } + return c.DiscoveryClient +} + +// NewForConfig creates a new Clientset for the given config. +// If config's RateLimiter is not set and QPS and Burst are acceptable, +// NewForConfig will generate a rate-limiter in configShallowCopy. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*Clientset, error) { + configShallowCopy := *c + + if configShallowCopy.UserAgent == "" { + configShallowCopy.UserAgent = rest.DefaultKubernetesUserAgent() + } + + // share the transport between all clients + httpClient, err := rest.HTTPClientFor(&configShallowCopy) + if err != nil { + return nil, err + } + + return NewForConfigAndClient(&configShallowCopy, httpClient) +} + +// NewForConfigAndClient creates a new Clientset for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +// If config's RateLimiter is not set and QPS and Burst are acceptable, +// NewForConfigAndClient will generate a rate-limiter in configShallowCopy. +func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, error) { + configShallowCopy := *c + if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { + if configShallowCopy.Burst <= 0 { + return nil, fmt.Errorf("burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0") + } + configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) + } + + var cs Clientset + var err error + cs.kubeovnV1, err = kubeovnv1.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } + + cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } + return &cs, nil +} + +// NewForConfigOrDie creates a new Clientset for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *Clientset { + cs, err := NewForConfig(c) + if err != nil { + panic(err) + } + return cs +} + +// New creates a new Clientset for the given RESTClient. +func New(c rest.Interface) *Clientset { + var cs Clientset + cs.kubeovnV1 = kubeovnv1.New(c) + + cs.DiscoveryClient = discovery.NewDiscoveryClient(c) + return &cs +} diff --git a/pkg/client/listers/clientset/versioned/doc.go b/pkg/client/listers/clientset/versioned/doc.go new file mode 100644 index 00000000000..41721ca52d4 --- /dev/null +++ b/pkg/client/listers/clientset/versioned/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 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 clientset. +package versioned diff --git a/pkg/client/listers/clientset/versioned/fake/clientset_generated.go b/pkg/client/listers/clientset/versioned/fake/clientset_generated.go new file mode 100644 index 00000000000..164d4abfa66 --- /dev/null +++ b/pkg/client/listers/clientset/versioned/fake/clientset_generated.go @@ -0,0 +1,85 @@ +/* +Copyright 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 ( + clientset "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned" + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned/typed/kubeovn/v1" + fakekubeovnv1 "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned/typed/kubeovn/v1/fake" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/discovery" + fakediscovery "k8s.io/client-go/discovery/fake" + "k8s.io/client-go/testing" +) + +// NewSimpleClientset returns a clientset that will respond with the provided objects. +// It's backed by a very simple object tracker that processes creates, updates and deletions as-is, +// without applying any validations and/or defaults. It shouldn't be considered a replacement +// for a real clientset and is mostly useful in simple unit tests. +func NewSimpleClientset(objects ...runtime.Object) *Clientset { + o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) + for _, obj := range objects { + if err := o.Add(obj); err != nil { + panic(err) + } + } + + 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{} + _ testing.FakeClient = &Clientset{} +) + +// KubeovnV1 retrieves the KubeovnV1Client +func (c *Clientset) KubeovnV1() kubeovnv1.KubeovnV1Interface { + return &fakekubeovnv1.FakeKubeovnV1{Fake: &c.Fake} +} diff --git a/pkg/client/listers/clientset/versioned/fake/doc.go b/pkg/client/listers/clientset/versioned/fake/doc.go new file mode 100644 index 00000000000..9b99e716709 --- /dev/null +++ b/pkg/client/listers/clientset/versioned/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 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/pkg/client/listers/clientset/versioned/fake/register.go b/pkg/client/listers/clientset/versioned/fake/register.go new file mode 100644 index 00000000000..fa092d649c1 --- /dev/null +++ b/pkg/client/listers/clientset/versioned/fake/register.go @@ -0,0 +1,56 @@ +/* +Copyright 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 ( + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + 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" +) + +var scheme = runtime.NewScheme() +var codecs = serializer.NewCodecFactory(scheme) + +var localSchemeBuilder = runtime.SchemeBuilder{ + kubeovnv1.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/pkg/client/listers/clientset/versioned/scheme/doc.go b/pkg/client/listers/clientset/versioned/scheme/doc.go new file mode 100644 index 00000000000..7dc3756168f --- /dev/null +++ b/pkg/client/listers/clientset/versioned/scheme/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 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 contains the scheme of the automatically generated clientset. +package scheme diff --git a/pkg/client/listers/clientset/versioned/scheme/register.go b/pkg/client/listers/clientset/versioned/scheme/register.go new file mode 100644 index 00000000000..0aa2b12abff --- /dev/null +++ b/pkg/client/listers/clientset/versioned/scheme/register.go @@ -0,0 +1,56 @@ +/* +Copyright 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 scheme + +import ( + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + 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" +) + +var Scheme = runtime.NewScheme() +var Codecs = serializer.NewCodecFactory(Scheme) +var ParameterCodec = runtime.NewParameterCodec(Scheme) +var localSchemeBuilder = runtime.SchemeBuilder{ + kubeovnv1.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/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/doc.go b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/doc.go new file mode 100644 index 00000000000..3af5d054f10 --- /dev/null +++ b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 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 typed clients. +package v1 diff --git a/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/doc.go b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/doc.go new file mode 100644 index 00000000000..16f44399065 --- /dev/null +++ b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 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/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_htbqos.go b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_htbqos.go new file mode 100644 index 00000000000..da95cb21262 --- /dev/null +++ b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_htbqos.go @@ -0,0 +1,122 @@ +/* +Copyright 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" + + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + 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" +) + +// FakeHtbQoses implements HtbQosInterface +type FakeHtbQoses struct { + Fake *FakeKubeovnV1 +} + +var htbqosesResource = schema.GroupVersionResource{Group: "kubeovn.io", Version: "v1", Resource: "htbqoses"} + +var htbqosesKind = schema.GroupVersionKind{Group: "kubeovn.io", Version: "v1", Kind: "HtbQos"} + +// Get takes name of the htbQos, and returns the corresponding htbQos object, and an error if there is any. +func (c *FakeHtbQoses) Get(ctx context.Context, name string, options v1.GetOptions) (result *kubeovnv1.HtbQos, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(htbqosesResource, name), &kubeovnv1.HtbQos{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.HtbQos), err +} + +// List takes label and field selectors, and returns the list of HtbQoses that match those selectors. +func (c *FakeHtbQoses) List(ctx context.Context, opts v1.ListOptions) (result *kubeovnv1.HtbQosList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(htbqosesResource, htbqosesKind, opts), &kubeovnv1.HtbQosList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &kubeovnv1.HtbQosList{ListMeta: obj.(*kubeovnv1.HtbQosList).ListMeta} + for _, item := range obj.(*kubeovnv1.HtbQosList).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 htbQoses. +func (c *FakeHtbQoses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(htbqosesResource, opts)) +} + +// Create takes the representation of a htbQos and creates it. Returns the server's representation of the htbQos, and an error, if there is any. +func (c *FakeHtbQoses) Create(ctx context.Context, htbQos *kubeovnv1.HtbQos, opts v1.CreateOptions) (result *kubeovnv1.HtbQos, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(htbqosesResource, htbQos), &kubeovnv1.HtbQos{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.HtbQos), err +} + +// Update takes the representation of a htbQos and updates it. Returns the server's representation of the htbQos, and an error, if there is any. +func (c *FakeHtbQoses) Update(ctx context.Context, htbQos *kubeovnv1.HtbQos, opts v1.UpdateOptions) (result *kubeovnv1.HtbQos, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(htbqosesResource, htbQos), &kubeovnv1.HtbQos{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.HtbQos), err +} + +// Delete takes name of the htbQos and deletes it. Returns an error if one occurs. +func (c *FakeHtbQoses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(htbqosesResource, name, opts), &kubeovnv1.HtbQos{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeHtbQoses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(htbqosesResource, listOpts) + + _, err := c.Fake.Invokes(action, &kubeovnv1.HtbQosList{}) + return err +} + +// Patch applies the patch and returns the patched htbQos. +func (c *FakeHtbQoses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *kubeovnv1.HtbQos, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(htbqosesResource, name, pt, data, subresources...), &kubeovnv1.HtbQos{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.HtbQos), err +} diff --git a/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_ip.go b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_ip.go new file mode 100644 index 00000000000..4ea825e77ee --- /dev/null +++ b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_ip.go @@ -0,0 +1,122 @@ +/* +Copyright 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" + + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + 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" +) + +// FakeIPs implements IPInterface +type FakeIPs struct { + Fake *FakeKubeovnV1 +} + +var ipsResource = schema.GroupVersionResource{Group: "kubeovn.io", Version: "v1", Resource: "ips"} + +var ipsKind = schema.GroupVersionKind{Group: "kubeovn.io", Version: "v1", Kind: "IP"} + +// Get takes name of the iP, and returns the corresponding iP object, and an error if there is any. +func (c *FakeIPs) Get(ctx context.Context, name string, options v1.GetOptions) (result *kubeovnv1.IP, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(ipsResource, name), &kubeovnv1.IP{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.IP), err +} + +// List takes label and field selectors, and returns the list of IPs that match those selectors. +func (c *FakeIPs) List(ctx context.Context, opts v1.ListOptions) (result *kubeovnv1.IPList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(ipsResource, ipsKind, opts), &kubeovnv1.IPList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &kubeovnv1.IPList{ListMeta: obj.(*kubeovnv1.IPList).ListMeta} + for _, item := range obj.(*kubeovnv1.IPList).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 iPs. +func (c *FakeIPs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(ipsResource, opts)) +} + +// Create takes the representation of a iP and creates it. Returns the server's representation of the iP, and an error, if there is any. +func (c *FakeIPs) Create(ctx context.Context, iP *kubeovnv1.IP, opts v1.CreateOptions) (result *kubeovnv1.IP, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(ipsResource, iP), &kubeovnv1.IP{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.IP), err +} + +// Update takes the representation of a iP and updates it. Returns the server's representation of the iP, and an error, if there is any. +func (c *FakeIPs) Update(ctx context.Context, iP *kubeovnv1.IP, opts v1.UpdateOptions) (result *kubeovnv1.IP, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(ipsResource, iP), &kubeovnv1.IP{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.IP), err +} + +// Delete takes name of the iP and deletes it. Returns an error if one occurs. +func (c *FakeIPs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(ipsResource, name, opts), &kubeovnv1.IP{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeIPs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(ipsResource, listOpts) + + _, err := c.Fake.Invokes(action, &kubeovnv1.IPList{}) + return err +} + +// Patch applies the patch and returns the patched iP. +func (c *FakeIPs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *kubeovnv1.IP, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(ipsResource, name, pt, data, subresources...), &kubeovnv1.IP{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.IP), err +} diff --git a/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_iptablesdnatrule.go b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_iptablesdnatrule.go new file mode 100644 index 00000000000..76526eff581 --- /dev/null +++ b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_iptablesdnatrule.go @@ -0,0 +1,133 @@ +/* +Copyright 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" + + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + 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" +) + +// FakeIptablesDnatRules implements IptablesDnatRuleInterface +type FakeIptablesDnatRules struct { + Fake *FakeKubeovnV1 +} + +var iptablesdnatrulesResource = schema.GroupVersionResource{Group: "kubeovn.io", Version: "v1", Resource: "iptables-dnat-rules"} + +var iptablesdnatrulesKind = schema.GroupVersionKind{Group: "kubeovn.io", Version: "v1", Kind: "IptablesDnatRule"} + +// Get takes name of the iptablesDnatRule, and returns the corresponding iptablesDnatRule object, and an error if there is any. +func (c *FakeIptablesDnatRules) Get(ctx context.Context, name string, options v1.GetOptions) (result *kubeovnv1.IptablesDnatRule, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(iptablesdnatrulesResource, name), &kubeovnv1.IptablesDnatRule{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.IptablesDnatRule), err +} + +// List takes label and field selectors, and returns the list of IptablesDnatRules that match those selectors. +func (c *FakeIptablesDnatRules) List(ctx context.Context, opts v1.ListOptions) (result *kubeovnv1.IptablesDnatRuleList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(iptablesdnatrulesResource, iptablesdnatrulesKind, opts), &kubeovnv1.IptablesDnatRuleList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &kubeovnv1.IptablesDnatRuleList{ListMeta: obj.(*kubeovnv1.IptablesDnatRuleList).ListMeta} + for _, item := range obj.(*kubeovnv1.IptablesDnatRuleList).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 iptablesDnatRules. +func (c *FakeIptablesDnatRules) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(iptablesdnatrulesResource, opts)) +} + +// Create takes the representation of a iptablesDnatRule and creates it. Returns the server's representation of the iptablesDnatRule, and an error, if there is any. +func (c *FakeIptablesDnatRules) Create(ctx context.Context, iptablesDnatRule *kubeovnv1.IptablesDnatRule, opts v1.CreateOptions) (result *kubeovnv1.IptablesDnatRule, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(iptablesdnatrulesResource, iptablesDnatRule), &kubeovnv1.IptablesDnatRule{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.IptablesDnatRule), err +} + +// Update takes the representation of a iptablesDnatRule and updates it. Returns the server's representation of the iptablesDnatRule, and an error, if there is any. +func (c *FakeIptablesDnatRules) Update(ctx context.Context, iptablesDnatRule *kubeovnv1.IptablesDnatRule, opts v1.UpdateOptions) (result *kubeovnv1.IptablesDnatRule, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(iptablesdnatrulesResource, iptablesDnatRule), &kubeovnv1.IptablesDnatRule{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.IptablesDnatRule), 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 *FakeIptablesDnatRules) UpdateStatus(ctx context.Context, iptablesDnatRule *kubeovnv1.IptablesDnatRule, opts v1.UpdateOptions) (*kubeovnv1.IptablesDnatRule, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(iptablesdnatrulesResource, "status", iptablesDnatRule), &kubeovnv1.IptablesDnatRule{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.IptablesDnatRule), err +} + +// Delete takes name of the iptablesDnatRule and deletes it. Returns an error if one occurs. +func (c *FakeIptablesDnatRules) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(iptablesdnatrulesResource, name, opts), &kubeovnv1.IptablesDnatRule{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeIptablesDnatRules) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(iptablesdnatrulesResource, listOpts) + + _, err := c.Fake.Invokes(action, &kubeovnv1.IptablesDnatRuleList{}) + return err +} + +// Patch applies the patch and returns the patched iptablesDnatRule. +func (c *FakeIptablesDnatRules) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *kubeovnv1.IptablesDnatRule, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(iptablesdnatrulesResource, name, pt, data, subresources...), &kubeovnv1.IptablesDnatRule{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.IptablesDnatRule), err +} diff --git a/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_iptableseip.go b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_iptableseip.go new file mode 100644 index 00000000000..3634fa55370 --- /dev/null +++ b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_iptableseip.go @@ -0,0 +1,133 @@ +/* +Copyright 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" + + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + 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" +) + +// FakeIptablesEIPs implements IptablesEIPInterface +type FakeIptablesEIPs struct { + Fake *FakeKubeovnV1 +} + +var iptableseipsResource = schema.GroupVersionResource{Group: "kubeovn.io", Version: "v1", Resource: "iptables-eips"} + +var iptableseipsKind = schema.GroupVersionKind{Group: "kubeovn.io", Version: "v1", Kind: "IptablesEIP"} + +// Get takes name of the iptablesEIP, and returns the corresponding iptablesEIP object, and an error if there is any. +func (c *FakeIptablesEIPs) Get(ctx context.Context, name string, options v1.GetOptions) (result *kubeovnv1.IptablesEIP, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(iptableseipsResource, name), &kubeovnv1.IptablesEIP{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.IptablesEIP), err +} + +// List takes label and field selectors, and returns the list of IptablesEIPs that match those selectors. +func (c *FakeIptablesEIPs) List(ctx context.Context, opts v1.ListOptions) (result *kubeovnv1.IptablesEIPList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(iptableseipsResource, iptableseipsKind, opts), &kubeovnv1.IptablesEIPList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &kubeovnv1.IptablesEIPList{ListMeta: obj.(*kubeovnv1.IptablesEIPList).ListMeta} + for _, item := range obj.(*kubeovnv1.IptablesEIPList).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 iptablesEIPs. +func (c *FakeIptablesEIPs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(iptableseipsResource, opts)) +} + +// Create takes the representation of a iptablesEIP and creates it. Returns the server's representation of the iptablesEIP, and an error, if there is any. +func (c *FakeIptablesEIPs) Create(ctx context.Context, iptablesEIP *kubeovnv1.IptablesEIP, opts v1.CreateOptions) (result *kubeovnv1.IptablesEIP, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(iptableseipsResource, iptablesEIP), &kubeovnv1.IptablesEIP{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.IptablesEIP), err +} + +// Update takes the representation of a iptablesEIP and updates it. Returns the server's representation of the iptablesEIP, and an error, if there is any. +func (c *FakeIptablesEIPs) Update(ctx context.Context, iptablesEIP *kubeovnv1.IptablesEIP, opts v1.UpdateOptions) (result *kubeovnv1.IptablesEIP, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(iptableseipsResource, iptablesEIP), &kubeovnv1.IptablesEIP{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.IptablesEIP), 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 *FakeIptablesEIPs) UpdateStatus(ctx context.Context, iptablesEIP *kubeovnv1.IptablesEIP, opts v1.UpdateOptions) (*kubeovnv1.IptablesEIP, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(iptableseipsResource, "status", iptablesEIP), &kubeovnv1.IptablesEIP{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.IptablesEIP), err +} + +// Delete takes name of the iptablesEIP and deletes it. Returns an error if one occurs. +func (c *FakeIptablesEIPs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(iptableseipsResource, name, opts), &kubeovnv1.IptablesEIP{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeIptablesEIPs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(iptableseipsResource, listOpts) + + _, err := c.Fake.Invokes(action, &kubeovnv1.IptablesEIPList{}) + return err +} + +// Patch applies the patch and returns the patched iptablesEIP. +func (c *FakeIptablesEIPs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *kubeovnv1.IptablesEIP, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(iptableseipsResource, name, pt, data, subresources...), &kubeovnv1.IptablesEIP{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.IptablesEIP), err +} diff --git a/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_iptablesfiprule.go b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_iptablesfiprule.go new file mode 100644 index 00000000000..9728282aaa8 --- /dev/null +++ b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_iptablesfiprule.go @@ -0,0 +1,133 @@ +/* +Copyright 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" + + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + 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" +) + +// FakeIptablesFIPRules implements IptablesFIPRuleInterface +type FakeIptablesFIPRules struct { + Fake *FakeKubeovnV1 +} + +var iptablesfiprulesResource = schema.GroupVersionResource{Group: "kubeovn.io", Version: "v1", Resource: "iptables-fip-rules"} + +var iptablesfiprulesKind = schema.GroupVersionKind{Group: "kubeovn.io", Version: "v1", Kind: "IptablesFIPRule"} + +// Get takes name of the iptablesFIPRule, and returns the corresponding iptablesFIPRule object, and an error if there is any. +func (c *FakeIptablesFIPRules) Get(ctx context.Context, name string, options v1.GetOptions) (result *kubeovnv1.IptablesFIPRule, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(iptablesfiprulesResource, name), &kubeovnv1.IptablesFIPRule{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.IptablesFIPRule), err +} + +// List takes label and field selectors, and returns the list of IptablesFIPRules that match those selectors. +func (c *FakeIptablesFIPRules) List(ctx context.Context, opts v1.ListOptions) (result *kubeovnv1.IptablesFIPRuleList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(iptablesfiprulesResource, iptablesfiprulesKind, opts), &kubeovnv1.IptablesFIPRuleList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &kubeovnv1.IptablesFIPRuleList{ListMeta: obj.(*kubeovnv1.IptablesFIPRuleList).ListMeta} + for _, item := range obj.(*kubeovnv1.IptablesFIPRuleList).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 iptablesFIPRules. +func (c *FakeIptablesFIPRules) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(iptablesfiprulesResource, opts)) +} + +// Create takes the representation of a iptablesFIPRule and creates it. Returns the server's representation of the iptablesFIPRule, and an error, if there is any. +func (c *FakeIptablesFIPRules) Create(ctx context.Context, iptablesFIPRule *kubeovnv1.IptablesFIPRule, opts v1.CreateOptions) (result *kubeovnv1.IptablesFIPRule, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(iptablesfiprulesResource, iptablesFIPRule), &kubeovnv1.IptablesFIPRule{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.IptablesFIPRule), err +} + +// Update takes the representation of a iptablesFIPRule and updates it. Returns the server's representation of the iptablesFIPRule, and an error, if there is any. +func (c *FakeIptablesFIPRules) Update(ctx context.Context, iptablesFIPRule *kubeovnv1.IptablesFIPRule, opts v1.UpdateOptions) (result *kubeovnv1.IptablesFIPRule, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(iptablesfiprulesResource, iptablesFIPRule), &kubeovnv1.IptablesFIPRule{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.IptablesFIPRule), 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 *FakeIptablesFIPRules) UpdateStatus(ctx context.Context, iptablesFIPRule *kubeovnv1.IptablesFIPRule, opts v1.UpdateOptions) (*kubeovnv1.IptablesFIPRule, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(iptablesfiprulesResource, "status", iptablesFIPRule), &kubeovnv1.IptablesFIPRule{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.IptablesFIPRule), err +} + +// Delete takes name of the iptablesFIPRule and deletes it. Returns an error if one occurs. +func (c *FakeIptablesFIPRules) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(iptablesfiprulesResource, name, opts), &kubeovnv1.IptablesFIPRule{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeIptablesFIPRules) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(iptablesfiprulesResource, listOpts) + + _, err := c.Fake.Invokes(action, &kubeovnv1.IptablesFIPRuleList{}) + return err +} + +// Patch applies the patch and returns the patched iptablesFIPRule. +func (c *FakeIptablesFIPRules) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *kubeovnv1.IptablesFIPRule, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(iptablesfiprulesResource, name, pt, data, subresources...), &kubeovnv1.IptablesFIPRule{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.IptablesFIPRule), err +} diff --git a/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_iptablessnatrule.go b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_iptablessnatrule.go new file mode 100644 index 00000000000..dfda17aba80 --- /dev/null +++ b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_iptablessnatrule.go @@ -0,0 +1,133 @@ +/* +Copyright 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" + + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + 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" +) + +// FakeIptablesSnatRules implements IptablesSnatRuleInterface +type FakeIptablesSnatRules struct { + Fake *FakeKubeovnV1 +} + +var iptablessnatrulesResource = schema.GroupVersionResource{Group: "kubeovn.io", Version: "v1", Resource: "iptables-snat-rules"} + +var iptablessnatrulesKind = schema.GroupVersionKind{Group: "kubeovn.io", Version: "v1", Kind: "IptablesSnatRule"} + +// Get takes name of the iptablesSnatRule, and returns the corresponding iptablesSnatRule object, and an error if there is any. +func (c *FakeIptablesSnatRules) Get(ctx context.Context, name string, options v1.GetOptions) (result *kubeovnv1.IptablesSnatRule, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(iptablessnatrulesResource, name), &kubeovnv1.IptablesSnatRule{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.IptablesSnatRule), err +} + +// List takes label and field selectors, and returns the list of IptablesSnatRules that match those selectors. +func (c *FakeIptablesSnatRules) List(ctx context.Context, opts v1.ListOptions) (result *kubeovnv1.IptablesSnatRuleList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(iptablessnatrulesResource, iptablessnatrulesKind, opts), &kubeovnv1.IptablesSnatRuleList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &kubeovnv1.IptablesSnatRuleList{ListMeta: obj.(*kubeovnv1.IptablesSnatRuleList).ListMeta} + for _, item := range obj.(*kubeovnv1.IptablesSnatRuleList).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 iptablesSnatRules. +func (c *FakeIptablesSnatRules) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(iptablessnatrulesResource, opts)) +} + +// Create takes the representation of a iptablesSnatRule and creates it. Returns the server's representation of the iptablesSnatRule, and an error, if there is any. +func (c *FakeIptablesSnatRules) Create(ctx context.Context, iptablesSnatRule *kubeovnv1.IptablesSnatRule, opts v1.CreateOptions) (result *kubeovnv1.IptablesSnatRule, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(iptablessnatrulesResource, iptablesSnatRule), &kubeovnv1.IptablesSnatRule{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.IptablesSnatRule), err +} + +// Update takes the representation of a iptablesSnatRule and updates it. Returns the server's representation of the iptablesSnatRule, and an error, if there is any. +func (c *FakeIptablesSnatRules) Update(ctx context.Context, iptablesSnatRule *kubeovnv1.IptablesSnatRule, opts v1.UpdateOptions) (result *kubeovnv1.IptablesSnatRule, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(iptablessnatrulesResource, iptablesSnatRule), &kubeovnv1.IptablesSnatRule{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.IptablesSnatRule), 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 *FakeIptablesSnatRules) UpdateStatus(ctx context.Context, iptablesSnatRule *kubeovnv1.IptablesSnatRule, opts v1.UpdateOptions) (*kubeovnv1.IptablesSnatRule, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(iptablessnatrulesResource, "status", iptablesSnatRule), &kubeovnv1.IptablesSnatRule{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.IptablesSnatRule), err +} + +// Delete takes name of the iptablesSnatRule and deletes it. Returns an error if one occurs. +func (c *FakeIptablesSnatRules) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(iptablessnatrulesResource, name, opts), &kubeovnv1.IptablesSnatRule{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeIptablesSnatRules) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(iptablessnatrulesResource, listOpts) + + _, err := c.Fake.Invokes(action, &kubeovnv1.IptablesSnatRuleList{}) + return err +} + +// Patch applies the patch and returns the patched iptablesSnatRule. +func (c *FakeIptablesSnatRules) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *kubeovnv1.IptablesSnatRule, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(iptablessnatrulesResource, name, pt, data, subresources...), &kubeovnv1.IptablesSnatRule{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.IptablesSnatRule), err +} diff --git a/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_kubeovn_client.go b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_kubeovn_client.go new file mode 100644 index 00000000000..554c72654e0 --- /dev/null +++ b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_kubeovn_client.go @@ -0,0 +1,108 @@ +/* +Copyright 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 "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned/typed/kubeovn/v1" + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" +) + +type FakeKubeovnV1 struct { + *testing.Fake +} + +func (c *FakeKubeovnV1) HtbQoses() v1.HtbQosInterface { + return &FakeHtbQoses{c} +} + +func (c *FakeKubeovnV1) IPs() v1.IPInterface { + return &FakeIPs{c} +} + +func (c *FakeKubeovnV1) IptablesDnatRules() v1.IptablesDnatRuleInterface { + return &FakeIptablesDnatRules{c} +} + +func (c *FakeKubeovnV1) IptablesEIPs() v1.IptablesEIPInterface { + return &FakeIptablesEIPs{c} +} + +func (c *FakeKubeovnV1) IptablesFIPRules() v1.IptablesFIPRuleInterface { + return &FakeIptablesFIPRules{c} +} + +func (c *FakeKubeovnV1) IptablesSnatRules() v1.IptablesSnatRuleInterface { + return &FakeIptablesSnatRules{c} +} + +func (c *FakeKubeovnV1) OvnEips() v1.OvnEipInterface { + return &FakeOvnEips{c} +} + +func (c *FakeKubeovnV1) OvnFips() v1.OvnFipInterface { + return &FakeOvnFips{c} +} + +func (c *FakeKubeovnV1) OvnSnatRules() v1.OvnSnatRuleInterface { + return &FakeOvnSnatRules{c} +} + +func (c *FakeKubeovnV1) ProviderNetworks() v1.ProviderNetworkInterface { + return &FakeProviderNetworks{c} +} + +func (c *FakeKubeovnV1) SecurityGroups() v1.SecurityGroupInterface { + return &FakeSecurityGroups{c} +} + +func (c *FakeKubeovnV1) Subnets() v1.SubnetInterface { + return &FakeSubnets{c} +} + +func (c *FakeKubeovnV1) SwitchLBRules() v1.SwitchLBRuleInterface { + return &FakeSwitchLBRules{c} +} + +func (c *FakeKubeovnV1) Vips() v1.VipInterface { + return &FakeVips{c} +} + +func (c *FakeKubeovnV1) Vlans() v1.VlanInterface { + return &FakeVlans{c} +} + +func (c *FakeKubeovnV1) Vpcs() v1.VpcInterface { + return &FakeVpcs{c} +} + +func (c *FakeKubeovnV1) VpcDnses() v1.VpcDnsInterface { + return &FakeVpcDnses{c} +} + +func (c *FakeKubeovnV1) VpcNatGateways() v1.VpcNatGatewayInterface { + return &FakeVpcNatGateways{c} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeKubeovnV1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_ovneip.go b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_ovneip.go new file mode 100644 index 00000000000..7c57fbc93d1 --- /dev/null +++ b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_ovneip.go @@ -0,0 +1,133 @@ +/* +Copyright 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" + + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + 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" +) + +// FakeOvnEips implements OvnEipInterface +type FakeOvnEips struct { + Fake *FakeKubeovnV1 +} + +var ovneipsResource = schema.GroupVersionResource{Group: "kubeovn.io", Version: "v1", Resource: "ovn-eips"} + +var ovneipsKind = schema.GroupVersionKind{Group: "kubeovn.io", Version: "v1", Kind: "OvnEip"} + +// Get takes name of the ovnEip, and returns the corresponding ovnEip object, and an error if there is any. +func (c *FakeOvnEips) Get(ctx context.Context, name string, options v1.GetOptions) (result *kubeovnv1.OvnEip, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(ovneipsResource, name), &kubeovnv1.OvnEip{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.OvnEip), err +} + +// List takes label and field selectors, and returns the list of OvnEips that match those selectors. +func (c *FakeOvnEips) List(ctx context.Context, opts v1.ListOptions) (result *kubeovnv1.OvnEipList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(ovneipsResource, ovneipsKind, opts), &kubeovnv1.OvnEipList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &kubeovnv1.OvnEipList{ListMeta: obj.(*kubeovnv1.OvnEipList).ListMeta} + for _, item := range obj.(*kubeovnv1.OvnEipList).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 ovnEips. +func (c *FakeOvnEips) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(ovneipsResource, opts)) +} + +// Create takes the representation of a ovnEip and creates it. Returns the server's representation of the ovnEip, and an error, if there is any. +func (c *FakeOvnEips) Create(ctx context.Context, ovnEip *kubeovnv1.OvnEip, opts v1.CreateOptions) (result *kubeovnv1.OvnEip, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(ovneipsResource, ovnEip), &kubeovnv1.OvnEip{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.OvnEip), err +} + +// Update takes the representation of a ovnEip and updates it. Returns the server's representation of the ovnEip, and an error, if there is any. +func (c *FakeOvnEips) Update(ctx context.Context, ovnEip *kubeovnv1.OvnEip, opts v1.UpdateOptions) (result *kubeovnv1.OvnEip, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(ovneipsResource, ovnEip), &kubeovnv1.OvnEip{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.OvnEip), 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 *FakeOvnEips) UpdateStatus(ctx context.Context, ovnEip *kubeovnv1.OvnEip, opts v1.UpdateOptions) (*kubeovnv1.OvnEip, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(ovneipsResource, "status", ovnEip), &kubeovnv1.OvnEip{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.OvnEip), err +} + +// Delete takes name of the ovnEip and deletes it. Returns an error if one occurs. +func (c *FakeOvnEips) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(ovneipsResource, name, opts), &kubeovnv1.OvnEip{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeOvnEips) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(ovneipsResource, listOpts) + + _, err := c.Fake.Invokes(action, &kubeovnv1.OvnEipList{}) + return err +} + +// Patch applies the patch and returns the patched ovnEip. +func (c *FakeOvnEips) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *kubeovnv1.OvnEip, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(ovneipsResource, name, pt, data, subresources...), &kubeovnv1.OvnEip{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.OvnEip), err +} diff --git a/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_ovnfip.go b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_ovnfip.go new file mode 100644 index 00000000000..e62c1df7a6f --- /dev/null +++ b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_ovnfip.go @@ -0,0 +1,133 @@ +/* +Copyright 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" + + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + 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" +) + +// FakeOvnFips implements OvnFipInterface +type FakeOvnFips struct { + Fake *FakeKubeovnV1 +} + +var ovnfipsResource = schema.GroupVersionResource{Group: "kubeovn.io", Version: "v1", Resource: "ovn-fips"} + +var ovnfipsKind = schema.GroupVersionKind{Group: "kubeovn.io", Version: "v1", Kind: "OvnFip"} + +// Get takes name of the ovnFip, and returns the corresponding ovnFip object, and an error if there is any. +func (c *FakeOvnFips) Get(ctx context.Context, name string, options v1.GetOptions) (result *kubeovnv1.OvnFip, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(ovnfipsResource, name), &kubeovnv1.OvnFip{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.OvnFip), err +} + +// List takes label and field selectors, and returns the list of OvnFips that match those selectors. +func (c *FakeOvnFips) List(ctx context.Context, opts v1.ListOptions) (result *kubeovnv1.OvnFipList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(ovnfipsResource, ovnfipsKind, opts), &kubeovnv1.OvnFipList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &kubeovnv1.OvnFipList{ListMeta: obj.(*kubeovnv1.OvnFipList).ListMeta} + for _, item := range obj.(*kubeovnv1.OvnFipList).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 ovnFips. +func (c *FakeOvnFips) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(ovnfipsResource, opts)) +} + +// Create takes the representation of a ovnFip and creates it. Returns the server's representation of the ovnFip, and an error, if there is any. +func (c *FakeOvnFips) Create(ctx context.Context, ovnFip *kubeovnv1.OvnFip, opts v1.CreateOptions) (result *kubeovnv1.OvnFip, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(ovnfipsResource, ovnFip), &kubeovnv1.OvnFip{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.OvnFip), err +} + +// Update takes the representation of a ovnFip and updates it. Returns the server's representation of the ovnFip, and an error, if there is any. +func (c *FakeOvnFips) Update(ctx context.Context, ovnFip *kubeovnv1.OvnFip, opts v1.UpdateOptions) (result *kubeovnv1.OvnFip, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(ovnfipsResource, ovnFip), &kubeovnv1.OvnFip{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.OvnFip), 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 *FakeOvnFips) UpdateStatus(ctx context.Context, ovnFip *kubeovnv1.OvnFip, opts v1.UpdateOptions) (*kubeovnv1.OvnFip, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(ovnfipsResource, "status", ovnFip), &kubeovnv1.OvnFip{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.OvnFip), err +} + +// Delete takes name of the ovnFip and deletes it. Returns an error if one occurs. +func (c *FakeOvnFips) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(ovnfipsResource, name, opts), &kubeovnv1.OvnFip{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeOvnFips) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(ovnfipsResource, listOpts) + + _, err := c.Fake.Invokes(action, &kubeovnv1.OvnFipList{}) + return err +} + +// Patch applies the patch and returns the patched ovnFip. +func (c *FakeOvnFips) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *kubeovnv1.OvnFip, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(ovnfipsResource, name, pt, data, subresources...), &kubeovnv1.OvnFip{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.OvnFip), err +} diff --git a/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_ovnsnatrule.go b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_ovnsnatrule.go new file mode 100644 index 00000000000..174716cea12 --- /dev/null +++ b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_ovnsnatrule.go @@ -0,0 +1,133 @@ +/* +Copyright 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" + + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + 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" +) + +// FakeOvnSnatRules implements OvnSnatRuleInterface +type FakeOvnSnatRules struct { + Fake *FakeKubeovnV1 +} + +var ovnsnatrulesResource = schema.GroupVersionResource{Group: "kubeovn.io", Version: "v1", Resource: "ovn-snat-rules"} + +var ovnsnatrulesKind = schema.GroupVersionKind{Group: "kubeovn.io", Version: "v1", Kind: "OvnSnatRule"} + +// Get takes name of the ovnSnatRule, and returns the corresponding ovnSnatRule object, and an error if there is any. +func (c *FakeOvnSnatRules) Get(ctx context.Context, name string, options v1.GetOptions) (result *kubeovnv1.OvnSnatRule, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(ovnsnatrulesResource, name), &kubeovnv1.OvnSnatRule{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.OvnSnatRule), err +} + +// List takes label and field selectors, and returns the list of OvnSnatRules that match those selectors. +func (c *FakeOvnSnatRules) List(ctx context.Context, opts v1.ListOptions) (result *kubeovnv1.OvnSnatRuleList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(ovnsnatrulesResource, ovnsnatrulesKind, opts), &kubeovnv1.OvnSnatRuleList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &kubeovnv1.OvnSnatRuleList{ListMeta: obj.(*kubeovnv1.OvnSnatRuleList).ListMeta} + for _, item := range obj.(*kubeovnv1.OvnSnatRuleList).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 ovnSnatRules. +func (c *FakeOvnSnatRules) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(ovnsnatrulesResource, opts)) +} + +// Create takes the representation of a ovnSnatRule and creates it. Returns the server's representation of the ovnSnatRule, and an error, if there is any. +func (c *FakeOvnSnatRules) Create(ctx context.Context, ovnSnatRule *kubeovnv1.OvnSnatRule, opts v1.CreateOptions) (result *kubeovnv1.OvnSnatRule, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(ovnsnatrulesResource, ovnSnatRule), &kubeovnv1.OvnSnatRule{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.OvnSnatRule), err +} + +// Update takes the representation of a ovnSnatRule and updates it. Returns the server's representation of the ovnSnatRule, and an error, if there is any. +func (c *FakeOvnSnatRules) Update(ctx context.Context, ovnSnatRule *kubeovnv1.OvnSnatRule, opts v1.UpdateOptions) (result *kubeovnv1.OvnSnatRule, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(ovnsnatrulesResource, ovnSnatRule), &kubeovnv1.OvnSnatRule{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.OvnSnatRule), 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 *FakeOvnSnatRules) UpdateStatus(ctx context.Context, ovnSnatRule *kubeovnv1.OvnSnatRule, opts v1.UpdateOptions) (*kubeovnv1.OvnSnatRule, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(ovnsnatrulesResource, "status", ovnSnatRule), &kubeovnv1.OvnSnatRule{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.OvnSnatRule), err +} + +// Delete takes name of the ovnSnatRule and deletes it. Returns an error if one occurs. +func (c *FakeOvnSnatRules) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(ovnsnatrulesResource, name, opts), &kubeovnv1.OvnSnatRule{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeOvnSnatRules) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(ovnsnatrulesResource, listOpts) + + _, err := c.Fake.Invokes(action, &kubeovnv1.OvnSnatRuleList{}) + return err +} + +// Patch applies the patch and returns the patched ovnSnatRule. +func (c *FakeOvnSnatRules) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *kubeovnv1.OvnSnatRule, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(ovnsnatrulesResource, name, pt, data, subresources...), &kubeovnv1.OvnSnatRule{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.OvnSnatRule), err +} diff --git a/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_providernetwork.go b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_providernetwork.go new file mode 100644 index 00000000000..ef7b5b6831f --- /dev/null +++ b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_providernetwork.go @@ -0,0 +1,133 @@ +/* +Copyright 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" + + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + 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" +) + +// FakeProviderNetworks implements ProviderNetworkInterface +type FakeProviderNetworks struct { + Fake *FakeKubeovnV1 +} + +var providernetworksResource = schema.GroupVersionResource{Group: "kubeovn.io", Version: "v1", Resource: "provider-networks"} + +var providernetworksKind = schema.GroupVersionKind{Group: "kubeovn.io", Version: "v1", Kind: "ProviderNetwork"} + +// Get takes name of the providerNetwork, and returns the corresponding providerNetwork object, and an error if there is any. +func (c *FakeProviderNetworks) Get(ctx context.Context, name string, options v1.GetOptions) (result *kubeovnv1.ProviderNetwork, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(providernetworksResource, name), &kubeovnv1.ProviderNetwork{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.ProviderNetwork), err +} + +// List takes label and field selectors, and returns the list of ProviderNetworks that match those selectors. +func (c *FakeProviderNetworks) List(ctx context.Context, opts v1.ListOptions) (result *kubeovnv1.ProviderNetworkList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(providernetworksResource, providernetworksKind, opts), &kubeovnv1.ProviderNetworkList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &kubeovnv1.ProviderNetworkList{ListMeta: obj.(*kubeovnv1.ProviderNetworkList).ListMeta} + for _, item := range obj.(*kubeovnv1.ProviderNetworkList).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 providerNetworks. +func (c *FakeProviderNetworks) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(providernetworksResource, opts)) +} + +// Create takes the representation of a providerNetwork and creates it. Returns the server's representation of the providerNetwork, and an error, if there is any. +func (c *FakeProviderNetworks) Create(ctx context.Context, providerNetwork *kubeovnv1.ProviderNetwork, opts v1.CreateOptions) (result *kubeovnv1.ProviderNetwork, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(providernetworksResource, providerNetwork), &kubeovnv1.ProviderNetwork{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.ProviderNetwork), err +} + +// Update takes the representation of a providerNetwork and updates it. Returns the server's representation of the providerNetwork, and an error, if there is any. +func (c *FakeProviderNetworks) Update(ctx context.Context, providerNetwork *kubeovnv1.ProviderNetwork, opts v1.UpdateOptions) (result *kubeovnv1.ProviderNetwork, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(providernetworksResource, providerNetwork), &kubeovnv1.ProviderNetwork{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.ProviderNetwork), 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 *FakeProviderNetworks) UpdateStatus(ctx context.Context, providerNetwork *kubeovnv1.ProviderNetwork, opts v1.UpdateOptions) (*kubeovnv1.ProviderNetwork, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(providernetworksResource, "status", providerNetwork), &kubeovnv1.ProviderNetwork{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.ProviderNetwork), err +} + +// Delete takes name of the providerNetwork and deletes it. Returns an error if one occurs. +func (c *FakeProviderNetworks) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(providernetworksResource, name, opts), &kubeovnv1.ProviderNetwork{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeProviderNetworks) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(providernetworksResource, listOpts) + + _, err := c.Fake.Invokes(action, &kubeovnv1.ProviderNetworkList{}) + return err +} + +// Patch applies the patch and returns the patched providerNetwork. +func (c *FakeProviderNetworks) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *kubeovnv1.ProviderNetwork, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(providernetworksResource, name, pt, data, subresources...), &kubeovnv1.ProviderNetwork{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.ProviderNetwork), err +} diff --git a/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_securitygroup.go b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_securitygroup.go new file mode 100644 index 00000000000..58690a1c8ee --- /dev/null +++ b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_securitygroup.go @@ -0,0 +1,133 @@ +/* +Copyright 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" + + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + 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" +) + +// FakeSecurityGroups implements SecurityGroupInterface +type FakeSecurityGroups struct { + Fake *FakeKubeovnV1 +} + +var securitygroupsResource = schema.GroupVersionResource{Group: "kubeovn.io", Version: "v1", Resource: "security-groups"} + +var securitygroupsKind = schema.GroupVersionKind{Group: "kubeovn.io", Version: "v1", Kind: "SecurityGroup"} + +// Get takes name of the securityGroup, and returns the corresponding securityGroup object, and an error if there is any. +func (c *FakeSecurityGroups) Get(ctx context.Context, name string, options v1.GetOptions) (result *kubeovnv1.SecurityGroup, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(securitygroupsResource, name), &kubeovnv1.SecurityGroup{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.SecurityGroup), err +} + +// List takes label and field selectors, and returns the list of SecurityGroups that match those selectors. +func (c *FakeSecurityGroups) List(ctx context.Context, opts v1.ListOptions) (result *kubeovnv1.SecurityGroupList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(securitygroupsResource, securitygroupsKind, opts), &kubeovnv1.SecurityGroupList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &kubeovnv1.SecurityGroupList{ListMeta: obj.(*kubeovnv1.SecurityGroupList).ListMeta} + for _, item := range obj.(*kubeovnv1.SecurityGroupList).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 securityGroups. +func (c *FakeSecurityGroups) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(securitygroupsResource, opts)) +} + +// Create takes the representation of a securityGroup and creates it. Returns the server's representation of the securityGroup, and an error, if there is any. +func (c *FakeSecurityGroups) Create(ctx context.Context, securityGroup *kubeovnv1.SecurityGroup, opts v1.CreateOptions) (result *kubeovnv1.SecurityGroup, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(securitygroupsResource, securityGroup), &kubeovnv1.SecurityGroup{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.SecurityGroup), err +} + +// Update takes the representation of a securityGroup and updates it. Returns the server's representation of the securityGroup, and an error, if there is any. +func (c *FakeSecurityGroups) Update(ctx context.Context, securityGroup *kubeovnv1.SecurityGroup, opts v1.UpdateOptions) (result *kubeovnv1.SecurityGroup, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(securitygroupsResource, securityGroup), &kubeovnv1.SecurityGroup{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.SecurityGroup), 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 *FakeSecurityGroups) UpdateStatus(ctx context.Context, securityGroup *kubeovnv1.SecurityGroup, opts v1.UpdateOptions) (*kubeovnv1.SecurityGroup, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(securitygroupsResource, "status", securityGroup), &kubeovnv1.SecurityGroup{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.SecurityGroup), err +} + +// Delete takes name of the securityGroup and deletes it. Returns an error if one occurs. +func (c *FakeSecurityGroups) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(securitygroupsResource, name, opts), &kubeovnv1.SecurityGroup{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeSecurityGroups) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(securitygroupsResource, listOpts) + + _, err := c.Fake.Invokes(action, &kubeovnv1.SecurityGroupList{}) + return err +} + +// Patch applies the patch and returns the patched securityGroup. +func (c *FakeSecurityGroups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *kubeovnv1.SecurityGroup, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(securitygroupsResource, name, pt, data, subresources...), &kubeovnv1.SecurityGroup{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.SecurityGroup), err +} diff --git a/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_subnet.go b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_subnet.go new file mode 100644 index 00000000000..18c7512188a --- /dev/null +++ b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_subnet.go @@ -0,0 +1,133 @@ +/* +Copyright 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" + + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + 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" +) + +// FakeSubnets implements SubnetInterface +type FakeSubnets struct { + Fake *FakeKubeovnV1 +} + +var subnetsResource = schema.GroupVersionResource{Group: "kubeovn.io", Version: "v1", Resource: "subnets"} + +var subnetsKind = schema.GroupVersionKind{Group: "kubeovn.io", Version: "v1", Kind: "Subnet"} + +// Get takes name of the subnet, and returns the corresponding subnet object, and an error if there is any. +func (c *FakeSubnets) Get(ctx context.Context, name string, options v1.GetOptions) (result *kubeovnv1.Subnet, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(subnetsResource, name), &kubeovnv1.Subnet{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.Subnet), err +} + +// List takes label and field selectors, and returns the list of Subnets that match those selectors. +func (c *FakeSubnets) List(ctx context.Context, opts v1.ListOptions) (result *kubeovnv1.SubnetList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(subnetsResource, subnetsKind, opts), &kubeovnv1.SubnetList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &kubeovnv1.SubnetList{ListMeta: obj.(*kubeovnv1.SubnetList).ListMeta} + for _, item := range obj.(*kubeovnv1.SubnetList).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 subnets. +func (c *FakeSubnets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(subnetsResource, opts)) +} + +// Create takes the representation of a subnet and creates it. Returns the server's representation of the subnet, and an error, if there is any. +func (c *FakeSubnets) Create(ctx context.Context, subnet *kubeovnv1.Subnet, opts v1.CreateOptions) (result *kubeovnv1.Subnet, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(subnetsResource, subnet), &kubeovnv1.Subnet{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.Subnet), err +} + +// Update takes the representation of a subnet and updates it. Returns the server's representation of the subnet, and an error, if there is any. +func (c *FakeSubnets) Update(ctx context.Context, subnet *kubeovnv1.Subnet, opts v1.UpdateOptions) (result *kubeovnv1.Subnet, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(subnetsResource, subnet), &kubeovnv1.Subnet{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.Subnet), 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 *FakeSubnets) UpdateStatus(ctx context.Context, subnet *kubeovnv1.Subnet, opts v1.UpdateOptions) (*kubeovnv1.Subnet, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(subnetsResource, "status", subnet), &kubeovnv1.Subnet{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.Subnet), err +} + +// Delete takes name of the subnet and deletes it. Returns an error if one occurs. +func (c *FakeSubnets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(subnetsResource, name, opts), &kubeovnv1.Subnet{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeSubnets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(subnetsResource, listOpts) + + _, err := c.Fake.Invokes(action, &kubeovnv1.SubnetList{}) + return err +} + +// Patch applies the patch and returns the patched subnet. +func (c *FakeSubnets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *kubeovnv1.Subnet, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(subnetsResource, name, pt, data, subresources...), &kubeovnv1.Subnet{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.Subnet), err +} diff --git a/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_switchlbrule.go b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_switchlbrule.go new file mode 100644 index 00000000000..237d3447795 --- /dev/null +++ b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_switchlbrule.go @@ -0,0 +1,133 @@ +/* +Copyright 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" + + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + 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" +) + +// FakeSwitchLBRules implements SwitchLBRuleInterface +type FakeSwitchLBRules struct { + Fake *FakeKubeovnV1 +} + +var switchlbrulesResource = schema.GroupVersionResource{Group: "kubeovn.io", Version: "v1", Resource: "switch-lb-rules"} + +var switchlbrulesKind = schema.GroupVersionKind{Group: "kubeovn.io", Version: "v1", Kind: "SwitchLBRule"} + +// Get takes name of the switchLBRule, and returns the corresponding switchLBRule object, and an error if there is any. +func (c *FakeSwitchLBRules) Get(ctx context.Context, name string, options v1.GetOptions) (result *kubeovnv1.SwitchLBRule, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(switchlbrulesResource, name), &kubeovnv1.SwitchLBRule{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.SwitchLBRule), err +} + +// List takes label and field selectors, and returns the list of SwitchLBRules that match those selectors. +func (c *FakeSwitchLBRules) List(ctx context.Context, opts v1.ListOptions) (result *kubeovnv1.SwitchLBRuleList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(switchlbrulesResource, switchlbrulesKind, opts), &kubeovnv1.SwitchLBRuleList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &kubeovnv1.SwitchLBRuleList{ListMeta: obj.(*kubeovnv1.SwitchLBRuleList).ListMeta} + for _, item := range obj.(*kubeovnv1.SwitchLBRuleList).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 switchLBRules. +func (c *FakeSwitchLBRules) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(switchlbrulesResource, opts)) +} + +// Create takes the representation of a switchLBRule and creates it. Returns the server's representation of the switchLBRule, and an error, if there is any. +func (c *FakeSwitchLBRules) Create(ctx context.Context, switchLBRule *kubeovnv1.SwitchLBRule, opts v1.CreateOptions) (result *kubeovnv1.SwitchLBRule, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(switchlbrulesResource, switchLBRule), &kubeovnv1.SwitchLBRule{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.SwitchLBRule), err +} + +// Update takes the representation of a switchLBRule and updates it. Returns the server's representation of the switchLBRule, and an error, if there is any. +func (c *FakeSwitchLBRules) Update(ctx context.Context, switchLBRule *kubeovnv1.SwitchLBRule, opts v1.UpdateOptions) (result *kubeovnv1.SwitchLBRule, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(switchlbrulesResource, switchLBRule), &kubeovnv1.SwitchLBRule{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.SwitchLBRule), 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 *FakeSwitchLBRules) UpdateStatus(ctx context.Context, switchLBRule *kubeovnv1.SwitchLBRule, opts v1.UpdateOptions) (*kubeovnv1.SwitchLBRule, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(switchlbrulesResource, "status", switchLBRule), &kubeovnv1.SwitchLBRule{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.SwitchLBRule), err +} + +// Delete takes name of the switchLBRule and deletes it. Returns an error if one occurs. +func (c *FakeSwitchLBRules) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(switchlbrulesResource, name, opts), &kubeovnv1.SwitchLBRule{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeSwitchLBRules) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(switchlbrulesResource, listOpts) + + _, err := c.Fake.Invokes(action, &kubeovnv1.SwitchLBRuleList{}) + return err +} + +// Patch applies the patch and returns the patched switchLBRule. +func (c *FakeSwitchLBRules) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *kubeovnv1.SwitchLBRule, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(switchlbrulesResource, name, pt, data, subresources...), &kubeovnv1.SwitchLBRule{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.SwitchLBRule), err +} diff --git a/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_vip.go b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_vip.go new file mode 100644 index 00000000000..3329206a3ec --- /dev/null +++ b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_vip.go @@ -0,0 +1,133 @@ +/* +Copyright 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" + + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + 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" +) + +// FakeVips implements VipInterface +type FakeVips struct { + Fake *FakeKubeovnV1 +} + +var vipsResource = schema.GroupVersionResource{Group: "kubeovn.io", Version: "v1", Resource: "vips"} + +var vipsKind = schema.GroupVersionKind{Group: "kubeovn.io", Version: "v1", Kind: "Vip"} + +// Get takes name of the vip, and returns the corresponding vip object, and an error if there is any. +func (c *FakeVips) Get(ctx context.Context, name string, options v1.GetOptions) (result *kubeovnv1.Vip, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(vipsResource, name), &kubeovnv1.Vip{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.Vip), err +} + +// List takes label and field selectors, and returns the list of Vips that match those selectors. +func (c *FakeVips) List(ctx context.Context, opts v1.ListOptions) (result *kubeovnv1.VipList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(vipsResource, vipsKind, opts), &kubeovnv1.VipList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &kubeovnv1.VipList{ListMeta: obj.(*kubeovnv1.VipList).ListMeta} + for _, item := range obj.(*kubeovnv1.VipList).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 vips. +func (c *FakeVips) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(vipsResource, opts)) +} + +// Create takes the representation of a vip and creates it. Returns the server's representation of the vip, and an error, if there is any. +func (c *FakeVips) Create(ctx context.Context, vip *kubeovnv1.Vip, opts v1.CreateOptions) (result *kubeovnv1.Vip, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(vipsResource, vip), &kubeovnv1.Vip{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.Vip), err +} + +// Update takes the representation of a vip and updates it. Returns the server's representation of the vip, and an error, if there is any. +func (c *FakeVips) Update(ctx context.Context, vip *kubeovnv1.Vip, opts v1.UpdateOptions) (result *kubeovnv1.Vip, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(vipsResource, vip), &kubeovnv1.Vip{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.Vip), 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 *FakeVips) UpdateStatus(ctx context.Context, vip *kubeovnv1.Vip, opts v1.UpdateOptions) (*kubeovnv1.Vip, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(vipsResource, "status", vip), &kubeovnv1.Vip{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.Vip), err +} + +// Delete takes name of the vip and deletes it. Returns an error if one occurs. +func (c *FakeVips) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(vipsResource, name, opts), &kubeovnv1.Vip{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeVips) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(vipsResource, listOpts) + + _, err := c.Fake.Invokes(action, &kubeovnv1.VipList{}) + return err +} + +// Patch applies the patch and returns the patched vip. +func (c *FakeVips) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *kubeovnv1.Vip, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(vipsResource, name, pt, data, subresources...), &kubeovnv1.Vip{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.Vip), err +} diff --git a/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_vlan.go b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_vlan.go new file mode 100644 index 00000000000..3b4b9749c2c --- /dev/null +++ b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_vlan.go @@ -0,0 +1,133 @@ +/* +Copyright 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" + + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + 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" +) + +// FakeVlans implements VlanInterface +type FakeVlans struct { + Fake *FakeKubeovnV1 +} + +var vlansResource = schema.GroupVersionResource{Group: "kubeovn.io", Version: "v1", Resource: "vlans"} + +var vlansKind = schema.GroupVersionKind{Group: "kubeovn.io", Version: "v1", Kind: "Vlan"} + +// Get takes name of the vlan, and returns the corresponding vlan object, and an error if there is any. +func (c *FakeVlans) Get(ctx context.Context, name string, options v1.GetOptions) (result *kubeovnv1.Vlan, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(vlansResource, name), &kubeovnv1.Vlan{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.Vlan), err +} + +// List takes label and field selectors, and returns the list of Vlans that match those selectors. +func (c *FakeVlans) List(ctx context.Context, opts v1.ListOptions) (result *kubeovnv1.VlanList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(vlansResource, vlansKind, opts), &kubeovnv1.VlanList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &kubeovnv1.VlanList{ListMeta: obj.(*kubeovnv1.VlanList).ListMeta} + for _, item := range obj.(*kubeovnv1.VlanList).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 vlans. +func (c *FakeVlans) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(vlansResource, opts)) +} + +// Create takes the representation of a vlan and creates it. Returns the server's representation of the vlan, and an error, if there is any. +func (c *FakeVlans) Create(ctx context.Context, vlan *kubeovnv1.Vlan, opts v1.CreateOptions) (result *kubeovnv1.Vlan, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(vlansResource, vlan), &kubeovnv1.Vlan{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.Vlan), err +} + +// Update takes the representation of a vlan and updates it. Returns the server's representation of the vlan, and an error, if there is any. +func (c *FakeVlans) Update(ctx context.Context, vlan *kubeovnv1.Vlan, opts v1.UpdateOptions) (result *kubeovnv1.Vlan, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(vlansResource, vlan), &kubeovnv1.Vlan{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.Vlan), 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 *FakeVlans) UpdateStatus(ctx context.Context, vlan *kubeovnv1.Vlan, opts v1.UpdateOptions) (*kubeovnv1.Vlan, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(vlansResource, "status", vlan), &kubeovnv1.Vlan{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.Vlan), err +} + +// Delete takes name of the vlan and deletes it. Returns an error if one occurs. +func (c *FakeVlans) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(vlansResource, name, opts), &kubeovnv1.Vlan{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeVlans) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(vlansResource, listOpts) + + _, err := c.Fake.Invokes(action, &kubeovnv1.VlanList{}) + return err +} + +// Patch applies the patch and returns the patched vlan. +func (c *FakeVlans) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *kubeovnv1.Vlan, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(vlansResource, name, pt, data, subresources...), &kubeovnv1.Vlan{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.Vlan), err +} diff --git a/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_vpc.go b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_vpc.go new file mode 100644 index 00000000000..5bfc6a70f7c --- /dev/null +++ b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_vpc.go @@ -0,0 +1,133 @@ +/* +Copyright 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" + + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + 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" +) + +// FakeVpcs implements VpcInterface +type FakeVpcs struct { + Fake *FakeKubeovnV1 +} + +var vpcsResource = schema.GroupVersionResource{Group: "kubeovn.io", Version: "v1", Resource: "vpcs"} + +var vpcsKind = schema.GroupVersionKind{Group: "kubeovn.io", Version: "v1", Kind: "Vpc"} + +// Get takes name of the vpc, and returns the corresponding vpc object, and an error if there is any. +func (c *FakeVpcs) Get(ctx context.Context, name string, options v1.GetOptions) (result *kubeovnv1.Vpc, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(vpcsResource, name), &kubeovnv1.Vpc{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.Vpc), err +} + +// List takes label and field selectors, and returns the list of Vpcs that match those selectors. +func (c *FakeVpcs) List(ctx context.Context, opts v1.ListOptions) (result *kubeovnv1.VpcList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(vpcsResource, vpcsKind, opts), &kubeovnv1.VpcList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &kubeovnv1.VpcList{ListMeta: obj.(*kubeovnv1.VpcList).ListMeta} + for _, item := range obj.(*kubeovnv1.VpcList).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 vpcs. +func (c *FakeVpcs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(vpcsResource, opts)) +} + +// Create takes the representation of a vpc and creates it. Returns the server's representation of the vpc, and an error, if there is any. +func (c *FakeVpcs) Create(ctx context.Context, vpc *kubeovnv1.Vpc, opts v1.CreateOptions) (result *kubeovnv1.Vpc, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(vpcsResource, vpc), &kubeovnv1.Vpc{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.Vpc), err +} + +// Update takes the representation of a vpc and updates it. Returns the server's representation of the vpc, and an error, if there is any. +func (c *FakeVpcs) Update(ctx context.Context, vpc *kubeovnv1.Vpc, opts v1.UpdateOptions) (result *kubeovnv1.Vpc, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(vpcsResource, vpc), &kubeovnv1.Vpc{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.Vpc), 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 *FakeVpcs) UpdateStatus(ctx context.Context, vpc *kubeovnv1.Vpc, opts v1.UpdateOptions) (*kubeovnv1.Vpc, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(vpcsResource, "status", vpc), &kubeovnv1.Vpc{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.Vpc), err +} + +// Delete takes name of the vpc and deletes it. Returns an error if one occurs. +func (c *FakeVpcs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(vpcsResource, name, opts), &kubeovnv1.Vpc{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeVpcs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(vpcsResource, listOpts) + + _, err := c.Fake.Invokes(action, &kubeovnv1.VpcList{}) + return err +} + +// Patch applies the patch and returns the patched vpc. +func (c *FakeVpcs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *kubeovnv1.Vpc, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(vpcsResource, name, pt, data, subresources...), &kubeovnv1.Vpc{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.Vpc), err +} diff --git a/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_vpcdns.go b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_vpcdns.go new file mode 100644 index 00000000000..69127f7e2c4 --- /dev/null +++ b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_vpcdns.go @@ -0,0 +1,133 @@ +/* +Copyright 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" + + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + 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" +) + +// FakeVpcDnses implements VpcDnsInterface +type FakeVpcDnses struct { + Fake *FakeKubeovnV1 +} + +var vpcdnsesResource = schema.GroupVersionResource{Group: "kubeovn.io", Version: "v1", Resource: "vpc-dnses"} + +var vpcdnsesKind = schema.GroupVersionKind{Group: "kubeovn.io", Version: "v1", Kind: "VpcDns"} + +// Get takes name of the vpcDns, and returns the corresponding vpcDns object, and an error if there is any. +func (c *FakeVpcDnses) Get(ctx context.Context, name string, options v1.GetOptions) (result *kubeovnv1.VpcDns, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(vpcdnsesResource, name), &kubeovnv1.VpcDns{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.VpcDns), err +} + +// List takes label and field selectors, and returns the list of VpcDnses that match those selectors. +func (c *FakeVpcDnses) List(ctx context.Context, opts v1.ListOptions) (result *kubeovnv1.VpcDnsList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(vpcdnsesResource, vpcdnsesKind, opts), &kubeovnv1.VpcDnsList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &kubeovnv1.VpcDnsList{ListMeta: obj.(*kubeovnv1.VpcDnsList).ListMeta} + for _, item := range obj.(*kubeovnv1.VpcDnsList).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 vpcDnses. +func (c *FakeVpcDnses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(vpcdnsesResource, opts)) +} + +// Create takes the representation of a vpcDns and creates it. Returns the server's representation of the vpcDns, and an error, if there is any. +func (c *FakeVpcDnses) Create(ctx context.Context, vpcDns *kubeovnv1.VpcDns, opts v1.CreateOptions) (result *kubeovnv1.VpcDns, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(vpcdnsesResource, vpcDns), &kubeovnv1.VpcDns{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.VpcDns), err +} + +// Update takes the representation of a vpcDns and updates it. Returns the server's representation of the vpcDns, and an error, if there is any. +func (c *FakeVpcDnses) Update(ctx context.Context, vpcDns *kubeovnv1.VpcDns, opts v1.UpdateOptions) (result *kubeovnv1.VpcDns, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(vpcdnsesResource, vpcDns), &kubeovnv1.VpcDns{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.VpcDns), 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 *FakeVpcDnses) UpdateStatus(ctx context.Context, vpcDns *kubeovnv1.VpcDns, opts v1.UpdateOptions) (*kubeovnv1.VpcDns, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(vpcdnsesResource, "status", vpcDns), &kubeovnv1.VpcDns{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.VpcDns), err +} + +// Delete takes name of the vpcDns and deletes it. Returns an error if one occurs. +func (c *FakeVpcDnses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(vpcdnsesResource, name, opts), &kubeovnv1.VpcDns{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeVpcDnses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(vpcdnsesResource, listOpts) + + _, err := c.Fake.Invokes(action, &kubeovnv1.VpcDnsList{}) + return err +} + +// Patch applies the patch and returns the patched vpcDns. +func (c *FakeVpcDnses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *kubeovnv1.VpcDns, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(vpcdnsesResource, name, pt, data, subresources...), &kubeovnv1.VpcDns{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.VpcDns), err +} diff --git a/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_vpcnatgateway.go b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_vpcnatgateway.go new file mode 100644 index 00000000000..2125b85d99e --- /dev/null +++ b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/fake/fake_vpcnatgateway.go @@ -0,0 +1,122 @@ +/* +Copyright 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" + + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + 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" +) + +// FakeVpcNatGateways implements VpcNatGatewayInterface +type FakeVpcNatGateways struct { + Fake *FakeKubeovnV1 +} + +var vpcnatgatewaysResource = schema.GroupVersionResource{Group: "kubeovn.io", Version: "v1", Resource: "vpc-nat-gateways"} + +var vpcnatgatewaysKind = schema.GroupVersionKind{Group: "kubeovn.io", Version: "v1", Kind: "VpcNatGateway"} + +// Get takes name of the vpcNatGateway, and returns the corresponding vpcNatGateway object, and an error if there is any. +func (c *FakeVpcNatGateways) Get(ctx context.Context, name string, options v1.GetOptions) (result *kubeovnv1.VpcNatGateway, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(vpcnatgatewaysResource, name), &kubeovnv1.VpcNatGateway{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.VpcNatGateway), err +} + +// List takes label and field selectors, and returns the list of VpcNatGateways that match those selectors. +func (c *FakeVpcNatGateways) List(ctx context.Context, opts v1.ListOptions) (result *kubeovnv1.VpcNatGatewayList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(vpcnatgatewaysResource, vpcnatgatewaysKind, opts), &kubeovnv1.VpcNatGatewayList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &kubeovnv1.VpcNatGatewayList{ListMeta: obj.(*kubeovnv1.VpcNatGatewayList).ListMeta} + for _, item := range obj.(*kubeovnv1.VpcNatGatewayList).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 vpcNatGateways. +func (c *FakeVpcNatGateways) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(vpcnatgatewaysResource, opts)) +} + +// Create takes the representation of a vpcNatGateway and creates it. Returns the server's representation of the vpcNatGateway, and an error, if there is any. +func (c *FakeVpcNatGateways) Create(ctx context.Context, vpcNatGateway *kubeovnv1.VpcNatGateway, opts v1.CreateOptions) (result *kubeovnv1.VpcNatGateway, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(vpcnatgatewaysResource, vpcNatGateway), &kubeovnv1.VpcNatGateway{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.VpcNatGateway), err +} + +// Update takes the representation of a vpcNatGateway and updates it. Returns the server's representation of the vpcNatGateway, and an error, if there is any. +func (c *FakeVpcNatGateways) Update(ctx context.Context, vpcNatGateway *kubeovnv1.VpcNatGateway, opts v1.UpdateOptions) (result *kubeovnv1.VpcNatGateway, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(vpcnatgatewaysResource, vpcNatGateway), &kubeovnv1.VpcNatGateway{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.VpcNatGateway), err +} + +// Delete takes name of the vpcNatGateway and deletes it. Returns an error if one occurs. +func (c *FakeVpcNatGateways) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(vpcnatgatewaysResource, name, opts), &kubeovnv1.VpcNatGateway{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeVpcNatGateways) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(vpcnatgatewaysResource, listOpts) + + _, err := c.Fake.Invokes(action, &kubeovnv1.VpcNatGatewayList{}) + return err +} + +// Patch applies the patch and returns the patched vpcNatGateway. +func (c *FakeVpcNatGateways) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *kubeovnv1.VpcNatGateway, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(vpcnatgatewaysResource, name, pt, data, subresources...), &kubeovnv1.VpcNatGateway{}) + if obj == nil { + return nil, err + } + return obj.(*kubeovnv1.VpcNatGateway), err +} diff --git a/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/generated_expansion.go b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/generated_expansion.go new file mode 100644 index 00000000000..2aab46affd0 --- /dev/null +++ b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/generated_expansion.go @@ -0,0 +1,55 @@ +/* +Copyright 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 v1 + +type HtbQosExpansion interface{} + +type IPExpansion interface{} + +type IptablesDnatRuleExpansion interface{} + +type IptablesEIPExpansion interface{} + +type IptablesFIPRuleExpansion interface{} + +type IptablesSnatRuleExpansion interface{} + +type OvnEipExpansion interface{} + +type OvnFipExpansion interface{} + +type OvnSnatRuleExpansion interface{} + +type ProviderNetworkExpansion interface{} + +type SecurityGroupExpansion interface{} + +type SubnetExpansion interface{} + +type SwitchLBRuleExpansion interface{} + +type VipExpansion interface{} + +type VlanExpansion interface{} + +type VpcExpansion interface{} + +type VpcDnsExpansion interface{} + +type VpcNatGatewayExpansion interface{} diff --git a/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/htbqos.go b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/htbqos.go new file mode 100644 index 00000000000..bd7077c4743 --- /dev/null +++ b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/htbqos.go @@ -0,0 +1,168 @@ +/* +Copyright 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 v1 + +import ( + "context" + "time" + + v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + scheme "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// HtbQosesGetter has a method to return a HtbQosInterface. +// A group's client should implement this interface. +type HtbQosesGetter interface { + HtbQoses() HtbQosInterface +} + +// HtbQosInterface has methods to work with HtbQos resources. +type HtbQosInterface interface { + Create(ctx context.Context, htbQos *v1.HtbQos, opts metav1.CreateOptions) (*v1.HtbQos, error) + Update(ctx context.Context, htbQos *v1.HtbQos, opts metav1.UpdateOptions) (*v1.HtbQos, 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.HtbQos, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.HtbQosList, 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.HtbQos, err error) + HtbQosExpansion +} + +// htbQoses implements HtbQosInterface +type htbQoses struct { + client rest.Interface +} + +// newHtbQoses returns a HtbQoses +func newHtbQoses(c *KubeovnV1Client) *htbQoses { + return &htbQoses{ + client: c.RESTClient(), + } +} + +// Get takes name of the htbQos, and returns the corresponding htbQos object, and an error if there is any. +func (c *htbQoses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.HtbQos, err error) { + result = &v1.HtbQos{} + err = c.client.Get(). + Resource("htbqoses"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of HtbQoses that match those selectors. +func (c *htbQoses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.HtbQosList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.HtbQosList{} + err = c.client.Get(). + Resource("htbqoses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested htbQoses. +func (c *htbQoses) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Resource("htbqoses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a htbQos and creates it. Returns the server's representation of the htbQos, and an error, if there is any. +func (c *htbQoses) Create(ctx context.Context, htbQos *v1.HtbQos, opts metav1.CreateOptions) (result *v1.HtbQos, err error) { + result = &v1.HtbQos{} + err = c.client.Post(). + Resource("htbqoses"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(htbQos). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a htbQos and updates it. Returns the server's representation of the htbQos, and an error, if there is any. +func (c *htbQoses) Update(ctx context.Context, htbQos *v1.HtbQos, opts metav1.UpdateOptions) (result *v1.HtbQos, err error) { + result = &v1.HtbQos{} + err = c.client.Put(). + Resource("htbqoses"). + Name(htbQos.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(htbQos). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the htbQos and deletes it. Returns an error if one occurs. +func (c *htbQoses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("htbqoses"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *htbQoses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("htbqoses"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched htbQos. +func (c *htbQoses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.HtbQos, err error) { + result = &v1.HtbQos{} + err = c.client.Patch(pt). + Resource("htbqoses"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/ip.go b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/ip.go new file mode 100644 index 00000000000..53015e82f54 --- /dev/null +++ b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/ip.go @@ -0,0 +1,168 @@ +/* +Copyright 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 v1 + +import ( + "context" + "time" + + v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + scheme "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// IPsGetter has a method to return a IPInterface. +// A group's client should implement this interface. +type IPsGetter interface { + IPs() IPInterface +} + +// IPInterface has methods to work with IP resources. +type IPInterface interface { + Create(ctx context.Context, iP *v1.IP, opts metav1.CreateOptions) (*v1.IP, error) + Update(ctx context.Context, iP *v1.IP, opts metav1.UpdateOptions) (*v1.IP, 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.IP, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.IPList, 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.IP, err error) + IPExpansion +} + +// iPs implements IPInterface +type iPs struct { + client rest.Interface +} + +// newIPs returns a IPs +func newIPs(c *KubeovnV1Client) *iPs { + return &iPs{ + client: c.RESTClient(), + } +} + +// Get takes name of the iP, and returns the corresponding iP object, and an error if there is any. +func (c *iPs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.IP, err error) { + result = &v1.IP{} + err = c.client.Get(). + Resource("ips"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of IPs that match those selectors. +func (c *iPs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.IPList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.IPList{} + err = c.client.Get(). + Resource("ips"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested iPs. +func (c *iPs) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Resource("ips"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a iP and creates it. Returns the server's representation of the iP, and an error, if there is any. +func (c *iPs) Create(ctx context.Context, iP *v1.IP, opts metav1.CreateOptions) (result *v1.IP, err error) { + result = &v1.IP{} + err = c.client.Post(). + Resource("ips"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(iP). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a iP and updates it. Returns the server's representation of the iP, and an error, if there is any. +func (c *iPs) Update(ctx context.Context, iP *v1.IP, opts metav1.UpdateOptions) (result *v1.IP, err error) { + result = &v1.IP{} + err = c.client.Put(). + Resource("ips"). + Name(iP.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(iP). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the iP and deletes it. Returns an error if one occurs. +func (c *iPs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("ips"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *iPs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("ips"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched iP. +func (c *iPs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.IP, err error) { + result = &v1.IP{} + err = c.client.Patch(pt). + Resource("ips"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/iptablesdnatrule.go b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/iptablesdnatrule.go new file mode 100644 index 00000000000..b2088e59d5e --- /dev/null +++ b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/iptablesdnatrule.go @@ -0,0 +1,184 @@ +/* +Copyright 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 v1 + +import ( + "context" + "time" + + v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + scheme "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// IptablesDnatRulesGetter has a method to return a IptablesDnatRuleInterface. +// A group's client should implement this interface. +type IptablesDnatRulesGetter interface { + IptablesDnatRules() IptablesDnatRuleInterface +} + +// IptablesDnatRuleInterface has methods to work with IptablesDnatRule resources. +type IptablesDnatRuleInterface interface { + Create(ctx context.Context, iptablesDnatRule *v1.IptablesDnatRule, opts metav1.CreateOptions) (*v1.IptablesDnatRule, error) + Update(ctx context.Context, iptablesDnatRule *v1.IptablesDnatRule, opts metav1.UpdateOptions) (*v1.IptablesDnatRule, error) + UpdateStatus(ctx context.Context, iptablesDnatRule *v1.IptablesDnatRule, opts metav1.UpdateOptions) (*v1.IptablesDnatRule, 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.IptablesDnatRule, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.IptablesDnatRuleList, 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.IptablesDnatRule, err error) + IptablesDnatRuleExpansion +} + +// iptablesDnatRules implements IptablesDnatRuleInterface +type iptablesDnatRules struct { + client rest.Interface +} + +// newIptablesDnatRules returns a IptablesDnatRules +func newIptablesDnatRules(c *KubeovnV1Client) *iptablesDnatRules { + return &iptablesDnatRules{ + client: c.RESTClient(), + } +} + +// Get takes name of the iptablesDnatRule, and returns the corresponding iptablesDnatRule object, and an error if there is any. +func (c *iptablesDnatRules) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.IptablesDnatRule, err error) { + result = &v1.IptablesDnatRule{} + err = c.client.Get(). + Resource("iptables-dnat-rules"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of IptablesDnatRules that match those selectors. +func (c *iptablesDnatRules) List(ctx context.Context, opts metav1.ListOptions) (result *v1.IptablesDnatRuleList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.IptablesDnatRuleList{} + err = c.client.Get(). + Resource("iptables-dnat-rules"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested iptablesDnatRules. +func (c *iptablesDnatRules) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Resource("iptables-dnat-rules"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a iptablesDnatRule and creates it. Returns the server's representation of the iptablesDnatRule, and an error, if there is any. +func (c *iptablesDnatRules) Create(ctx context.Context, iptablesDnatRule *v1.IptablesDnatRule, opts metav1.CreateOptions) (result *v1.IptablesDnatRule, err error) { + result = &v1.IptablesDnatRule{} + err = c.client.Post(). + Resource("iptables-dnat-rules"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(iptablesDnatRule). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a iptablesDnatRule and updates it. Returns the server's representation of the iptablesDnatRule, and an error, if there is any. +func (c *iptablesDnatRules) Update(ctx context.Context, iptablesDnatRule *v1.IptablesDnatRule, opts metav1.UpdateOptions) (result *v1.IptablesDnatRule, err error) { + result = &v1.IptablesDnatRule{} + err = c.client.Put(). + Resource("iptables-dnat-rules"). + Name(iptablesDnatRule.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(iptablesDnatRule). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *iptablesDnatRules) UpdateStatus(ctx context.Context, iptablesDnatRule *v1.IptablesDnatRule, opts metav1.UpdateOptions) (result *v1.IptablesDnatRule, err error) { + result = &v1.IptablesDnatRule{} + err = c.client.Put(). + Resource("iptables-dnat-rules"). + Name(iptablesDnatRule.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(iptablesDnatRule). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the iptablesDnatRule and deletes it. Returns an error if one occurs. +func (c *iptablesDnatRules) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("iptables-dnat-rules"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *iptablesDnatRules) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("iptables-dnat-rules"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched iptablesDnatRule. +func (c *iptablesDnatRules) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.IptablesDnatRule, err error) { + result = &v1.IptablesDnatRule{} + err = c.client.Patch(pt). + Resource("iptables-dnat-rules"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/iptableseip.go b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/iptableseip.go new file mode 100644 index 00000000000..607ad8e9928 --- /dev/null +++ b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/iptableseip.go @@ -0,0 +1,184 @@ +/* +Copyright 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 v1 + +import ( + "context" + "time" + + v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + scheme "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// IptablesEIPsGetter has a method to return a IptablesEIPInterface. +// A group's client should implement this interface. +type IptablesEIPsGetter interface { + IptablesEIPs() IptablesEIPInterface +} + +// IptablesEIPInterface has methods to work with IptablesEIP resources. +type IptablesEIPInterface interface { + Create(ctx context.Context, iptablesEIP *v1.IptablesEIP, opts metav1.CreateOptions) (*v1.IptablesEIP, error) + Update(ctx context.Context, iptablesEIP *v1.IptablesEIP, opts metav1.UpdateOptions) (*v1.IptablesEIP, error) + UpdateStatus(ctx context.Context, iptablesEIP *v1.IptablesEIP, opts metav1.UpdateOptions) (*v1.IptablesEIP, 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.IptablesEIP, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.IptablesEIPList, 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.IptablesEIP, err error) + IptablesEIPExpansion +} + +// iptablesEIPs implements IptablesEIPInterface +type iptablesEIPs struct { + client rest.Interface +} + +// newIptablesEIPs returns a IptablesEIPs +func newIptablesEIPs(c *KubeovnV1Client) *iptablesEIPs { + return &iptablesEIPs{ + client: c.RESTClient(), + } +} + +// Get takes name of the iptablesEIP, and returns the corresponding iptablesEIP object, and an error if there is any. +func (c *iptablesEIPs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.IptablesEIP, err error) { + result = &v1.IptablesEIP{} + err = c.client.Get(). + Resource("iptables-eips"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of IptablesEIPs that match those selectors. +func (c *iptablesEIPs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.IptablesEIPList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.IptablesEIPList{} + err = c.client.Get(). + Resource("iptables-eips"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested iptablesEIPs. +func (c *iptablesEIPs) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Resource("iptables-eips"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a iptablesEIP and creates it. Returns the server's representation of the iptablesEIP, and an error, if there is any. +func (c *iptablesEIPs) Create(ctx context.Context, iptablesEIP *v1.IptablesEIP, opts metav1.CreateOptions) (result *v1.IptablesEIP, err error) { + result = &v1.IptablesEIP{} + err = c.client.Post(). + Resource("iptables-eips"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(iptablesEIP). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a iptablesEIP and updates it. Returns the server's representation of the iptablesEIP, and an error, if there is any. +func (c *iptablesEIPs) Update(ctx context.Context, iptablesEIP *v1.IptablesEIP, opts metav1.UpdateOptions) (result *v1.IptablesEIP, err error) { + result = &v1.IptablesEIP{} + err = c.client.Put(). + Resource("iptables-eips"). + Name(iptablesEIP.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(iptablesEIP). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *iptablesEIPs) UpdateStatus(ctx context.Context, iptablesEIP *v1.IptablesEIP, opts metav1.UpdateOptions) (result *v1.IptablesEIP, err error) { + result = &v1.IptablesEIP{} + err = c.client.Put(). + Resource("iptables-eips"). + Name(iptablesEIP.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(iptablesEIP). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the iptablesEIP and deletes it. Returns an error if one occurs. +func (c *iptablesEIPs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("iptables-eips"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *iptablesEIPs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("iptables-eips"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched iptablesEIP. +func (c *iptablesEIPs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.IptablesEIP, err error) { + result = &v1.IptablesEIP{} + err = c.client.Patch(pt). + Resource("iptables-eips"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/iptablesfiprule.go b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/iptablesfiprule.go new file mode 100644 index 00000000000..2cc7fef6cd4 --- /dev/null +++ b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/iptablesfiprule.go @@ -0,0 +1,184 @@ +/* +Copyright 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 v1 + +import ( + "context" + "time" + + v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + scheme "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// IptablesFIPRulesGetter has a method to return a IptablesFIPRuleInterface. +// A group's client should implement this interface. +type IptablesFIPRulesGetter interface { + IptablesFIPRules() IptablesFIPRuleInterface +} + +// IptablesFIPRuleInterface has methods to work with IptablesFIPRule resources. +type IptablesFIPRuleInterface interface { + Create(ctx context.Context, iptablesFIPRule *v1.IptablesFIPRule, opts metav1.CreateOptions) (*v1.IptablesFIPRule, error) + Update(ctx context.Context, iptablesFIPRule *v1.IptablesFIPRule, opts metav1.UpdateOptions) (*v1.IptablesFIPRule, error) + UpdateStatus(ctx context.Context, iptablesFIPRule *v1.IptablesFIPRule, opts metav1.UpdateOptions) (*v1.IptablesFIPRule, 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.IptablesFIPRule, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.IptablesFIPRuleList, 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.IptablesFIPRule, err error) + IptablesFIPRuleExpansion +} + +// iptablesFIPRules implements IptablesFIPRuleInterface +type iptablesFIPRules struct { + client rest.Interface +} + +// newIptablesFIPRules returns a IptablesFIPRules +func newIptablesFIPRules(c *KubeovnV1Client) *iptablesFIPRules { + return &iptablesFIPRules{ + client: c.RESTClient(), + } +} + +// Get takes name of the iptablesFIPRule, and returns the corresponding iptablesFIPRule object, and an error if there is any. +func (c *iptablesFIPRules) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.IptablesFIPRule, err error) { + result = &v1.IptablesFIPRule{} + err = c.client.Get(). + Resource("iptables-fip-rules"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of IptablesFIPRules that match those selectors. +func (c *iptablesFIPRules) List(ctx context.Context, opts metav1.ListOptions) (result *v1.IptablesFIPRuleList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.IptablesFIPRuleList{} + err = c.client.Get(). + Resource("iptables-fip-rules"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested iptablesFIPRules. +func (c *iptablesFIPRules) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Resource("iptables-fip-rules"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a iptablesFIPRule and creates it. Returns the server's representation of the iptablesFIPRule, and an error, if there is any. +func (c *iptablesFIPRules) Create(ctx context.Context, iptablesFIPRule *v1.IptablesFIPRule, opts metav1.CreateOptions) (result *v1.IptablesFIPRule, err error) { + result = &v1.IptablesFIPRule{} + err = c.client.Post(). + Resource("iptables-fip-rules"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(iptablesFIPRule). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a iptablesFIPRule and updates it. Returns the server's representation of the iptablesFIPRule, and an error, if there is any. +func (c *iptablesFIPRules) Update(ctx context.Context, iptablesFIPRule *v1.IptablesFIPRule, opts metav1.UpdateOptions) (result *v1.IptablesFIPRule, err error) { + result = &v1.IptablesFIPRule{} + err = c.client.Put(). + Resource("iptables-fip-rules"). + Name(iptablesFIPRule.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(iptablesFIPRule). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *iptablesFIPRules) UpdateStatus(ctx context.Context, iptablesFIPRule *v1.IptablesFIPRule, opts metav1.UpdateOptions) (result *v1.IptablesFIPRule, err error) { + result = &v1.IptablesFIPRule{} + err = c.client.Put(). + Resource("iptables-fip-rules"). + Name(iptablesFIPRule.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(iptablesFIPRule). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the iptablesFIPRule and deletes it. Returns an error if one occurs. +func (c *iptablesFIPRules) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("iptables-fip-rules"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *iptablesFIPRules) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("iptables-fip-rules"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched iptablesFIPRule. +func (c *iptablesFIPRules) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.IptablesFIPRule, err error) { + result = &v1.IptablesFIPRule{} + err = c.client.Patch(pt). + Resource("iptables-fip-rules"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/iptablessnatrule.go b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/iptablessnatrule.go new file mode 100644 index 00000000000..576d1fbb92c --- /dev/null +++ b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/iptablessnatrule.go @@ -0,0 +1,184 @@ +/* +Copyright 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 v1 + +import ( + "context" + "time" + + v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + scheme "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// IptablesSnatRulesGetter has a method to return a IptablesSnatRuleInterface. +// A group's client should implement this interface. +type IptablesSnatRulesGetter interface { + IptablesSnatRules() IptablesSnatRuleInterface +} + +// IptablesSnatRuleInterface has methods to work with IptablesSnatRule resources. +type IptablesSnatRuleInterface interface { + Create(ctx context.Context, iptablesSnatRule *v1.IptablesSnatRule, opts metav1.CreateOptions) (*v1.IptablesSnatRule, error) + Update(ctx context.Context, iptablesSnatRule *v1.IptablesSnatRule, opts metav1.UpdateOptions) (*v1.IptablesSnatRule, error) + UpdateStatus(ctx context.Context, iptablesSnatRule *v1.IptablesSnatRule, opts metav1.UpdateOptions) (*v1.IptablesSnatRule, 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.IptablesSnatRule, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.IptablesSnatRuleList, 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.IptablesSnatRule, err error) + IptablesSnatRuleExpansion +} + +// iptablesSnatRules implements IptablesSnatRuleInterface +type iptablesSnatRules struct { + client rest.Interface +} + +// newIptablesSnatRules returns a IptablesSnatRules +func newIptablesSnatRules(c *KubeovnV1Client) *iptablesSnatRules { + return &iptablesSnatRules{ + client: c.RESTClient(), + } +} + +// Get takes name of the iptablesSnatRule, and returns the corresponding iptablesSnatRule object, and an error if there is any. +func (c *iptablesSnatRules) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.IptablesSnatRule, err error) { + result = &v1.IptablesSnatRule{} + err = c.client.Get(). + Resource("iptables-snat-rules"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of IptablesSnatRules that match those selectors. +func (c *iptablesSnatRules) List(ctx context.Context, opts metav1.ListOptions) (result *v1.IptablesSnatRuleList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.IptablesSnatRuleList{} + err = c.client.Get(). + Resource("iptables-snat-rules"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested iptablesSnatRules. +func (c *iptablesSnatRules) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Resource("iptables-snat-rules"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a iptablesSnatRule and creates it. Returns the server's representation of the iptablesSnatRule, and an error, if there is any. +func (c *iptablesSnatRules) Create(ctx context.Context, iptablesSnatRule *v1.IptablesSnatRule, opts metav1.CreateOptions) (result *v1.IptablesSnatRule, err error) { + result = &v1.IptablesSnatRule{} + err = c.client.Post(). + Resource("iptables-snat-rules"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(iptablesSnatRule). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a iptablesSnatRule and updates it. Returns the server's representation of the iptablesSnatRule, and an error, if there is any. +func (c *iptablesSnatRules) Update(ctx context.Context, iptablesSnatRule *v1.IptablesSnatRule, opts metav1.UpdateOptions) (result *v1.IptablesSnatRule, err error) { + result = &v1.IptablesSnatRule{} + err = c.client.Put(). + Resource("iptables-snat-rules"). + Name(iptablesSnatRule.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(iptablesSnatRule). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *iptablesSnatRules) UpdateStatus(ctx context.Context, iptablesSnatRule *v1.IptablesSnatRule, opts metav1.UpdateOptions) (result *v1.IptablesSnatRule, err error) { + result = &v1.IptablesSnatRule{} + err = c.client.Put(). + Resource("iptables-snat-rules"). + Name(iptablesSnatRule.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(iptablesSnatRule). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the iptablesSnatRule and deletes it. Returns an error if one occurs. +func (c *iptablesSnatRules) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("iptables-snat-rules"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *iptablesSnatRules) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("iptables-snat-rules"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched iptablesSnatRule. +func (c *iptablesSnatRules) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.IptablesSnatRule, err error) { + result = &v1.IptablesSnatRule{} + err = c.client.Patch(pt). + Resource("iptables-snat-rules"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/kubeovn_client.go b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/kubeovn_client.go new file mode 100644 index 00000000000..86dad154b9e --- /dev/null +++ b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/kubeovn_client.go @@ -0,0 +1,192 @@ +/* +Copyright 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 v1 + +import ( + "net/http" + + v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned/scheme" + rest "k8s.io/client-go/rest" +) + +type KubeovnV1Interface interface { + RESTClient() rest.Interface + HtbQosesGetter + IPsGetter + IptablesDnatRulesGetter + IptablesEIPsGetter + IptablesFIPRulesGetter + IptablesSnatRulesGetter + OvnEipsGetter + OvnFipsGetter + OvnSnatRulesGetter + ProviderNetworksGetter + SecurityGroupsGetter + SubnetsGetter + SwitchLBRulesGetter + VipsGetter + VlansGetter + VpcsGetter + VpcDnsesGetter + VpcNatGatewaysGetter +} + +// KubeovnV1Client is used to interact with features provided by the kubeovn.io group. +type KubeovnV1Client struct { + restClient rest.Interface +} + +func (c *KubeovnV1Client) HtbQoses() HtbQosInterface { + return newHtbQoses(c) +} + +func (c *KubeovnV1Client) IPs() IPInterface { + return newIPs(c) +} + +func (c *KubeovnV1Client) IptablesDnatRules() IptablesDnatRuleInterface { + return newIptablesDnatRules(c) +} + +func (c *KubeovnV1Client) IptablesEIPs() IptablesEIPInterface { + return newIptablesEIPs(c) +} + +func (c *KubeovnV1Client) IptablesFIPRules() IptablesFIPRuleInterface { + return newIptablesFIPRules(c) +} + +func (c *KubeovnV1Client) IptablesSnatRules() IptablesSnatRuleInterface { + return newIptablesSnatRules(c) +} + +func (c *KubeovnV1Client) OvnEips() OvnEipInterface { + return newOvnEips(c) +} + +func (c *KubeovnV1Client) OvnFips() OvnFipInterface { + return newOvnFips(c) +} + +func (c *KubeovnV1Client) OvnSnatRules() OvnSnatRuleInterface { + return newOvnSnatRules(c) +} + +func (c *KubeovnV1Client) ProviderNetworks() ProviderNetworkInterface { + return newProviderNetworks(c) +} + +func (c *KubeovnV1Client) SecurityGroups() SecurityGroupInterface { + return newSecurityGroups(c) +} + +func (c *KubeovnV1Client) Subnets() SubnetInterface { + return newSubnets(c) +} + +func (c *KubeovnV1Client) SwitchLBRules() SwitchLBRuleInterface { + return newSwitchLBRules(c) +} + +func (c *KubeovnV1Client) Vips() VipInterface { + return newVips(c) +} + +func (c *KubeovnV1Client) Vlans() VlanInterface { + return newVlans(c) +} + +func (c *KubeovnV1Client) Vpcs() VpcInterface { + return newVpcs(c) +} + +func (c *KubeovnV1Client) VpcDnses() VpcDnsInterface { + return newVpcDnses(c) +} + +func (c *KubeovnV1Client) VpcNatGateways() VpcNatGatewayInterface { + return newVpcNatGateways(c) +} + +// NewForConfig creates a new KubeovnV1Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*KubeovnV1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + httpClient, err := rest.HTTPClientFor(&config) + if err != nil { + return nil, err + } + return NewForConfigAndClient(&config, httpClient) +} + +// NewForConfigAndClient creates a new KubeovnV1Client for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*KubeovnV1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientForConfigAndClient(&config, h) + if err != nil { + return nil, err + } + return &KubeovnV1Client{client}, nil +} + +// NewForConfigOrDie creates a new KubeovnV1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *KubeovnV1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new KubeovnV1Client for the given RESTClient. +func New(c rest.Interface) *KubeovnV1Client { + return &KubeovnV1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *KubeovnV1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/ovneip.go b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/ovneip.go new file mode 100644 index 00000000000..509d0492cac --- /dev/null +++ b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/ovneip.go @@ -0,0 +1,184 @@ +/* +Copyright 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 v1 + +import ( + "context" + "time" + + v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + scheme "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// OvnEipsGetter has a method to return a OvnEipInterface. +// A group's client should implement this interface. +type OvnEipsGetter interface { + OvnEips() OvnEipInterface +} + +// OvnEipInterface has methods to work with OvnEip resources. +type OvnEipInterface interface { + Create(ctx context.Context, ovnEip *v1.OvnEip, opts metav1.CreateOptions) (*v1.OvnEip, error) + Update(ctx context.Context, ovnEip *v1.OvnEip, opts metav1.UpdateOptions) (*v1.OvnEip, error) + UpdateStatus(ctx context.Context, ovnEip *v1.OvnEip, opts metav1.UpdateOptions) (*v1.OvnEip, 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.OvnEip, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.OvnEipList, 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.OvnEip, err error) + OvnEipExpansion +} + +// ovnEips implements OvnEipInterface +type ovnEips struct { + client rest.Interface +} + +// newOvnEips returns a OvnEips +func newOvnEips(c *KubeovnV1Client) *ovnEips { + return &ovnEips{ + client: c.RESTClient(), + } +} + +// Get takes name of the ovnEip, and returns the corresponding ovnEip object, and an error if there is any. +func (c *ovnEips) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.OvnEip, err error) { + result = &v1.OvnEip{} + err = c.client.Get(). + Resource("ovn-eips"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of OvnEips that match those selectors. +func (c *ovnEips) List(ctx context.Context, opts metav1.ListOptions) (result *v1.OvnEipList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.OvnEipList{} + err = c.client.Get(). + Resource("ovn-eips"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested ovnEips. +func (c *ovnEips) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Resource("ovn-eips"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a ovnEip and creates it. Returns the server's representation of the ovnEip, and an error, if there is any. +func (c *ovnEips) Create(ctx context.Context, ovnEip *v1.OvnEip, opts metav1.CreateOptions) (result *v1.OvnEip, err error) { + result = &v1.OvnEip{} + err = c.client.Post(). + Resource("ovn-eips"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(ovnEip). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a ovnEip and updates it. Returns the server's representation of the ovnEip, and an error, if there is any. +func (c *ovnEips) Update(ctx context.Context, ovnEip *v1.OvnEip, opts metav1.UpdateOptions) (result *v1.OvnEip, err error) { + result = &v1.OvnEip{} + err = c.client.Put(). + Resource("ovn-eips"). + Name(ovnEip.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(ovnEip). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *ovnEips) UpdateStatus(ctx context.Context, ovnEip *v1.OvnEip, opts metav1.UpdateOptions) (result *v1.OvnEip, err error) { + result = &v1.OvnEip{} + err = c.client.Put(). + Resource("ovn-eips"). + Name(ovnEip.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(ovnEip). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the ovnEip and deletes it. Returns an error if one occurs. +func (c *ovnEips) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("ovn-eips"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *ovnEips) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("ovn-eips"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched ovnEip. +func (c *ovnEips) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.OvnEip, err error) { + result = &v1.OvnEip{} + err = c.client.Patch(pt). + Resource("ovn-eips"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/ovnfip.go b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/ovnfip.go new file mode 100644 index 00000000000..0f20cebdfe0 --- /dev/null +++ b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/ovnfip.go @@ -0,0 +1,184 @@ +/* +Copyright 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 v1 + +import ( + "context" + "time" + + v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + scheme "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// OvnFipsGetter has a method to return a OvnFipInterface. +// A group's client should implement this interface. +type OvnFipsGetter interface { + OvnFips() OvnFipInterface +} + +// OvnFipInterface has methods to work with OvnFip resources. +type OvnFipInterface interface { + Create(ctx context.Context, ovnFip *v1.OvnFip, opts metav1.CreateOptions) (*v1.OvnFip, error) + Update(ctx context.Context, ovnFip *v1.OvnFip, opts metav1.UpdateOptions) (*v1.OvnFip, error) + UpdateStatus(ctx context.Context, ovnFip *v1.OvnFip, opts metav1.UpdateOptions) (*v1.OvnFip, 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.OvnFip, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.OvnFipList, 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.OvnFip, err error) + OvnFipExpansion +} + +// ovnFips implements OvnFipInterface +type ovnFips struct { + client rest.Interface +} + +// newOvnFips returns a OvnFips +func newOvnFips(c *KubeovnV1Client) *ovnFips { + return &ovnFips{ + client: c.RESTClient(), + } +} + +// Get takes name of the ovnFip, and returns the corresponding ovnFip object, and an error if there is any. +func (c *ovnFips) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.OvnFip, err error) { + result = &v1.OvnFip{} + err = c.client.Get(). + Resource("ovn-fips"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of OvnFips that match those selectors. +func (c *ovnFips) List(ctx context.Context, opts metav1.ListOptions) (result *v1.OvnFipList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.OvnFipList{} + err = c.client.Get(). + Resource("ovn-fips"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested ovnFips. +func (c *ovnFips) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Resource("ovn-fips"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a ovnFip and creates it. Returns the server's representation of the ovnFip, and an error, if there is any. +func (c *ovnFips) Create(ctx context.Context, ovnFip *v1.OvnFip, opts metav1.CreateOptions) (result *v1.OvnFip, err error) { + result = &v1.OvnFip{} + err = c.client.Post(). + Resource("ovn-fips"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(ovnFip). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a ovnFip and updates it. Returns the server's representation of the ovnFip, and an error, if there is any. +func (c *ovnFips) Update(ctx context.Context, ovnFip *v1.OvnFip, opts metav1.UpdateOptions) (result *v1.OvnFip, err error) { + result = &v1.OvnFip{} + err = c.client.Put(). + Resource("ovn-fips"). + Name(ovnFip.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(ovnFip). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *ovnFips) UpdateStatus(ctx context.Context, ovnFip *v1.OvnFip, opts metav1.UpdateOptions) (result *v1.OvnFip, err error) { + result = &v1.OvnFip{} + err = c.client.Put(). + Resource("ovn-fips"). + Name(ovnFip.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(ovnFip). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the ovnFip and deletes it. Returns an error if one occurs. +func (c *ovnFips) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("ovn-fips"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *ovnFips) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("ovn-fips"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched ovnFip. +func (c *ovnFips) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.OvnFip, err error) { + result = &v1.OvnFip{} + err = c.client.Patch(pt). + Resource("ovn-fips"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/ovnsnatrule.go b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/ovnsnatrule.go new file mode 100644 index 00000000000..93bb2c01b12 --- /dev/null +++ b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/ovnsnatrule.go @@ -0,0 +1,184 @@ +/* +Copyright 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 v1 + +import ( + "context" + "time" + + v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + scheme "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// OvnSnatRulesGetter has a method to return a OvnSnatRuleInterface. +// A group's client should implement this interface. +type OvnSnatRulesGetter interface { + OvnSnatRules() OvnSnatRuleInterface +} + +// OvnSnatRuleInterface has methods to work with OvnSnatRule resources. +type OvnSnatRuleInterface interface { + Create(ctx context.Context, ovnSnatRule *v1.OvnSnatRule, opts metav1.CreateOptions) (*v1.OvnSnatRule, error) + Update(ctx context.Context, ovnSnatRule *v1.OvnSnatRule, opts metav1.UpdateOptions) (*v1.OvnSnatRule, error) + UpdateStatus(ctx context.Context, ovnSnatRule *v1.OvnSnatRule, opts metav1.UpdateOptions) (*v1.OvnSnatRule, 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.OvnSnatRule, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.OvnSnatRuleList, 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.OvnSnatRule, err error) + OvnSnatRuleExpansion +} + +// ovnSnatRules implements OvnSnatRuleInterface +type ovnSnatRules struct { + client rest.Interface +} + +// newOvnSnatRules returns a OvnSnatRules +func newOvnSnatRules(c *KubeovnV1Client) *ovnSnatRules { + return &ovnSnatRules{ + client: c.RESTClient(), + } +} + +// Get takes name of the ovnSnatRule, and returns the corresponding ovnSnatRule object, and an error if there is any. +func (c *ovnSnatRules) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.OvnSnatRule, err error) { + result = &v1.OvnSnatRule{} + err = c.client.Get(). + Resource("ovn-snat-rules"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of OvnSnatRules that match those selectors. +func (c *ovnSnatRules) List(ctx context.Context, opts metav1.ListOptions) (result *v1.OvnSnatRuleList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.OvnSnatRuleList{} + err = c.client.Get(). + Resource("ovn-snat-rules"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested ovnSnatRules. +func (c *ovnSnatRules) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Resource("ovn-snat-rules"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a ovnSnatRule and creates it. Returns the server's representation of the ovnSnatRule, and an error, if there is any. +func (c *ovnSnatRules) Create(ctx context.Context, ovnSnatRule *v1.OvnSnatRule, opts metav1.CreateOptions) (result *v1.OvnSnatRule, err error) { + result = &v1.OvnSnatRule{} + err = c.client.Post(). + Resource("ovn-snat-rules"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(ovnSnatRule). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a ovnSnatRule and updates it. Returns the server's representation of the ovnSnatRule, and an error, if there is any. +func (c *ovnSnatRules) Update(ctx context.Context, ovnSnatRule *v1.OvnSnatRule, opts metav1.UpdateOptions) (result *v1.OvnSnatRule, err error) { + result = &v1.OvnSnatRule{} + err = c.client.Put(). + Resource("ovn-snat-rules"). + Name(ovnSnatRule.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(ovnSnatRule). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *ovnSnatRules) UpdateStatus(ctx context.Context, ovnSnatRule *v1.OvnSnatRule, opts metav1.UpdateOptions) (result *v1.OvnSnatRule, err error) { + result = &v1.OvnSnatRule{} + err = c.client.Put(). + Resource("ovn-snat-rules"). + Name(ovnSnatRule.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(ovnSnatRule). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the ovnSnatRule and deletes it. Returns an error if one occurs. +func (c *ovnSnatRules) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("ovn-snat-rules"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *ovnSnatRules) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("ovn-snat-rules"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched ovnSnatRule. +func (c *ovnSnatRules) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.OvnSnatRule, err error) { + result = &v1.OvnSnatRule{} + err = c.client.Patch(pt). + Resource("ovn-snat-rules"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/providernetwork.go b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/providernetwork.go new file mode 100644 index 00000000000..fcef8da37fa --- /dev/null +++ b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/providernetwork.go @@ -0,0 +1,184 @@ +/* +Copyright 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 v1 + +import ( + "context" + "time" + + v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + scheme "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// ProviderNetworksGetter has a method to return a ProviderNetworkInterface. +// A group's client should implement this interface. +type ProviderNetworksGetter interface { + ProviderNetworks() ProviderNetworkInterface +} + +// ProviderNetworkInterface has methods to work with ProviderNetwork resources. +type ProviderNetworkInterface interface { + Create(ctx context.Context, providerNetwork *v1.ProviderNetwork, opts metav1.CreateOptions) (*v1.ProviderNetwork, error) + Update(ctx context.Context, providerNetwork *v1.ProviderNetwork, opts metav1.UpdateOptions) (*v1.ProviderNetwork, error) + UpdateStatus(ctx context.Context, providerNetwork *v1.ProviderNetwork, opts metav1.UpdateOptions) (*v1.ProviderNetwork, 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.ProviderNetwork, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ProviderNetworkList, 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.ProviderNetwork, err error) + ProviderNetworkExpansion +} + +// providerNetworks implements ProviderNetworkInterface +type providerNetworks struct { + client rest.Interface +} + +// newProviderNetworks returns a ProviderNetworks +func newProviderNetworks(c *KubeovnV1Client) *providerNetworks { + return &providerNetworks{ + client: c.RESTClient(), + } +} + +// Get takes name of the providerNetwork, and returns the corresponding providerNetwork object, and an error if there is any. +func (c *providerNetworks) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ProviderNetwork, err error) { + result = &v1.ProviderNetwork{} + err = c.client.Get(). + Resource("provider-networks"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ProviderNetworks that match those selectors. +func (c *providerNetworks) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ProviderNetworkList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ProviderNetworkList{} + err = c.client.Get(). + Resource("provider-networks"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested providerNetworks. +func (c *providerNetworks) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Resource("provider-networks"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a providerNetwork and creates it. Returns the server's representation of the providerNetwork, and an error, if there is any. +func (c *providerNetworks) Create(ctx context.Context, providerNetwork *v1.ProviderNetwork, opts metav1.CreateOptions) (result *v1.ProviderNetwork, err error) { + result = &v1.ProviderNetwork{} + err = c.client.Post(). + Resource("provider-networks"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(providerNetwork). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a providerNetwork and updates it. Returns the server's representation of the providerNetwork, and an error, if there is any. +func (c *providerNetworks) Update(ctx context.Context, providerNetwork *v1.ProviderNetwork, opts metav1.UpdateOptions) (result *v1.ProviderNetwork, err error) { + result = &v1.ProviderNetwork{} + err = c.client.Put(). + Resource("provider-networks"). + Name(providerNetwork.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(providerNetwork). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *providerNetworks) UpdateStatus(ctx context.Context, providerNetwork *v1.ProviderNetwork, opts metav1.UpdateOptions) (result *v1.ProviderNetwork, err error) { + result = &v1.ProviderNetwork{} + err = c.client.Put(). + Resource("provider-networks"). + Name(providerNetwork.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(providerNetwork). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the providerNetwork and deletes it. Returns an error if one occurs. +func (c *providerNetworks) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("provider-networks"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *providerNetworks) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("provider-networks"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched providerNetwork. +func (c *providerNetworks) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ProviderNetwork, err error) { + result = &v1.ProviderNetwork{} + err = c.client.Patch(pt). + Resource("provider-networks"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/securitygroup.go b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/securitygroup.go new file mode 100644 index 00000000000..391baf47c56 --- /dev/null +++ b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/securitygroup.go @@ -0,0 +1,184 @@ +/* +Copyright 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 v1 + +import ( + "context" + "time" + + v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + scheme "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// SecurityGroupsGetter has a method to return a SecurityGroupInterface. +// A group's client should implement this interface. +type SecurityGroupsGetter interface { + SecurityGroups() SecurityGroupInterface +} + +// SecurityGroupInterface has methods to work with SecurityGroup resources. +type SecurityGroupInterface interface { + Create(ctx context.Context, securityGroup *v1.SecurityGroup, opts metav1.CreateOptions) (*v1.SecurityGroup, error) + Update(ctx context.Context, securityGroup *v1.SecurityGroup, opts metav1.UpdateOptions) (*v1.SecurityGroup, error) + UpdateStatus(ctx context.Context, securityGroup *v1.SecurityGroup, opts metav1.UpdateOptions) (*v1.SecurityGroup, 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.SecurityGroup, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.SecurityGroupList, 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.SecurityGroup, err error) + SecurityGroupExpansion +} + +// securityGroups implements SecurityGroupInterface +type securityGroups struct { + client rest.Interface +} + +// newSecurityGroups returns a SecurityGroups +func newSecurityGroups(c *KubeovnV1Client) *securityGroups { + return &securityGroups{ + client: c.RESTClient(), + } +} + +// Get takes name of the securityGroup, and returns the corresponding securityGroup object, and an error if there is any. +func (c *securityGroups) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.SecurityGroup, err error) { + result = &v1.SecurityGroup{} + err = c.client.Get(). + Resource("security-groups"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of SecurityGroups that match those selectors. +func (c *securityGroups) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SecurityGroupList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.SecurityGroupList{} + err = c.client.Get(). + Resource("security-groups"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested securityGroups. +func (c *securityGroups) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Resource("security-groups"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a securityGroup and creates it. Returns the server's representation of the securityGroup, and an error, if there is any. +func (c *securityGroups) Create(ctx context.Context, securityGroup *v1.SecurityGroup, opts metav1.CreateOptions) (result *v1.SecurityGroup, err error) { + result = &v1.SecurityGroup{} + err = c.client.Post(). + Resource("security-groups"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(securityGroup). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a securityGroup and updates it. Returns the server's representation of the securityGroup, and an error, if there is any. +func (c *securityGroups) Update(ctx context.Context, securityGroup *v1.SecurityGroup, opts metav1.UpdateOptions) (result *v1.SecurityGroup, err error) { + result = &v1.SecurityGroup{} + err = c.client.Put(). + Resource("security-groups"). + Name(securityGroup.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(securityGroup). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *securityGroups) UpdateStatus(ctx context.Context, securityGroup *v1.SecurityGroup, opts metav1.UpdateOptions) (result *v1.SecurityGroup, err error) { + result = &v1.SecurityGroup{} + err = c.client.Put(). + Resource("security-groups"). + Name(securityGroup.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(securityGroup). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the securityGroup and deletes it. Returns an error if one occurs. +func (c *securityGroups) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("security-groups"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *securityGroups) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("security-groups"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched securityGroup. +func (c *securityGroups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.SecurityGroup, err error) { + result = &v1.SecurityGroup{} + err = c.client.Patch(pt). + Resource("security-groups"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/subnet.go b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/subnet.go new file mode 100644 index 00000000000..a1638ef10f5 --- /dev/null +++ b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/subnet.go @@ -0,0 +1,184 @@ +/* +Copyright 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 v1 + +import ( + "context" + "time" + + v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + scheme "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// SubnetsGetter has a method to return a SubnetInterface. +// A group's client should implement this interface. +type SubnetsGetter interface { + Subnets() SubnetInterface +} + +// SubnetInterface has methods to work with Subnet resources. +type SubnetInterface interface { + Create(ctx context.Context, subnet *v1.Subnet, opts metav1.CreateOptions) (*v1.Subnet, error) + Update(ctx context.Context, subnet *v1.Subnet, opts metav1.UpdateOptions) (*v1.Subnet, error) + UpdateStatus(ctx context.Context, subnet *v1.Subnet, opts metav1.UpdateOptions) (*v1.Subnet, 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.Subnet, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.SubnetList, 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.Subnet, err error) + SubnetExpansion +} + +// subnets implements SubnetInterface +type subnets struct { + client rest.Interface +} + +// newSubnets returns a Subnets +func newSubnets(c *KubeovnV1Client) *subnets { + return &subnets{ + client: c.RESTClient(), + } +} + +// Get takes name of the subnet, and returns the corresponding subnet object, and an error if there is any. +func (c *subnets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Subnet, err error) { + result = &v1.Subnet{} + err = c.client.Get(). + Resource("subnets"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Subnets that match those selectors. +func (c *subnets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SubnetList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.SubnetList{} + err = c.client.Get(). + Resource("subnets"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested subnets. +func (c *subnets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Resource("subnets"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a subnet and creates it. Returns the server's representation of the subnet, and an error, if there is any. +func (c *subnets) Create(ctx context.Context, subnet *v1.Subnet, opts metav1.CreateOptions) (result *v1.Subnet, err error) { + result = &v1.Subnet{} + err = c.client.Post(). + Resource("subnets"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(subnet). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a subnet and updates it. Returns the server's representation of the subnet, and an error, if there is any. +func (c *subnets) Update(ctx context.Context, subnet *v1.Subnet, opts metav1.UpdateOptions) (result *v1.Subnet, err error) { + result = &v1.Subnet{} + err = c.client.Put(). + Resource("subnets"). + Name(subnet.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(subnet). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *subnets) UpdateStatus(ctx context.Context, subnet *v1.Subnet, opts metav1.UpdateOptions) (result *v1.Subnet, err error) { + result = &v1.Subnet{} + err = c.client.Put(). + Resource("subnets"). + Name(subnet.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(subnet). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the subnet and deletes it. Returns an error if one occurs. +func (c *subnets) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("subnets"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *subnets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("subnets"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched subnet. +func (c *subnets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Subnet, err error) { + result = &v1.Subnet{} + err = c.client.Patch(pt). + Resource("subnets"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/switchlbrule.go b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/switchlbrule.go new file mode 100644 index 00000000000..537deb6a187 --- /dev/null +++ b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/switchlbrule.go @@ -0,0 +1,184 @@ +/* +Copyright 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 v1 + +import ( + "context" + "time" + + v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + scheme "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// SwitchLBRulesGetter has a method to return a SwitchLBRuleInterface. +// A group's client should implement this interface. +type SwitchLBRulesGetter interface { + SwitchLBRules() SwitchLBRuleInterface +} + +// SwitchLBRuleInterface has methods to work with SwitchLBRule resources. +type SwitchLBRuleInterface interface { + Create(ctx context.Context, switchLBRule *v1.SwitchLBRule, opts metav1.CreateOptions) (*v1.SwitchLBRule, error) + Update(ctx context.Context, switchLBRule *v1.SwitchLBRule, opts metav1.UpdateOptions) (*v1.SwitchLBRule, error) + UpdateStatus(ctx context.Context, switchLBRule *v1.SwitchLBRule, opts metav1.UpdateOptions) (*v1.SwitchLBRule, 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.SwitchLBRule, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.SwitchLBRuleList, 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.SwitchLBRule, err error) + SwitchLBRuleExpansion +} + +// switchLBRules implements SwitchLBRuleInterface +type switchLBRules struct { + client rest.Interface +} + +// newSwitchLBRules returns a SwitchLBRules +func newSwitchLBRules(c *KubeovnV1Client) *switchLBRules { + return &switchLBRules{ + client: c.RESTClient(), + } +} + +// Get takes name of the switchLBRule, and returns the corresponding switchLBRule object, and an error if there is any. +func (c *switchLBRules) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.SwitchLBRule, err error) { + result = &v1.SwitchLBRule{} + err = c.client.Get(). + Resource("switch-lb-rules"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of SwitchLBRules that match those selectors. +func (c *switchLBRules) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SwitchLBRuleList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.SwitchLBRuleList{} + err = c.client.Get(). + Resource("switch-lb-rules"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested switchLBRules. +func (c *switchLBRules) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Resource("switch-lb-rules"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a switchLBRule and creates it. Returns the server's representation of the switchLBRule, and an error, if there is any. +func (c *switchLBRules) Create(ctx context.Context, switchLBRule *v1.SwitchLBRule, opts metav1.CreateOptions) (result *v1.SwitchLBRule, err error) { + result = &v1.SwitchLBRule{} + err = c.client.Post(). + Resource("switch-lb-rules"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(switchLBRule). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a switchLBRule and updates it. Returns the server's representation of the switchLBRule, and an error, if there is any. +func (c *switchLBRules) Update(ctx context.Context, switchLBRule *v1.SwitchLBRule, opts metav1.UpdateOptions) (result *v1.SwitchLBRule, err error) { + result = &v1.SwitchLBRule{} + err = c.client.Put(). + Resource("switch-lb-rules"). + Name(switchLBRule.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(switchLBRule). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *switchLBRules) UpdateStatus(ctx context.Context, switchLBRule *v1.SwitchLBRule, opts metav1.UpdateOptions) (result *v1.SwitchLBRule, err error) { + result = &v1.SwitchLBRule{} + err = c.client.Put(). + Resource("switch-lb-rules"). + Name(switchLBRule.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(switchLBRule). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the switchLBRule and deletes it. Returns an error if one occurs. +func (c *switchLBRules) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("switch-lb-rules"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *switchLBRules) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("switch-lb-rules"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched switchLBRule. +func (c *switchLBRules) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.SwitchLBRule, err error) { + result = &v1.SwitchLBRule{} + err = c.client.Patch(pt). + Resource("switch-lb-rules"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/vip.go b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/vip.go new file mode 100644 index 00000000000..b355e6079bc --- /dev/null +++ b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/vip.go @@ -0,0 +1,184 @@ +/* +Copyright 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 v1 + +import ( + "context" + "time" + + v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + scheme "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// VipsGetter has a method to return a VipInterface. +// A group's client should implement this interface. +type VipsGetter interface { + Vips() VipInterface +} + +// VipInterface has methods to work with Vip resources. +type VipInterface interface { + Create(ctx context.Context, vip *v1.Vip, opts metav1.CreateOptions) (*v1.Vip, error) + Update(ctx context.Context, vip *v1.Vip, opts metav1.UpdateOptions) (*v1.Vip, error) + UpdateStatus(ctx context.Context, vip *v1.Vip, opts metav1.UpdateOptions) (*v1.Vip, 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.Vip, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.VipList, 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.Vip, err error) + VipExpansion +} + +// vips implements VipInterface +type vips struct { + client rest.Interface +} + +// newVips returns a Vips +func newVips(c *KubeovnV1Client) *vips { + return &vips{ + client: c.RESTClient(), + } +} + +// Get takes name of the vip, and returns the corresponding vip object, and an error if there is any. +func (c *vips) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Vip, err error) { + result = &v1.Vip{} + err = c.client.Get(). + Resource("vips"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Vips that match those selectors. +func (c *vips) List(ctx context.Context, opts metav1.ListOptions) (result *v1.VipList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.VipList{} + err = c.client.Get(). + Resource("vips"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested vips. +func (c *vips) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Resource("vips"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a vip and creates it. Returns the server's representation of the vip, and an error, if there is any. +func (c *vips) Create(ctx context.Context, vip *v1.Vip, opts metav1.CreateOptions) (result *v1.Vip, err error) { + result = &v1.Vip{} + err = c.client.Post(). + Resource("vips"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(vip). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a vip and updates it. Returns the server's representation of the vip, and an error, if there is any. +func (c *vips) Update(ctx context.Context, vip *v1.Vip, opts metav1.UpdateOptions) (result *v1.Vip, err error) { + result = &v1.Vip{} + err = c.client.Put(). + Resource("vips"). + Name(vip.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(vip). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *vips) UpdateStatus(ctx context.Context, vip *v1.Vip, opts metav1.UpdateOptions) (result *v1.Vip, err error) { + result = &v1.Vip{} + err = c.client.Put(). + Resource("vips"). + Name(vip.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(vip). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the vip and deletes it. Returns an error if one occurs. +func (c *vips) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("vips"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *vips) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("vips"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched vip. +func (c *vips) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Vip, err error) { + result = &v1.Vip{} + err = c.client.Patch(pt). + Resource("vips"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/vlan.go b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/vlan.go new file mode 100644 index 00000000000..64e91699707 --- /dev/null +++ b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/vlan.go @@ -0,0 +1,184 @@ +/* +Copyright 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 v1 + +import ( + "context" + "time" + + v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + scheme "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// VlansGetter has a method to return a VlanInterface. +// A group's client should implement this interface. +type VlansGetter interface { + Vlans() VlanInterface +} + +// VlanInterface has methods to work with Vlan resources. +type VlanInterface interface { + Create(ctx context.Context, vlan *v1.Vlan, opts metav1.CreateOptions) (*v1.Vlan, error) + Update(ctx context.Context, vlan *v1.Vlan, opts metav1.UpdateOptions) (*v1.Vlan, error) + UpdateStatus(ctx context.Context, vlan *v1.Vlan, opts metav1.UpdateOptions) (*v1.Vlan, 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.Vlan, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.VlanList, 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.Vlan, err error) + VlanExpansion +} + +// vlans implements VlanInterface +type vlans struct { + client rest.Interface +} + +// newVlans returns a Vlans +func newVlans(c *KubeovnV1Client) *vlans { + return &vlans{ + client: c.RESTClient(), + } +} + +// Get takes name of the vlan, and returns the corresponding vlan object, and an error if there is any. +func (c *vlans) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Vlan, err error) { + result = &v1.Vlan{} + err = c.client.Get(). + Resource("vlans"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Vlans that match those selectors. +func (c *vlans) List(ctx context.Context, opts metav1.ListOptions) (result *v1.VlanList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.VlanList{} + err = c.client.Get(). + Resource("vlans"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested vlans. +func (c *vlans) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Resource("vlans"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a vlan and creates it. Returns the server's representation of the vlan, and an error, if there is any. +func (c *vlans) Create(ctx context.Context, vlan *v1.Vlan, opts metav1.CreateOptions) (result *v1.Vlan, err error) { + result = &v1.Vlan{} + err = c.client.Post(). + Resource("vlans"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(vlan). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a vlan and updates it. Returns the server's representation of the vlan, and an error, if there is any. +func (c *vlans) Update(ctx context.Context, vlan *v1.Vlan, opts metav1.UpdateOptions) (result *v1.Vlan, err error) { + result = &v1.Vlan{} + err = c.client.Put(). + Resource("vlans"). + Name(vlan.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(vlan). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *vlans) UpdateStatus(ctx context.Context, vlan *v1.Vlan, opts metav1.UpdateOptions) (result *v1.Vlan, err error) { + result = &v1.Vlan{} + err = c.client.Put(). + Resource("vlans"). + Name(vlan.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(vlan). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the vlan and deletes it. Returns an error if one occurs. +func (c *vlans) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("vlans"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *vlans) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("vlans"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched vlan. +func (c *vlans) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Vlan, err error) { + result = &v1.Vlan{} + err = c.client.Patch(pt). + Resource("vlans"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/vpc.go b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/vpc.go new file mode 100644 index 00000000000..788500624fd --- /dev/null +++ b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/vpc.go @@ -0,0 +1,184 @@ +/* +Copyright 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 v1 + +import ( + "context" + "time" + + v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + scheme "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// VpcsGetter has a method to return a VpcInterface. +// A group's client should implement this interface. +type VpcsGetter interface { + Vpcs() VpcInterface +} + +// VpcInterface has methods to work with Vpc resources. +type VpcInterface interface { + Create(ctx context.Context, vpc *v1.Vpc, opts metav1.CreateOptions) (*v1.Vpc, error) + Update(ctx context.Context, vpc *v1.Vpc, opts metav1.UpdateOptions) (*v1.Vpc, error) + UpdateStatus(ctx context.Context, vpc *v1.Vpc, opts metav1.UpdateOptions) (*v1.Vpc, 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.Vpc, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.VpcList, 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.Vpc, err error) + VpcExpansion +} + +// vpcs implements VpcInterface +type vpcs struct { + client rest.Interface +} + +// newVpcs returns a Vpcs +func newVpcs(c *KubeovnV1Client) *vpcs { + return &vpcs{ + client: c.RESTClient(), + } +} + +// Get takes name of the vpc, and returns the corresponding vpc object, and an error if there is any. +func (c *vpcs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Vpc, err error) { + result = &v1.Vpc{} + err = c.client.Get(). + Resource("vpcs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Vpcs that match those selectors. +func (c *vpcs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.VpcList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.VpcList{} + err = c.client.Get(). + Resource("vpcs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested vpcs. +func (c *vpcs) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Resource("vpcs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a vpc and creates it. Returns the server's representation of the vpc, and an error, if there is any. +func (c *vpcs) Create(ctx context.Context, vpc *v1.Vpc, opts metav1.CreateOptions) (result *v1.Vpc, err error) { + result = &v1.Vpc{} + err = c.client.Post(). + Resource("vpcs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(vpc). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a vpc and updates it. Returns the server's representation of the vpc, and an error, if there is any. +func (c *vpcs) Update(ctx context.Context, vpc *v1.Vpc, opts metav1.UpdateOptions) (result *v1.Vpc, err error) { + result = &v1.Vpc{} + err = c.client.Put(). + Resource("vpcs"). + Name(vpc.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(vpc). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *vpcs) UpdateStatus(ctx context.Context, vpc *v1.Vpc, opts metav1.UpdateOptions) (result *v1.Vpc, err error) { + result = &v1.Vpc{} + err = c.client.Put(). + Resource("vpcs"). + Name(vpc.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(vpc). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the vpc and deletes it. Returns an error if one occurs. +func (c *vpcs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("vpcs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *vpcs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("vpcs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched vpc. +func (c *vpcs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Vpc, err error) { + result = &v1.Vpc{} + err = c.client.Patch(pt). + Resource("vpcs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/vpcdns.go b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/vpcdns.go new file mode 100644 index 00000000000..a5190ce56af --- /dev/null +++ b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/vpcdns.go @@ -0,0 +1,184 @@ +/* +Copyright 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 v1 + +import ( + "context" + "time" + + v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + scheme "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// VpcDnsesGetter has a method to return a VpcDnsInterface. +// A group's client should implement this interface. +type VpcDnsesGetter interface { + VpcDnses() VpcDnsInterface +} + +// VpcDnsInterface has methods to work with VpcDns resources. +type VpcDnsInterface interface { + Create(ctx context.Context, vpcDns *v1.VpcDns, opts metav1.CreateOptions) (*v1.VpcDns, error) + Update(ctx context.Context, vpcDns *v1.VpcDns, opts metav1.UpdateOptions) (*v1.VpcDns, error) + UpdateStatus(ctx context.Context, vpcDns *v1.VpcDns, opts metav1.UpdateOptions) (*v1.VpcDns, 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.VpcDns, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.VpcDnsList, 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.VpcDns, err error) + VpcDnsExpansion +} + +// vpcDnses implements VpcDnsInterface +type vpcDnses struct { + client rest.Interface +} + +// newVpcDnses returns a VpcDnses +func newVpcDnses(c *KubeovnV1Client) *vpcDnses { + return &vpcDnses{ + client: c.RESTClient(), + } +} + +// Get takes name of the vpcDns, and returns the corresponding vpcDns object, and an error if there is any. +func (c *vpcDnses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.VpcDns, err error) { + result = &v1.VpcDns{} + err = c.client.Get(). + Resource("vpc-dnses"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of VpcDnses that match those selectors. +func (c *vpcDnses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.VpcDnsList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.VpcDnsList{} + err = c.client.Get(). + Resource("vpc-dnses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested vpcDnses. +func (c *vpcDnses) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Resource("vpc-dnses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a vpcDns and creates it. Returns the server's representation of the vpcDns, and an error, if there is any. +func (c *vpcDnses) Create(ctx context.Context, vpcDns *v1.VpcDns, opts metav1.CreateOptions) (result *v1.VpcDns, err error) { + result = &v1.VpcDns{} + err = c.client.Post(). + Resource("vpc-dnses"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(vpcDns). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a vpcDns and updates it. Returns the server's representation of the vpcDns, and an error, if there is any. +func (c *vpcDnses) Update(ctx context.Context, vpcDns *v1.VpcDns, opts metav1.UpdateOptions) (result *v1.VpcDns, err error) { + result = &v1.VpcDns{} + err = c.client.Put(). + Resource("vpc-dnses"). + Name(vpcDns.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(vpcDns). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *vpcDnses) UpdateStatus(ctx context.Context, vpcDns *v1.VpcDns, opts metav1.UpdateOptions) (result *v1.VpcDns, err error) { + result = &v1.VpcDns{} + err = c.client.Put(). + Resource("vpc-dnses"). + Name(vpcDns.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(vpcDns). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the vpcDns and deletes it. Returns an error if one occurs. +func (c *vpcDnses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("vpc-dnses"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *vpcDnses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("vpc-dnses"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched vpcDns. +func (c *vpcDnses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VpcDns, err error) { + result = &v1.VpcDns{} + err = c.client.Patch(pt). + Resource("vpc-dnses"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/vpcnatgateway.go b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/vpcnatgateway.go new file mode 100644 index 00000000000..03d08658f38 --- /dev/null +++ b/pkg/client/listers/clientset/versioned/typed/kubeovn/v1/vpcnatgateway.go @@ -0,0 +1,168 @@ +/* +Copyright 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 v1 + +import ( + "context" + "time" + + v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + scheme "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// VpcNatGatewaysGetter has a method to return a VpcNatGatewayInterface. +// A group's client should implement this interface. +type VpcNatGatewaysGetter interface { + VpcNatGateways() VpcNatGatewayInterface +} + +// VpcNatGatewayInterface has methods to work with VpcNatGateway resources. +type VpcNatGatewayInterface interface { + Create(ctx context.Context, vpcNatGateway *v1.VpcNatGateway, opts metav1.CreateOptions) (*v1.VpcNatGateway, error) + Update(ctx context.Context, vpcNatGateway *v1.VpcNatGateway, opts metav1.UpdateOptions) (*v1.VpcNatGateway, 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.VpcNatGateway, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.VpcNatGatewayList, 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.VpcNatGateway, err error) + VpcNatGatewayExpansion +} + +// vpcNatGateways implements VpcNatGatewayInterface +type vpcNatGateways struct { + client rest.Interface +} + +// newVpcNatGateways returns a VpcNatGateways +func newVpcNatGateways(c *KubeovnV1Client) *vpcNatGateways { + return &vpcNatGateways{ + client: c.RESTClient(), + } +} + +// Get takes name of the vpcNatGateway, and returns the corresponding vpcNatGateway object, and an error if there is any. +func (c *vpcNatGateways) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.VpcNatGateway, err error) { + result = &v1.VpcNatGateway{} + err = c.client.Get(). + Resource("vpc-nat-gateways"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of VpcNatGateways that match those selectors. +func (c *vpcNatGateways) List(ctx context.Context, opts metav1.ListOptions) (result *v1.VpcNatGatewayList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.VpcNatGatewayList{} + err = c.client.Get(). + Resource("vpc-nat-gateways"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested vpcNatGateways. +func (c *vpcNatGateways) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Resource("vpc-nat-gateways"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a vpcNatGateway and creates it. Returns the server's representation of the vpcNatGateway, and an error, if there is any. +func (c *vpcNatGateways) Create(ctx context.Context, vpcNatGateway *v1.VpcNatGateway, opts metav1.CreateOptions) (result *v1.VpcNatGateway, err error) { + result = &v1.VpcNatGateway{} + err = c.client.Post(). + Resource("vpc-nat-gateways"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(vpcNatGateway). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a vpcNatGateway and updates it. Returns the server's representation of the vpcNatGateway, and an error, if there is any. +func (c *vpcNatGateways) Update(ctx context.Context, vpcNatGateway *v1.VpcNatGateway, opts metav1.UpdateOptions) (result *v1.VpcNatGateway, err error) { + result = &v1.VpcNatGateway{} + err = c.client.Put(). + Resource("vpc-nat-gateways"). + Name(vpcNatGateway.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(vpcNatGateway). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the vpcNatGateway and deletes it. Returns an error if one occurs. +func (c *vpcNatGateways) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("vpc-nat-gateways"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *vpcNatGateways) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("vpc-nat-gateways"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched vpcNatGateway. +func (c *vpcNatGateways) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VpcNatGateway, err error) { + result = &v1.VpcNatGateway{} + err = c.client.Patch(pt). + Resource("vpc-nat-gateways"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/client/listers/informers/externalversions/factory.go b/pkg/client/listers/informers/externalversions/factory.go new file mode 100644 index 00000000000..baba604c99f --- /dev/null +++ b/pkg/client/listers/informers/externalversions/factory.go @@ -0,0 +1,180 @@ +/* +Copyright 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 informer-gen. DO NOT EDIT. + +package externalversions + +import ( + reflect "reflect" + sync "sync" + time "time" + + versioned "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned" + internalinterfaces "github.com/kubeovn/kube-ovn/pkg/client/informers/externalversions/internalinterfaces" + kubeovn "github.com/kubeovn/kube-ovn/pkg/client/informers/externalversions/kubeovn" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + cache "k8s.io/client-go/tools/cache" +) + +// SharedInformerOption defines the functional option type for SharedInformerFactory. +type SharedInformerOption func(*sharedInformerFactory) *sharedInformerFactory + +type sharedInformerFactory struct { + client versioned.Interface + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc + lock sync.Mutex + defaultResync time.Duration + customResync map[reflect.Type]time.Duration + + informers map[reflect.Type]cache.SharedIndexInformer + // startedInformers is used for tracking which informers have been started. + // This allows Start() to be called multiple times safely. + startedInformers map[reflect.Type]bool +} + +// WithCustomResyncConfig sets a custom resync period for the specified informer types. +func WithCustomResyncConfig(resyncConfig map[v1.Object]time.Duration) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + for k, v := range resyncConfig { + factory.customResync[reflect.TypeOf(k)] = v + } + return factory + } +} + +// WithTweakListOptions sets a custom filter on all listers of the configured SharedInformerFactory. +func WithTweakListOptions(tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + factory.tweakListOptions = tweakListOptions + return factory + } +} + +// WithNamespace limits the SharedInformerFactory to the specified namespace. +func WithNamespace(namespace string) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + factory.namespace = namespace + return factory + } +} + +// NewSharedInformerFactory constructs a new instance of sharedInformerFactory for all namespaces. +func NewSharedInformerFactory(client versioned.Interface, defaultResync time.Duration) SharedInformerFactory { + return NewSharedInformerFactoryWithOptions(client, defaultResync) +} + +// NewFilteredSharedInformerFactory constructs a new instance of sharedInformerFactory. +// Listers obtained via this SharedInformerFactory will be subject to the same filters +// as specified here. +// Deprecated: Please use NewSharedInformerFactoryWithOptions instead +func NewFilteredSharedInformerFactory(client versioned.Interface, defaultResync time.Duration, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerFactory { + return NewSharedInformerFactoryWithOptions(client, defaultResync, WithNamespace(namespace), WithTweakListOptions(tweakListOptions)) +} + +// NewSharedInformerFactoryWithOptions constructs a new instance of a SharedInformerFactory with additional options. +func NewSharedInformerFactoryWithOptions(client versioned.Interface, defaultResync time.Duration, options ...SharedInformerOption) SharedInformerFactory { + factory := &sharedInformerFactory{ + client: client, + namespace: v1.NamespaceAll, + defaultResync: defaultResync, + informers: make(map[reflect.Type]cache.SharedIndexInformer), + startedInformers: make(map[reflect.Type]bool), + customResync: make(map[reflect.Type]time.Duration), + } + + // Apply all options + for _, opt := range options { + factory = opt(factory) + } + + return factory +} + +// Start initializes all requested informers. +func (f *sharedInformerFactory) Start(stopCh <-chan struct{}) { + f.lock.Lock() + defer f.lock.Unlock() + + for informerType, informer := range f.informers { + if !f.startedInformers[informerType] { + go informer.Run(stopCh) + f.startedInformers[informerType] = true + } + } +} + +// WaitForCacheSync waits for all started informers' cache were synced. +func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool { + informers := func() map[reflect.Type]cache.SharedIndexInformer { + f.lock.Lock() + defer f.lock.Unlock() + + informers := map[reflect.Type]cache.SharedIndexInformer{} + for informerType, informer := range f.informers { + if f.startedInformers[informerType] { + informers[informerType] = informer + } + } + return informers + }() + + res := map[reflect.Type]bool{} + for informType, informer := range informers { + res[informType] = cache.WaitForCacheSync(stopCh, informer.HasSynced) + } + return res +} + +// InternalInformerFor returns the SharedIndexInformer for obj using an internal +// client. +func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer { + f.lock.Lock() + defer f.lock.Unlock() + + informerType := reflect.TypeOf(obj) + informer, exists := f.informers[informerType] + if exists { + return informer + } + + resyncPeriod, exists := f.customResync[informerType] + if !exists { + resyncPeriod = f.defaultResync + } + + informer = newFunc(f.client, resyncPeriod) + f.informers[informerType] = informer + + return informer +} + +// SharedInformerFactory provides shared informers for resources in all known +// API group versions. +type SharedInformerFactory interface { + internalinterfaces.SharedInformerFactory + ForResource(resource schema.GroupVersionResource) (GenericInformer, error) + WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool + + Kubeovn() kubeovn.Interface +} + +func (f *sharedInformerFactory) Kubeovn() kubeovn.Interface { + return kubeovn.New(f, f.namespace, f.tweakListOptions) +} diff --git a/pkg/client/listers/informers/externalversions/generic.go b/pkg/client/listers/informers/externalversions/generic.go new file mode 100644 index 00000000000..5a9cf825907 --- /dev/null +++ b/pkg/client/listers/informers/externalversions/generic.go @@ -0,0 +1,96 @@ +/* +Copyright 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 informer-gen. DO NOT EDIT. + +package externalversions + +import ( + "fmt" + + v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + schema "k8s.io/apimachinery/pkg/runtime/schema" + cache "k8s.io/client-go/tools/cache" +) + +// GenericInformer is type of SharedIndexInformer which will locate and delegate to other +// sharedInformers based on type +type GenericInformer interface { + Informer() cache.SharedIndexInformer + Lister() cache.GenericLister +} + +type genericInformer struct { + informer cache.SharedIndexInformer + resource schema.GroupResource +} + +// Informer returns the SharedIndexInformer. +func (f *genericInformer) Informer() cache.SharedIndexInformer { + return f.informer +} + +// Lister returns the GenericLister. +func (f *genericInformer) Lister() cache.GenericLister { + return cache.NewGenericLister(f.Informer().GetIndexer(), f.resource) +} + +// ForResource gives generic access to a shared informer of the matching type +// TODO extend this to unknown resources with a client pool +func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { + switch resource { + // Group=kubeovn.io, Version=v1 + case v1.SchemeGroupVersion.WithResource("htbqoses"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Kubeovn().V1().HtbQoses().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("ips"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Kubeovn().V1().IPs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("iptables-dnat-rules"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Kubeovn().V1().IptablesDnatRules().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("iptables-eips"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Kubeovn().V1().IptablesEIPs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("iptables-fip-rules"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Kubeovn().V1().IptablesFIPRules().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("iptables-snat-rules"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Kubeovn().V1().IptablesSnatRules().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("ovn-eips"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Kubeovn().V1().OvnEips().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("ovn-fips"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Kubeovn().V1().OvnFips().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("ovn-snat-rules"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Kubeovn().V1().OvnSnatRules().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("provider-networks"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Kubeovn().V1().ProviderNetworks().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("security-groups"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Kubeovn().V1().SecurityGroups().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("subnets"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Kubeovn().V1().Subnets().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("switch-lb-rules"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Kubeovn().V1().SwitchLBRules().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("vips"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Kubeovn().V1().Vips().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("vlans"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Kubeovn().V1().Vlans().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("vpcs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Kubeovn().V1().Vpcs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("vpc-dnses"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Kubeovn().V1().VpcDnses().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("vpc-nat-gateways"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Kubeovn().V1().VpcNatGateways().Informer()}, nil + + } + + return nil, fmt.Errorf("no informer found for %v", resource) +} diff --git a/pkg/client/listers/informers/externalversions/internalinterfaces/factory_interfaces.go b/pkg/client/listers/informers/externalversions/internalinterfaces/factory_interfaces.go new file mode 100644 index 00000000000..801e5805f23 --- /dev/null +++ b/pkg/client/listers/informers/externalversions/internalinterfaces/factory_interfaces.go @@ -0,0 +1,40 @@ +/* +Copyright 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 informer-gen. DO NOT EDIT. + +package internalinterfaces + +import ( + time "time" + + versioned "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + cache "k8s.io/client-go/tools/cache" +) + +// NewInformerFunc takes versioned.Interface and time.Duration to return a SharedIndexInformer. +type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer + +// SharedInformerFactory a small interface to allow for adding an informer without an import cycle +type SharedInformerFactory interface { + Start(stopCh <-chan struct{}) + InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer +} + +// TweakListOptionsFunc is a function that transforms a v1.ListOptions. +type TweakListOptionsFunc func(*v1.ListOptions) diff --git a/pkg/client/listers/informers/externalversions/kubeovn/interface.go b/pkg/client/listers/informers/externalversions/kubeovn/interface.go new file mode 100644 index 00000000000..4068b949381 --- /dev/null +++ b/pkg/client/listers/informers/externalversions/kubeovn/interface.go @@ -0,0 +1,46 @@ +/* +Copyright 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 informer-gen. DO NOT EDIT. + +package kubeovn + +import ( + internalinterfaces "github.com/kubeovn/kube-ovn/pkg/client/informers/externalversions/internalinterfaces" + v1 "github.com/kubeovn/kube-ovn/pkg/client/informers/externalversions/kubeovn/v1" +) + +// Interface provides access to each of this group's versions. +type Interface interface { + // V1 provides access to shared informers for resources in V1. + V1() v1.Interface +} + +type group struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// V1 returns a new v1.Interface. +func (g *group) V1() v1.Interface { + return v1.New(g.factory, g.namespace, g.tweakListOptions) +} diff --git a/pkg/client/listers/informers/externalversions/kubeovn/v1/htbqos.go b/pkg/client/listers/informers/externalversions/kubeovn/v1/htbqos.go new file mode 100644 index 00000000000..3560b8f2aa9 --- /dev/null +++ b/pkg/client/listers/informers/externalversions/kubeovn/v1/htbqos.go @@ -0,0 +1,89 @@ +/* +Copyright 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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + time "time" + + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + versioned "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned" + internalinterfaces "github.com/kubeovn/kube-ovn/pkg/client/informers/externalversions/internalinterfaces" + v1 "github.com/kubeovn/kube-ovn/pkg/client/listers/kubeovn/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// HtbQosInformer provides access to a shared informer and lister for +// HtbQoses. +type HtbQosInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.HtbQosLister +} + +type htbQosInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewHtbQosInformer constructs a new informer for HtbQos type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewHtbQosInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredHtbQosInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredHtbQosInformer constructs a new informer for HtbQos type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredHtbQosInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.KubeovnV1().HtbQoses().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.KubeovnV1().HtbQoses().Watch(context.TODO(), options) + }, + }, + &kubeovnv1.HtbQos{}, + resyncPeriod, + indexers, + ) +} + +func (f *htbQosInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredHtbQosInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *htbQosInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&kubeovnv1.HtbQos{}, f.defaultInformer) +} + +func (f *htbQosInformer) Lister() v1.HtbQosLister { + return v1.NewHtbQosLister(f.Informer().GetIndexer()) +} diff --git a/pkg/client/listers/informers/externalversions/kubeovn/v1/interface.go b/pkg/client/listers/informers/externalversions/kubeovn/v1/interface.go new file mode 100644 index 00000000000..14af985943c --- /dev/null +++ b/pkg/client/listers/informers/externalversions/kubeovn/v1/interface.go @@ -0,0 +1,164 @@ +/* +Copyright 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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + internalinterfaces "github.com/kubeovn/kube-ovn/pkg/client/informers/externalversions/internalinterfaces" +) + +// Interface provides access to all the informers in this group version. +type Interface interface { + // HtbQoses returns a HtbQosInformer. + HtbQoses() HtbQosInformer + // IPs returns a IPInformer. + IPs() IPInformer + // IptablesDnatRules returns a IptablesDnatRuleInformer. + IptablesDnatRules() IptablesDnatRuleInformer + // IptablesEIPs returns a IptablesEIPInformer. + IptablesEIPs() IptablesEIPInformer + // IptablesFIPRules returns a IptablesFIPRuleInformer. + IptablesFIPRules() IptablesFIPRuleInformer + // IptablesSnatRules returns a IptablesSnatRuleInformer. + IptablesSnatRules() IptablesSnatRuleInformer + // OvnEips returns a OvnEipInformer. + OvnEips() OvnEipInformer + // OvnFips returns a OvnFipInformer. + OvnFips() OvnFipInformer + // OvnSnatRules returns a OvnSnatRuleInformer. + OvnSnatRules() OvnSnatRuleInformer + // ProviderNetworks returns a ProviderNetworkInformer. + ProviderNetworks() ProviderNetworkInformer + // SecurityGroups returns a SecurityGroupInformer. + SecurityGroups() SecurityGroupInformer + // Subnets returns a SubnetInformer. + Subnets() SubnetInformer + // SwitchLBRules returns a SwitchLBRuleInformer. + SwitchLBRules() SwitchLBRuleInformer + // Vips returns a VipInformer. + Vips() VipInformer + // Vlans returns a VlanInformer. + Vlans() VlanInformer + // Vpcs returns a VpcInformer. + Vpcs() VpcInformer + // VpcDnses returns a VpcDnsInformer. + VpcDnses() VpcDnsInformer + // VpcNatGateways returns a VpcNatGatewayInformer. + VpcNatGateways() VpcNatGatewayInformer +} + +type version struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// HtbQoses returns a HtbQosInformer. +func (v *version) HtbQoses() HtbQosInformer { + return &htbQosInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// IPs returns a IPInformer. +func (v *version) IPs() IPInformer { + return &iPInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// IptablesDnatRules returns a IptablesDnatRuleInformer. +func (v *version) IptablesDnatRules() IptablesDnatRuleInformer { + return &iptablesDnatRuleInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// IptablesEIPs returns a IptablesEIPInformer. +func (v *version) IptablesEIPs() IptablesEIPInformer { + return &iptablesEIPInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// IptablesFIPRules returns a IptablesFIPRuleInformer. +func (v *version) IptablesFIPRules() IptablesFIPRuleInformer { + return &iptablesFIPRuleInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// IptablesSnatRules returns a IptablesSnatRuleInformer. +func (v *version) IptablesSnatRules() IptablesSnatRuleInformer { + return &iptablesSnatRuleInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// OvnEips returns a OvnEipInformer. +func (v *version) OvnEips() OvnEipInformer { + return &ovnEipInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// OvnFips returns a OvnFipInformer. +func (v *version) OvnFips() OvnFipInformer { + return &ovnFipInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// OvnSnatRules returns a OvnSnatRuleInformer. +func (v *version) OvnSnatRules() OvnSnatRuleInformer { + return &ovnSnatRuleInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ProviderNetworks returns a ProviderNetworkInformer. +func (v *version) ProviderNetworks() ProviderNetworkInformer { + return &providerNetworkInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// SecurityGroups returns a SecurityGroupInformer. +func (v *version) SecurityGroups() SecurityGroupInformer { + return &securityGroupInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// Subnets returns a SubnetInformer. +func (v *version) Subnets() SubnetInformer { + return &subnetInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// SwitchLBRules returns a SwitchLBRuleInformer. +func (v *version) SwitchLBRules() SwitchLBRuleInformer { + return &switchLBRuleInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// Vips returns a VipInformer. +func (v *version) Vips() VipInformer { + return &vipInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// Vlans returns a VlanInformer. +func (v *version) Vlans() VlanInformer { + return &vlanInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// Vpcs returns a VpcInformer. +func (v *version) Vpcs() VpcInformer { + return &vpcInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// VpcDnses returns a VpcDnsInformer. +func (v *version) VpcDnses() VpcDnsInformer { + return &vpcDnsInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// VpcNatGateways returns a VpcNatGatewayInformer. +func (v *version) VpcNatGateways() VpcNatGatewayInformer { + return &vpcNatGatewayInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} diff --git a/pkg/client/listers/informers/externalversions/kubeovn/v1/ip.go b/pkg/client/listers/informers/externalversions/kubeovn/v1/ip.go new file mode 100644 index 00000000000..37743e1390e --- /dev/null +++ b/pkg/client/listers/informers/externalversions/kubeovn/v1/ip.go @@ -0,0 +1,89 @@ +/* +Copyright 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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + time "time" + + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + versioned "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned" + internalinterfaces "github.com/kubeovn/kube-ovn/pkg/client/informers/externalversions/internalinterfaces" + v1 "github.com/kubeovn/kube-ovn/pkg/client/listers/kubeovn/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// IPInformer provides access to a shared informer and lister for +// IPs. +type IPInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.IPLister +} + +type iPInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewIPInformer constructs a new informer for IP type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewIPInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredIPInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredIPInformer constructs a new informer for IP type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredIPInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.KubeovnV1().IPs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.KubeovnV1().IPs().Watch(context.TODO(), options) + }, + }, + &kubeovnv1.IP{}, + resyncPeriod, + indexers, + ) +} + +func (f *iPInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredIPInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *iPInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&kubeovnv1.IP{}, f.defaultInformer) +} + +func (f *iPInformer) Lister() v1.IPLister { + return v1.NewIPLister(f.Informer().GetIndexer()) +} diff --git a/pkg/client/listers/informers/externalversions/kubeovn/v1/iptablesdnatrule.go b/pkg/client/listers/informers/externalversions/kubeovn/v1/iptablesdnatrule.go new file mode 100644 index 00000000000..48bdd4e5851 --- /dev/null +++ b/pkg/client/listers/informers/externalversions/kubeovn/v1/iptablesdnatrule.go @@ -0,0 +1,89 @@ +/* +Copyright 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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + time "time" + + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + versioned "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned" + internalinterfaces "github.com/kubeovn/kube-ovn/pkg/client/informers/externalversions/internalinterfaces" + v1 "github.com/kubeovn/kube-ovn/pkg/client/listers/kubeovn/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// IptablesDnatRuleInformer provides access to a shared informer and lister for +// IptablesDnatRules. +type IptablesDnatRuleInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.IptablesDnatRuleLister +} + +type iptablesDnatRuleInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewIptablesDnatRuleInformer constructs a new informer for IptablesDnatRule type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewIptablesDnatRuleInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredIptablesDnatRuleInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredIptablesDnatRuleInformer constructs a new informer for IptablesDnatRule type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredIptablesDnatRuleInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.KubeovnV1().IptablesDnatRules().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.KubeovnV1().IptablesDnatRules().Watch(context.TODO(), options) + }, + }, + &kubeovnv1.IptablesDnatRule{}, + resyncPeriod, + indexers, + ) +} + +func (f *iptablesDnatRuleInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredIptablesDnatRuleInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *iptablesDnatRuleInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&kubeovnv1.IptablesDnatRule{}, f.defaultInformer) +} + +func (f *iptablesDnatRuleInformer) Lister() v1.IptablesDnatRuleLister { + return v1.NewIptablesDnatRuleLister(f.Informer().GetIndexer()) +} diff --git a/pkg/client/listers/informers/externalversions/kubeovn/v1/iptableseip.go b/pkg/client/listers/informers/externalversions/kubeovn/v1/iptableseip.go new file mode 100644 index 00000000000..a624ddee327 --- /dev/null +++ b/pkg/client/listers/informers/externalversions/kubeovn/v1/iptableseip.go @@ -0,0 +1,89 @@ +/* +Copyright 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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + time "time" + + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + versioned "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned" + internalinterfaces "github.com/kubeovn/kube-ovn/pkg/client/informers/externalversions/internalinterfaces" + v1 "github.com/kubeovn/kube-ovn/pkg/client/listers/kubeovn/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// IptablesEIPInformer provides access to a shared informer and lister for +// IptablesEIPs. +type IptablesEIPInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.IptablesEIPLister +} + +type iptablesEIPInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewIptablesEIPInformer constructs a new informer for IptablesEIP type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewIptablesEIPInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredIptablesEIPInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredIptablesEIPInformer constructs a new informer for IptablesEIP type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredIptablesEIPInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.KubeovnV1().IptablesEIPs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.KubeovnV1().IptablesEIPs().Watch(context.TODO(), options) + }, + }, + &kubeovnv1.IptablesEIP{}, + resyncPeriod, + indexers, + ) +} + +func (f *iptablesEIPInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredIptablesEIPInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *iptablesEIPInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&kubeovnv1.IptablesEIP{}, f.defaultInformer) +} + +func (f *iptablesEIPInformer) Lister() v1.IptablesEIPLister { + return v1.NewIptablesEIPLister(f.Informer().GetIndexer()) +} diff --git a/pkg/client/listers/informers/externalversions/kubeovn/v1/iptablesfiprule.go b/pkg/client/listers/informers/externalversions/kubeovn/v1/iptablesfiprule.go new file mode 100644 index 00000000000..44a547fb274 --- /dev/null +++ b/pkg/client/listers/informers/externalversions/kubeovn/v1/iptablesfiprule.go @@ -0,0 +1,89 @@ +/* +Copyright 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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + time "time" + + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + versioned "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned" + internalinterfaces "github.com/kubeovn/kube-ovn/pkg/client/informers/externalversions/internalinterfaces" + v1 "github.com/kubeovn/kube-ovn/pkg/client/listers/kubeovn/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// IptablesFIPRuleInformer provides access to a shared informer and lister for +// IptablesFIPRules. +type IptablesFIPRuleInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.IptablesFIPRuleLister +} + +type iptablesFIPRuleInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewIptablesFIPRuleInformer constructs a new informer for IptablesFIPRule type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewIptablesFIPRuleInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredIptablesFIPRuleInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredIptablesFIPRuleInformer constructs a new informer for IptablesFIPRule type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredIptablesFIPRuleInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.KubeovnV1().IptablesFIPRules().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.KubeovnV1().IptablesFIPRules().Watch(context.TODO(), options) + }, + }, + &kubeovnv1.IptablesFIPRule{}, + resyncPeriod, + indexers, + ) +} + +func (f *iptablesFIPRuleInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredIptablesFIPRuleInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *iptablesFIPRuleInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&kubeovnv1.IptablesFIPRule{}, f.defaultInformer) +} + +func (f *iptablesFIPRuleInformer) Lister() v1.IptablesFIPRuleLister { + return v1.NewIptablesFIPRuleLister(f.Informer().GetIndexer()) +} diff --git a/pkg/client/listers/informers/externalversions/kubeovn/v1/iptablessnatrule.go b/pkg/client/listers/informers/externalversions/kubeovn/v1/iptablessnatrule.go new file mode 100644 index 00000000000..8ae4adb8b7d --- /dev/null +++ b/pkg/client/listers/informers/externalversions/kubeovn/v1/iptablessnatrule.go @@ -0,0 +1,89 @@ +/* +Copyright 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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + time "time" + + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + versioned "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned" + internalinterfaces "github.com/kubeovn/kube-ovn/pkg/client/informers/externalversions/internalinterfaces" + v1 "github.com/kubeovn/kube-ovn/pkg/client/listers/kubeovn/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// IptablesSnatRuleInformer provides access to a shared informer and lister for +// IptablesSnatRules. +type IptablesSnatRuleInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.IptablesSnatRuleLister +} + +type iptablesSnatRuleInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewIptablesSnatRuleInformer constructs a new informer for IptablesSnatRule type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewIptablesSnatRuleInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredIptablesSnatRuleInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredIptablesSnatRuleInformer constructs a new informer for IptablesSnatRule type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredIptablesSnatRuleInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.KubeovnV1().IptablesSnatRules().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.KubeovnV1().IptablesSnatRules().Watch(context.TODO(), options) + }, + }, + &kubeovnv1.IptablesSnatRule{}, + resyncPeriod, + indexers, + ) +} + +func (f *iptablesSnatRuleInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredIptablesSnatRuleInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *iptablesSnatRuleInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&kubeovnv1.IptablesSnatRule{}, f.defaultInformer) +} + +func (f *iptablesSnatRuleInformer) Lister() v1.IptablesSnatRuleLister { + return v1.NewIptablesSnatRuleLister(f.Informer().GetIndexer()) +} diff --git a/pkg/client/listers/informers/externalversions/kubeovn/v1/ovneip.go b/pkg/client/listers/informers/externalversions/kubeovn/v1/ovneip.go new file mode 100644 index 00000000000..89d5353e2de --- /dev/null +++ b/pkg/client/listers/informers/externalversions/kubeovn/v1/ovneip.go @@ -0,0 +1,89 @@ +/* +Copyright 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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + time "time" + + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + versioned "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned" + internalinterfaces "github.com/kubeovn/kube-ovn/pkg/client/informers/externalversions/internalinterfaces" + v1 "github.com/kubeovn/kube-ovn/pkg/client/listers/kubeovn/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// OvnEipInformer provides access to a shared informer and lister for +// OvnEips. +type OvnEipInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.OvnEipLister +} + +type ovnEipInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewOvnEipInformer constructs a new informer for OvnEip type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewOvnEipInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredOvnEipInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredOvnEipInformer constructs a new informer for OvnEip type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredOvnEipInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.KubeovnV1().OvnEips().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.KubeovnV1().OvnEips().Watch(context.TODO(), options) + }, + }, + &kubeovnv1.OvnEip{}, + resyncPeriod, + indexers, + ) +} + +func (f *ovnEipInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredOvnEipInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *ovnEipInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&kubeovnv1.OvnEip{}, f.defaultInformer) +} + +func (f *ovnEipInformer) Lister() v1.OvnEipLister { + return v1.NewOvnEipLister(f.Informer().GetIndexer()) +} diff --git a/pkg/client/listers/informers/externalversions/kubeovn/v1/ovnfip.go b/pkg/client/listers/informers/externalversions/kubeovn/v1/ovnfip.go new file mode 100644 index 00000000000..8d582d92862 --- /dev/null +++ b/pkg/client/listers/informers/externalversions/kubeovn/v1/ovnfip.go @@ -0,0 +1,89 @@ +/* +Copyright 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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + time "time" + + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + versioned "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned" + internalinterfaces "github.com/kubeovn/kube-ovn/pkg/client/informers/externalversions/internalinterfaces" + v1 "github.com/kubeovn/kube-ovn/pkg/client/listers/kubeovn/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// OvnFipInformer provides access to a shared informer and lister for +// OvnFips. +type OvnFipInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.OvnFipLister +} + +type ovnFipInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewOvnFipInformer constructs a new informer for OvnFip type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewOvnFipInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredOvnFipInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredOvnFipInformer constructs a new informer for OvnFip type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredOvnFipInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.KubeovnV1().OvnFips().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.KubeovnV1().OvnFips().Watch(context.TODO(), options) + }, + }, + &kubeovnv1.OvnFip{}, + resyncPeriod, + indexers, + ) +} + +func (f *ovnFipInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredOvnFipInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *ovnFipInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&kubeovnv1.OvnFip{}, f.defaultInformer) +} + +func (f *ovnFipInformer) Lister() v1.OvnFipLister { + return v1.NewOvnFipLister(f.Informer().GetIndexer()) +} diff --git a/pkg/client/listers/informers/externalversions/kubeovn/v1/ovnsnatrule.go b/pkg/client/listers/informers/externalversions/kubeovn/v1/ovnsnatrule.go new file mode 100644 index 00000000000..676db376b8c --- /dev/null +++ b/pkg/client/listers/informers/externalversions/kubeovn/v1/ovnsnatrule.go @@ -0,0 +1,89 @@ +/* +Copyright 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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + time "time" + + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + versioned "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned" + internalinterfaces "github.com/kubeovn/kube-ovn/pkg/client/informers/externalversions/internalinterfaces" + v1 "github.com/kubeovn/kube-ovn/pkg/client/listers/kubeovn/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// OvnSnatRuleInformer provides access to a shared informer and lister for +// OvnSnatRules. +type OvnSnatRuleInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.OvnSnatRuleLister +} + +type ovnSnatRuleInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewOvnSnatRuleInformer constructs a new informer for OvnSnatRule type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewOvnSnatRuleInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredOvnSnatRuleInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredOvnSnatRuleInformer constructs a new informer for OvnSnatRule type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredOvnSnatRuleInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.KubeovnV1().OvnSnatRules().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.KubeovnV1().OvnSnatRules().Watch(context.TODO(), options) + }, + }, + &kubeovnv1.OvnSnatRule{}, + resyncPeriod, + indexers, + ) +} + +func (f *ovnSnatRuleInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredOvnSnatRuleInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *ovnSnatRuleInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&kubeovnv1.OvnSnatRule{}, f.defaultInformer) +} + +func (f *ovnSnatRuleInformer) Lister() v1.OvnSnatRuleLister { + return v1.NewOvnSnatRuleLister(f.Informer().GetIndexer()) +} diff --git a/pkg/client/listers/informers/externalversions/kubeovn/v1/providernetwork.go b/pkg/client/listers/informers/externalversions/kubeovn/v1/providernetwork.go new file mode 100644 index 00000000000..2a6d8bfdcd5 --- /dev/null +++ b/pkg/client/listers/informers/externalversions/kubeovn/v1/providernetwork.go @@ -0,0 +1,89 @@ +/* +Copyright 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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + time "time" + + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + versioned "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned" + internalinterfaces "github.com/kubeovn/kube-ovn/pkg/client/informers/externalversions/internalinterfaces" + v1 "github.com/kubeovn/kube-ovn/pkg/client/listers/kubeovn/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ProviderNetworkInformer provides access to a shared informer and lister for +// ProviderNetworks. +type ProviderNetworkInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ProviderNetworkLister +} + +type providerNetworkInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewProviderNetworkInformer constructs a new informer for ProviderNetwork type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewProviderNetworkInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredProviderNetworkInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredProviderNetworkInformer constructs a new informer for ProviderNetwork type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredProviderNetworkInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.KubeovnV1().ProviderNetworks().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.KubeovnV1().ProviderNetworks().Watch(context.TODO(), options) + }, + }, + &kubeovnv1.ProviderNetwork{}, + resyncPeriod, + indexers, + ) +} + +func (f *providerNetworkInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredProviderNetworkInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *providerNetworkInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&kubeovnv1.ProviderNetwork{}, f.defaultInformer) +} + +func (f *providerNetworkInformer) Lister() v1.ProviderNetworkLister { + return v1.NewProviderNetworkLister(f.Informer().GetIndexer()) +} diff --git a/pkg/client/listers/informers/externalversions/kubeovn/v1/securitygroup.go b/pkg/client/listers/informers/externalversions/kubeovn/v1/securitygroup.go new file mode 100644 index 00000000000..fc108011aa5 --- /dev/null +++ b/pkg/client/listers/informers/externalversions/kubeovn/v1/securitygroup.go @@ -0,0 +1,89 @@ +/* +Copyright 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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + time "time" + + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + versioned "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned" + internalinterfaces "github.com/kubeovn/kube-ovn/pkg/client/informers/externalversions/internalinterfaces" + v1 "github.com/kubeovn/kube-ovn/pkg/client/listers/kubeovn/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// SecurityGroupInformer provides access to a shared informer and lister for +// SecurityGroups. +type SecurityGroupInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.SecurityGroupLister +} + +type securityGroupInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewSecurityGroupInformer constructs a new informer for SecurityGroup type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewSecurityGroupInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredSecurityGroupInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredSecurityGroupInformer constructs a new informer for SecurityGroup type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredSecurityGroupInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.KubeovnV1().SecurityGroups().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.KubeovnV1().SecurityGroups().Watch(context.TODO(), options) + }, + }, + &kubeovnv1.SecurityGroup{}, + resyncPeriod, + indexers, + ) +} + +func (f *securityGroupInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredSecurityGroupInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *securityGroupInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&kubeovnv1.SecurityGroup{}, f.defaultInformer) +} + +func (f *securityGroupInformer) Lister() v1.SecurityGroupLister { + return v1.NewSecurityGroupLister(f.Informer().GetIndexer()) +} diff --git a/pkg/client/listers/informers/externalversions/kubeovn/v1/subnet.go b/pkg/client/listers/informers/externalversions/kubeovn/v1/subnet.go new file mode 100644 index 00000000000..8a185ef0d55 --- /dev/null +++ b/pkg/client/listers/informers/externalversions/kubeovn/v1/subnet.go @@ -0,0 +1,89 @@ +/* +Copyright 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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + time "time" + + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + versioned "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned" + internalinterfaces "github.com/kubeovn/kube-ovn/pkg/client/informers/externalversions/internalinterfaces" + v1 "github.com/kubeovn/kube-ovn/pkg/client/listers/kubeovn/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// SubnetInformer provides access to a shared informer and lister for +// Subnets. +type SubnetInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.SubnetLister +} + +type subnetInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewSubnetInformer constructs a new informer for Subnet type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewSubnetInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredSubnetInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredSubnetInformer constructs a new informer for Subnet type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredSubnetInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.KubeovnV1().Subnets().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.KubeovnV1().Subnets().Watch(context.TODO(), options) + }, + }, + &kubeovnv1.Subnet{}, + resyncPeriod, + indexers, + ) +} + +func (f *subnetInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredSubnetInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *subnetInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&kubeovnv1.Subnet{}, f.defaultInformer) +} + +func (f *subnetInformer) Lister() v1.SubnetLister { + return v1.NewSubnetLister(f.Informer().GetIndexer()) +} diff --git a/pkg/client/listers/informers/externalversions/kubeovn/v1/switchlbrule.go b/pkg/client/listers/informers/externalversions/kubeovn/v1/switchlbrule.go new file mode 100644 index 00000000000..5f2794bb246 --- /dev/null +++ b/pkg/client/listers/informers/externalversions/kubeovn/v1/switchlbrule.go @@ -0,0 +1,89 @@ +/* +Copyright 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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + time "time" + + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + versioned "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned" + internalinterfaces "github.com/kubeovn/kube-ovn/pkg/client/informers/externalversions/internalinterfaces" + v1 "github.com/kubeovn/kube-ovn/pkg/client/listers/kubeovn/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// SwitchLBRuleInformer provides access to a shared informer and lister for +// SwitchLBRules. +type SwitchLBRuleInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.SwitchLBRuleLister +} + +type switchLBRuleInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewSwitchLBRuleInformer constructs a new informer for SwitchLBRule type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewSwitchLBRuleInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredSwitchLBRuleInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredSwitchLBRuleInformer constructs a new informer for SwitchLBRule type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredSwitchLBRuleInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.KubeovnV1().SwitchLBRules().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.KubeovnV1().SwitchLBRules().Watch(context.TODO(), options) + }, + }, + &kubeovnv1.SwitchLBRule{}, + resyncPeriod, + indexers, + ) +} + +func (f *switchLBRuleInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredSwitchLBRuleInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *switchLBRuleInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&kubeovnv1.SwitchLBRule{}, f.defaultInformer) +} + +func (f *switchLBRuleInformer) Lister() v1.SwitchLBRuleLister { + return v1.NewSwitchLBRuleLister(f.Informer().GetIndexer()) +} diff --git a/pkg/client/listers/informers/externalversions/kubeovn/v1/vip.go b/pkg/client/listers/informers/externalversions/kubeovn/v1/vip.go new file mode 100644 index 00000000000..30932f68f31 --- /dev/null +++ b/pkg/client/listers/informers/externalversions/kubeovn/v1/vip.go @@ -0,0 +1,89 @@ +/* +Copyright 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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + time "time" + + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + versioned "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned" + internalinterfaces "github.com/kubeovn/kube-ovn/pkg/client/informers/externalversions/internalinterfaces" + v1 "github.com/kubeovn/kube-ovn/pkg/client/listers/kubeovn/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// VipInformer provides access to a shared informer and lister for +// Vips. +type VipInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.VipLister +} + +type vipInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewVipInformer constructs a new informer for Vip type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewVipInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredVipInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredVipInformer constructs a new informer for Vip type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredVipInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.KubeovnV1().Vips().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.KubeovnV1().Vips().Watch(context.TODO(), options) + }, + }, + &kubeovnv1.Vip{}, + resyncPeriod, + indexers, + ) +} + +func (f *vipInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredVipInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *vipInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&kubeovnv1.Vip{}, f.defaultInformer) +} + +func (f *vipInformer) Lister() v1.VipLister { + return v1.NewVipLister(f.Informer().GetIndexer()) +} diff --git a/pkg/client/listers/informers/externalversions/kubeovn/v1/vlan.go b/pkg/client/listers/informers/externalversions/kubeovn/v1/vlan.go new file mode 100644 index 00000000000..498bfa28f88 --- /dev/null +++ b/pkg/client/listers/informers/externalversions/kubeovn/v1/vlan.go @@ -0,0 +1,89 @@ +/* +Copyright 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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + time "time" + + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + versioned "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned" + internalinterfaces "github.com/kubeovn/kube-ovn/pkg/client/informers/externalversions/internalinterfaces" + v1 "github.com/kubeovn/kube-ovn/pkg/client/listers/kubeovn/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// VlanInformer provides access to a shared informer and lister for +// Vlans. +type VlanInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.VlanLister +} + +type vlanInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewVlanInformer constructs a new informer for Vlan type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewVlanInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredVlanInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredVlanInformer constructs a new informer for Vlan type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredVlanInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.KubeovnV1().Vlans().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.KubeovnV1().Vlans().Watch(context.TODO(), options) + }, + }, + &kubeovnv1.Vlan{}, + resyncPeriod, + indexers, + ) +} + +func (f *vlanInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredVlanInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *vlanInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&kubeovnv1.Vlan{}, f.defaultInformer) +} + +func (f *vlanInformer) Lister() v1.VlanLister { + return v1.NewVlanLister(f.Informer().GetIndexer()) +} diff --git a/pkg/client/listers/informers/externalversions/kubeovn/v1/vpc.go b/pkg/client/listers/informers/externalversions/kubeovn/v1/vpc.go new file mode 100644 index 00000000000..029578d4e7c --- /dev/null +++ b/pkg/client/listers/informers/externalversions/kubeovn/v1/vpc.go @@ -0,0 +1,89 @@ +/* +Copyright 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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + time "time" + + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + versioned "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned" + internalinterfaces "github.com/kubeovn/kube-ovn/pkg/client/informers/externalversions/internalinterfaces" + v1 "github.com/kubeovn/kube-ovn/pkg/client/listers/kubeovn/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// VpcInformer provides access to a shared informer and lister for +// Vpcs. +type VpcInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.VpcLister +} + +type vpcInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewVpcInformer constructs a new informer for Vpc type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewVpcInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredVpcInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredVpcInformer constructs a new informer for Vpc type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredVpcInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.KubeovnV1().Vpcs().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.KubeovnV1().Vpcs().Watch(context.TODO(), options) + }, + }, + &kubeovnv1.Vpc{}, + resyncPeriod, + indexers, + ) +} + +func (f *vpcInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredVpcInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *vpcInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&kubeovnv1.Vpc{}, f.defaultInformer) +} + +func (f *vpcInformer) Lister() v1.VpcLister { + return v1.NewVpcLister(f.Informer().GetIndexer()) +} diff --git a/pkg/client/listers/informers/externalversions/kubeovn/v1/vpcdns.go b/pkg/client/listers/informers/externalversions/kubeovn/v1/vpcdns.go new file mode 100644 index 00000000000..57ec5af21e5 --- /dev/null +++ b/pkg/client/listers/informers/externalversions/kubeovn/v1/vpcdns.go @@ -0,0 +1,89 @@ +/* +Copyright 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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + time "time" + + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + versioned "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned" + internalinterfaces "github.com/kubeovn/kube-ovn/pkg/client/informers/externalversions/internalinterfaces" + v1 "github.com/kubeovn/kube-ovn/pkg/client/listers/kubeovn/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// VpcDnsInformer provides access to a shared informer and lister for +// VpcDnses. +type VpcDnsInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.VpcDnsLister +} + +type vpcDnsInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewVpcDnsInformer constructs a new informer for VpcDns type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewVpcDnsInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredVpcDnsInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredVpcDnsInformer constructs a new informer for VpcDns type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredVpcDnsInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.KubeovnV1().VpcDnses().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.KubeovnV1().VpcDnses().Watch(context.TODO(), options) + }, + }, + &kubeovnv1.VpcDns{}, + resyncPeriod, + indexers, + ) +} + +func (f *vpcDnsInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredVpcDnsInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *vpcDnsInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&kubeovnv1.VpcDns{}, f.defaultInformer) +} + +func (f *vpcDnsInformer) Lister() v1.VpcDnsLister { + return v1.NewVpcDnsLister(f.Informer().GetIndexer()) +} diff --git a/pkg/client/listers/informers/externalversions/kubeovn/v1/vpcnatgateway.go b/pkg/client/listers/informers/externalversions/kubeovn/v1/vpcnatgateway.go new file mode 100644 index 00000000000..2c9a1639c15 --- /dev/null +++ b/pkg/client/listers/informers/externalversions/kubeovn/v1/vpcnatgateway.go @@ -0,0 +1,89 @@ +/* +Copyright 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 informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + time "time" + + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + versioned "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned" + internalinterfaces "github.com/kubeovn/kube-ovn/pkg/client/informers/externalversions/internalinterfaces" + v1 "github.com/kubeovn/kube-ovn/pkg/client/listers/kubeovn/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// VpcNatGatewayInformer provides access to a shared informer and lister for +// VpcNatGateways. +type VpcNatGatewayInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.VpcNatGatewayLister +} + +type vpcNatGatewayInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewVpcNatGatewayInformer constructs a new informer for VpcNatGateway type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewVpcNatGatewayInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredVpcNatGatewayInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredVpcNatGatewayInformer constructs a new informer for VpcNatGateway type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredVpcNatGatewayInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.KubeovnV1().VpcNatGateways().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.KubeovnV1().VpcNatGateways().Watch(context.TODO(), options) + }, + }, + &kubeovnv1.VpcNatGateway{}, + resyncPeriod, + indexers, + ) +} + +func (f *vpcNatGatewayInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredVpcNatGatewayInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *vpcNatGatewayInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&kubeovnv1.VpcNatGateway{}, f.defaultInformer) +} + +func (f *vpcNatGatewayInformer) Lister() v1.VpcNatGatewayLister { + return v1.NewVpcNatGatewayLister(f.Informer().GetIndexer()) +} diff --git a/pkg/client/listers/listers/kubeovn/v1/expansion_generated.go b/pkg/client/listers/listers/kubeovn/v1/expansion_generated.go new file mode 100644 index 00000000000..2926ee5143d --- /dev/null +++ b/pkg/client/listers/listers/kubeovn/v1/expansion_generated.go @@ -0,0 +1,91 @@ +/* +Copyright 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 lister-gen. DO NOT EDIT. + +package v1 + +// HtbQosListerExpansion allows custom methods to be added to +// HtbQosLister. +type HtbQosListerExpansion interface{} + +// IPListerExpansion allows custom methods to be added to +// IPLister. +type IPListerExpansion interface{} + +// IptablesDnatRuleListerExpansion allows custom methods to be added to +// IptablesDnatRuleLister. +type IptablesDnatRuleListerExpansion interface{} + +// IptablesEIPListerExpansion allows custom methods to be added to +// IptablesEIPLister. +type IptablesEIPListerExpansion interface{} + +// IptablesFIPRuleListerExpansion allows custom methods to be added to +// IptablesFIPRuleLister. +type IptablesFIPRuleListerExpansion interface{} + +// IptablesSnatRuleListerExpansion allows custom methods to be added to +// IptablesSnatRuleLister. +type IptablesSnatRuleListerExpansion interface{} + +// OvnEipListerExpansion allows custom methods to be added to +// OvnEipLister. +type OvnEipListerExpansion interface{} + +// OvnFipListerExpansion allows custom methods to be added to +// OvnFipLister. +type OvnFipListerExpansion interface{} + +// OvnSnatRuleListerExpansion allows custom methods to be added to +// OvnSnatRuleLister. +type OvnSnatRuleListerExpansion interface{} + +// ProviderNetworkListerExpansion allows custom methods to be added to +// ProviderNetworkLister. +type ProviderNetworkListerExpansion interface{} + +// SecurityGroupListerExpansion allows custom methods to be added to +// SecurityGroupLister. +type SecurityGroupListerExpansion interface{} + +// SubnetListerExpansion allows custom methods to be added to +// SubnetLister. +type SubnetListerExpansion interface{} + +// SwitchLBRuleListerExpansion allows custom methods to be added to +// SwitchLBRuleLister. +type SwitchLBRuleListerExpansion interface{} + +// VipListerExpansion allows custom methods to be added to +// VipLister. +type VipListerExpansion interface{} + +// VlanListerExpansion allows custom methods to be added to +// VlanLister. +type VlanListerExpansion interface{} + +// VpcListerExpansion allows custom methods to be added to +// VpcLister. +type VpcListerExpansion interface{} + +// VpcDnsListerExpansion allows custom methods to be added to +// VpcDnsLister. +type VpcDnsListerExpansion interface{} + +// VpcNatGatewayListerExpansion allows custom methods to be added to +// VpcNatGatewayLister. +type VpcNatGatewayListerExpansion interface{} diff --git a/pkg/client/listers/listers/kubeovn/v1/htbqos.go b/pkg/client/listers/listers/kubeovn/v1/htbqos.go new file mode 100644 index 00000000000..c907b54cefc --- /dev/null +++ b/pkg/client/listers/listers/kubeovn/v1/htbqos.go @@ -0,0 +1,65 @@ +/* +Copyright 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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// HtbQosLister helps list HtbQoses. +type HtbQosLister interface { + // List lists all HtbQoses in the indexer. + List(selector labels.Selector) (ret []*v1.HtbQos, err error) + // Get retrieves the HtbQos from the index for a given name. + Get(name string) (*v1.HtbQos, error) + HtbQosListerExpansion +} + +// htbQosLister implements the HtbQosLister interface. +type htbQosLister struct { + indexer cache.Indexer +} + +// NewHtbQosLister returns a new HtbQosLister. +func NewHtbQosLister(indexer cache.Indexer) HtbQosLister { + return &htbQosLister{indexer: indexer} +} + +// List lists all HtbQoses in the indexer. +func (s *htbQosLister) List(selector labels.Selector) (ret []*v1.HtbQos, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.HtbQos)) + }) + return ret, err +} + +// Get retrieves the HtbQos from the index for a given name. +func (s *htbQosLister) Get(name string) (*v1.HtbQos, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("htbqos"), name) + } + return obj.(*v1.HtbQos), nil +} diff --git a/pkg/client/listers/listers/kubeovn/v1/ip.go b/pkg/client/listers/listers/kubeovn/v1/ip.go new file mode 100644 index 00000000000..84a45174b67 --- /dev/null +++ b/pkg/client/listers/listers/kubeovn/v1/ip.go @@ -0,0 +1,65 @@ +/* +Copyright 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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// IPLister helps list IPs. +type IPLister interface { + // List lists all IPs in the indexer. + List(selector labels.Selector) (ret []*v1.IP, err error) + // Get retrieves the IP from the index for a given name. + Get(name string) (*v1.IP, error) + IPListerExpansion +} + +// iPLister implements the IPLister interface. +type iPLister struct { + indexer cache.Indexer +} + +// NewIPLister returns a new IPLister. +func NewIPLister(indexer cache.Indexer) IPLister { + return &iPLister{indexer: indexer} +} + +// List lists all IPs in the indexer. +func (s *iPLister) List(selector labels.Selector) (ret []*v1.IP, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.IP)) + }) + return ret, err +} + +// Get retrieves the IP from the index for a given name. +func (s *iPLister) Get(name string) (*v1.IP, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("ip"), name) + } + return obj.(*v1.IP), nil +} diff --git a/pkg/client/listers/listers/kubeovn/v1/iptablesdnatrule.go b/pkg/client/listers/listers/kubeovn/v1/iptablesdnatrule.go new file mode 100644 index 00000000000..bb0ebe4a7d6 --- /dev/null +++ b/pkg/client/listers/listers/kubeovn/v1/iptablesdnatrule.go @@ -0,0 +1,65 @@ +/* +Copyright 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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// IptablesDnatRuleLister helps list IptablesDnatRules. +type IptablesDnatRuleLister interface { + // List lists all IptablesDnatRules in the indexer. + List(selector labels.Selector) (ret []*v1.IptablesDnatRule, err error) + // Get retrieves the IptablesDnatRule from the index for a given name. + Get(name string) (*v1.IptablesDnatRule, error) + IptablesDnatRuleListerExpansion +} + +// iptablesDnatRuleLister implements the IptablesDnatRuleLister interface. +type iptablesDnatRuleLister struct { + indexer cache.Indexer +} + +// NewIptablesDnatRuleLister returns a new IptablesDnatRuleLister. +func NewIptablesDnatRuleLister(indexer cache.Indexer) IptablesDnatRuleLister { + return &iptablesDnatRuleLister{indexer: indexer} +} + +// List lists all IptablesDnatRules in the indexer. +func (s *iptablesDnatRuleLister) List(selector labels.Selector) (ret []*v1.IptablesDnatRule, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.IptablesDnatRule)) + }) + return ret, err +} + +// Get retrieves the IptablesDnatRule from the index for a given name. +func (s *iptablesDnatRuleLister) Get(name string) (*v1.IptablesDnatRule, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("iptablesdnatrule"), name) + } + return obj.(*v1.IptablesDnatRule), nil +} diff --git a/pkg/client/listers/listers/kubeovn/v1/iptableseip.go b/pkg/client/listers/listers/kubeovn/v1/iptableseip.go new file mode 100644 index 00000000000..9574d92cebd --- /dev/null +++ b/pkg/client/listers/listers/kubeovn/v1/iptableseip.go @@ -0,0 +1,65 @@ +/* +Copyright 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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// IptablesEIPLister helps list IptablesEIPs. +type IptablesEIPLister interface { + // List lists all IptablesEIPs in the indexer. + List(selector labels.Selector) (ret []*v1.IptablesEIP, err error) + // Get retrieves the IptablesEIP from the index for a given name. + Get(name string) (*v1.IptablesEIP, error) + IptablesEIPListerExpansion +} + +// iptablesEIPLister implements the IptablesEIPLister interface. +type iptablesEIPLister struct { + indexer cache.Indexer +} + +// NewIptablesEIPLister returns a new IptablesEIPLister. +func NewIptablesEIPLister(indexer cache.Indexer) IptablesEIPLister { + return &iptablesEIPLister{indexer: indexer} +} + +// List lists all IptablesEIPs in the indexer. +func (s *iptablesEIPLister) List(selector labels.Selector) (ret []*v1.IptablesEIP, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.IptablesEIP)) + }) + return ret, err +} + +// Get retrieves the IptablesEIP from the index for a given name. +func (s *iptablesEIPLister) Get(name string) (*v1.IptablesEIP, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("iptableseip"), name) + } + return obj.(*v1.IptablesEIP), nil +} diff --git a/pkg/client/listers/listers/kubeovn/v1/iptablesfiprule.go b/pkg/client/listers/listers/kubeovn/v1/iptablesfiprule.go new file mode 100644 index 00000000000..056b71eca35 --- /dev/null +++ b/pkg/client/listers/listers/kubeovn/v1/iptablesfiprule.go @@ -0,0 +1,65 @@ +/* +Copyright 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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// IptablesFIPRuleLister helps list IptablesFIPRules. +type IptablesFIPRuleLister interface { + // List lists all IptablesFIPRules in the indexer. + List(selector labels.Selector) (ret []*v1.IptablesFIPRule, err error) + // Get retrieves the IptablesFIPRule from the index for a given name. + Get(name string) (*v1.IptablesFIPRule, error) + IptablesFIPRuleListerExpansion +} + +// iptablesFIPRuleLister implements the IptablesFIPRuleLister interface. +type iptablesFIPRuleLister struct { + indexer cache.Indexer +} + +// NewIptablesFIPRuleLister returns a new IptablesFIPRuleLister. +func NewIptablesFIPRuleLister(indexer cache.Indexer) IptablesFIPRuleLister { + return &iptablesFIPRuleLister{indexer: indexer} +} + +// List lists all IptablesFIPRules in the indexer. +func (s *iptablesFIPRuleLister) List(selector labels.Selector) (ret []*v1.IptablesFIPRule, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.IptablesFIPRule)) + }) + return ret, err +} + +// Get retrieves the IptablesFIPRule from the index for a given name. +func (s *iptablesFIPRuleLister) Get(name string) (*v1.IptablesFIPRule, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("iptablesfiprule"), name) + } + return obj.(*v1.IptablesFIPRule), nil +} diff --git a/pkg/client/listers/listers/kubeovn/v1/iptablessnatrule.go b/pkg/client/listers/listers/kubeovn/v1/iptablessnatrule.go new file mode 100644 index 00000000000..7e5524a35fc --- /dev/null +++ b/pkg/client/listers/listers/kubeovn/v1/iptablessnatrule.go @@ -0,0 +1,65 @@ +/* +Copyright 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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// IptablesSnatRuleLister helps list IptablesSnatRules. +type IptablesSnatRuleLister interface { + // List lists all IptablesSnatRules in the indexer. + List(selector labels.Selector) (ret []*v1.IptablesSnatRule, err error) + // Get retrieves the IptablesSnatRule from the index for a given name. + Get(name string) (*v1.IptablesSnatRule, error) + IptablesSnatRuleListerExpansion +} + +// iptablesSnatRuleLister implements the IptablesSnatRuleLister interface. +type iptablesSnatRuleLister struct { + indexer cache.Indexer +} + +// NewIptablesSnatRuleLister returns a new IptablesSnatRuleLister. +func NewIptablesSnatRuleLister(indexer cache.Indexer) IptablesSnatRuleLister { + return &iptablesSnatRuleLister{indexer: indexer} +} + +// List lists all IptablesSnatRules in the indexer. +func (s *iptablesSnatRuleLister) List(selector labels.Selector) (ret []*v1.IptablesSnatRule, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.IptablesSnatRule)) + }) + return ret, err +} + +// Get retrieves the IptablesSnatRule from the index for a given name. +func (s *iptablesSnatRuleLister) Get(name string) (*v1.IptablesSnatRule, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("iptablessnatrule"), name) + } + return obj.(*v1.IptablesSnatRule), nil +} diff --git a/pkg/client/listers/listers/kubeovn/v1/ovneip.go b/pkg/client/listers/listers/kubeovn/v1/ovneip.go new file mode 100644 index 00000000000..6983c0f010a --- /dev/null +++ b/pkg/client/listers/listers/kubeovn/v1/ovneip.go @@ -0,0 +1,65 @@ +/* +Copyright 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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// OvnEipLister helps list OvnEips. +type OvnEipLister interface { + // List lists all OvnEips in the indexer. + List(selector labels.Selector) (ret []*v1.OvnEip, err error) + // Get retrieves the OvnEip from the index for a given name. + Get(name string) (*v1.OvnEip, error) + OvnEipListerExpansion +} + +// ovnEipLister implements the OvnEipLister interface. +type ovnEipLister struct { + indexer cache.Indexer +} + +// NewOvnEipLister returns a new OvnEipLister. +func NewOvnEipLister(indexer cache.Indexer) OvnEipLister { + return &ovnEipLister{indexer: indexer} +} + +// List lists all OvnEips in the indexer. +func (s *ovnEipLister) List(selector labels.Selector) (ret []*v1.OvnEip, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.OvnEip)) + }) + return ret, err +} + +// Get retrieves the OvnEip from the index for a given name. +func (s *ovnEipLister) Get(name string) (*v1.OvnEip, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("ovneip"), name) + } + return obj.(*v1.OvnEip), nil +} diff --git a/pkg/client/listers/listers/kubeovn/v1/ovnfip.go b/pkg/client/listers/listers/kubeovn/v1/ovnfip.go new file mode 100644 index 00000000000..fdd3fe0aa4f --- /dev/null +++ b/pkg/client/listers/listers/kubeovn/v1/ovnfip.go @@ -0,0 +1,65 @@ +/* +Copyright 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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// OvnFipLister helps list OvnFips. +type OvnFipLister interface { + // List lists all OvnFips in the indexer. + List(selector labels.Selector) (ret []*v1.OvnFip, err error) + // Get retrieves the OvnFip from the index for a given name. + Get(name string) (*v1.OvnFip, error) + OvnFipListerExpansion +} + +// ovnFipLister implements the OvnFipLister interface. +type ovnFipLister struct { + indexer cache.Indexer +} + +// NewOvnFipLister returns a new OvnFipLister. +func NewOvnFipLister(indexer cache.Indexer) OvnFipLister { + return &ovnFipLister{indexer: indexer} +} + +// List lists all OvnFips in the indexer. +func (s *ovnFipLister) List(selector labels.Selector) (ret []*v1.OvnFip, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.OvnFip)) + }) + return ret, err +} + +// Get retrieves the OvnFip from the index for a given name. +func (s *ovnFipLister) Get(name string) (*v1.OvnFip, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("ovnfip"), name) + } + return obj.(*v1.OvnFip), nil +} diff --git a/pkg/client/listers/listers/kubeovn/v1/ovnsnatrule.go b/pkg/client/listers/listers/kubeovn/v1/ovnsnatrule.go new file mode 100644 index 00000000000..ae3ce8488f7 --- /dev/null +++ b/pkg/client/listers/listers/kubeovn/v1/ovnsnatrule.go @@ -0,0 +1,65 @@ +/* +Copyright 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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// OvnSnatRuleLister helps list OvnSnatRules. +type OvnSnatRuleLister interface { + // List lists all OvnSnatRules in the indexer. + List(selector labels.Selector) (ret []*v1.OvnSnatRule, err error) + // Get retrieves the OvnSnatRule from the index for a given name. + Get(name string) (*v1.OvnSnatRule, error) + OvnSnatRuleListerExpansion +} + +// ovnSnatRuleLister implements the OvnSnatRuleLister interface. +type ovnSnatRuleLister struct { + indexer cache.Indexer +} + +// NewOvnSnatRuleLister returns a new OvnSnatRuleLister. +func NewOvnSnatRuleLister(indexer cache.Indexer) OvnSnatRuleLister { + return &ovnSnatRuleLister{indexer: indexer} +} + +// List lists all OvnSnatRules in the indexer. +func (s *ovnSnatRuleLister) List(selector labels.Selector) (ret []*v1.OvnSnatRule, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.OvnSnatRule)) + }) + return ret, err +} + +// Get retrieves the OvnSnatRule from the index for a given name. +func (s *ovnSnatRuleLister) Get(name string) (*v1.OvnSnatRule, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("ovnsnatrule"), name) + } + return obj.(*v1.OvnSnatRule), nil +} diff --git a/pkg/client/listers/listers/kubeovn/v1/providernetwork.go b/pkg/client/listers/listers/kubeovn/v1/providernetwork.go new file mode 100644 index 00000000000..463f960470d --- /dev/null +++ b/pkg/client/listers/listers/kubeovn/v1/providernetwork.go @@ -0,0 +1,65 @@ +/* +Copyright 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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ProviderNetworkLister helps list ProviderNetworks. +type ProviderNetworkLister interface { + // List lists all ProviderNetworks in the indexer. + List(selector labels.Selector) (ret []*v1.ProviderNetwork, err error) + // Get retrieves the ProviderNetwork from the index for a given name. + Get(name string) (*v1.ProviderNetwork, error) + ProviderNetworkListerExpansion +} + +// providerNetworkLister implements the ProviderNetworkLister interface. +type providerNetworkLister struct { + indexer cache.Indexer +} + +// NewProviderNetworkLister returns a new ProviderNetworkLister. +func NewProviderNetworkLister(indexer cache.Indexer) ProviderNetworkLister { + return &providerNetworkLister{indexer: indexer} +} + +// List lists all ProviderNetworks in the indexer. +func (s *providerNetworkLister) List(selector labels.Selector) (ret []*v1.ProviderNetwork, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ProviderNetwork)) + }) + return ret, err +} + +// Get retrieves the ProviderNetwork from the index for a given name. +func (s *providerNetworkLister) Get(name string) (*v1.ProviderNetwork, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("providernetwork"), name) + } + return obj.(*v1.ProviderNetwork), nil +} diff --git a/pkg/client/listers/listers/kubeovn/v1/securitygroup.go b/pkg/client/listers/listers/kubeovn/v1/securitygroup.go new file mode 100644 index 00000000000..b4c8ace93a1 --- /dev/null +++ b/pkg/client/listers/listers/kubeovn/v1/securitygroup.go @@ -0,0 +1,65 @@ +/* +Copyright 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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// SecurityGroupLister helps list SecurityGroups. +type SecurityGroupLister interface { + // List lists all SecurityGroups in the indexer. + List(selector labels.Selector) (ret []*v1.SecurityGroup, err error) + // Get retrieves the SecurityGroup from the index for a given name. + Get(name string) (*v1.SecurityGroup, error) + SecurityGroupListerExpansion +} + +// securityGroupLister implements the SecurityGroupLister interface. +type securityGroupLister struct { + indexer cache.Indexer +} + +// NewSecurityGroupLister returns a new SecurityGroupLister. +func NewSecurityGroupLister(indexer cache.Indexer) SecurityGroupLister { + return &securityGroupLister{indexer: indexer} +} + +// List lists all SecurityGroups in the indexer. +func (s *securityGroupLister) List(selector labels.Selector) (ret []*v1.SecurityGroup, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.SecurityGroup)) + }) + return ret, err +} + +// Get retrieves the SecurityGroup from the index for a given name. +func (s *securityGroupLister) Get(name string) (*v1.SecurityGroup, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("securitygroup"), name) + } + return obj.(*v1.SecurityGroup), nil +} diff --git a/pkg/client/listers/listers/kubeovn/v1/subnet.go b/pkg/client/listers/listers/kubeovn/v1/subnet.go new file mode 100644 index 00000000000..01312c23e3a --- /dev/null +++ b/pkg/client/listers/listers/kubeovn/v1/subnet.go @@ -0,0 +1,65 @@ +/* +Copyright 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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// SubnetLister helps list Subnets. +type SubnetLister interface { + // List lists all Subnets in the indexer. + List(selector labels.Selector) (ret []*v1.Subnet, err error) + // Get retrieves the Subnet from the index for a given name. + Get(name string) (*v1.Subnet, error) + SubnetListerExpansion +} + +// subnetLister implements the SubnetLister interface. +type subnetLister struct { + indexer cache.Indexer +} + +// NewSubnetLister returns a new SubnetLister. +func NewSubnetLister(indexer cache.Indexer) SubnetLister { + return &subnetLister{indexer: indexer} +} + +// List lists all Subnets in the indexer. +func (s *subnetLister) List(selector labels.Selector) (ret []*v1.Subnet, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.Subnet)) + }) + return ret, err +} + +// Get retrieves the Subnet from the index for a given name. +func (s *subnetLister) Get(name string) (*v1.Subnet, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("subnet"), name) + } + return obj.(*v1.Subnet), nil +} diff --git a/pkg/client/listers/listers/kubeovn/v1/switchlbrule.go b/pkg/client/listers/listers/kubeovn/v1/switchlbrule.go new file mode 100644 index 00000000000..4061f043666 --- /dev/null +++ b/pkg/client/listers/listers/kubeovn/v1/switchlbrule.go @@ -0,0 +1,65 @@ +/* +Copyright 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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// SwitchLBRuleLister helps list SwitchLBRules. +type SwitchLBRuleLister interface { + // List lists all SwitchLBRules in the indexer. + List(selector labels.Selector) (ret []*v1.SwitchLBRule, err error) + // Get retrieves the SwitchLBRule from the index for a given name. + Get(name string) (*v1.SwitchLBRule, error) + SwitchLBRuleListerExpansion +} + +// switchLBRuleLister implements the SwitchLBRuleLister interface. +type switchLBRuleLister struct { + indexer cache.Indexer +} + +// NewSwitchLBRuleLister returns a new SwitchLBRuleLister. +func NewSwitchLBRuleLister(indexer cache.Indexer) SwitchLBRuleLister { + return &switchLBRuleLister{indexer: indexer} +} + +// List lists all SwitchLBRules in the indexer. +func (s *switchLBRuleLister) List(selector labels.Selector) (ret []*v1.SwitchLBRule, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.SwitchLBRule)) + }) + return ret, err +} + +// Get retrieves the SwitchLBRule from the index for a given name. +func (s *switchLBRuleLister) Get(name string) (*v1.SwitchLBRule, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("switchlbrule"), name) + } + return obj.(*v1.SwitchLBRule), nil +} diff --git a/pkg/client/listers/listers/kubeovn/v1/vip.go b/pkg/client/listers/listers/kubeovn/v1/vip.go new file mode 100644 index 00000000000..3aa7151be03 --- /dev/null +++ b/pkg/client/listers/listers/kubeovn/v1/vip.go @@ -0,0 +1,65 @@ +/* +Copyright 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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// VipLister helps list Vips. +type VipLister interface { + // List lists all Vips in the indexer. + List(selector labels.Selector) (ret []*v1.Vip, err error) + // Get retrieves the Vip from the index for a given name. + Get(name string) (*v1.Vip, error) + VipListerExpansion +} + +// vipLister implements the VipLister interface. +type vipLister struct { + indexer cache.Indexer +} + +// NewVipLister returns a new VipLister. +func NewVipLister(indexer cache.Indexer) VipLister { + return &vipLister{indexer: indexer} +} + +// List lists all Vips in the indexer. +func (s *vipLister) List(selector labels.Selector) (ret []*v1.Vip, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.Vip)) + }) + return ret, err +} + +// Get retrieves the Vip from the index for a given name. +func (s *vipLister) Get(name string) (*v1.Vip, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("vip"), name) + } + return obj.(*v1.Vip), nil +} diff --git a/pkg/client/listers/listers/kubeovn/v1/vlan.go b/pkg/client/listers/listers/kubeovn/v1/vlan.go new file mode 100644 index 00000000000..74fffd6a101 --- /dev/null +++ b/pkg/client/listers/listers/kubeovn/v1/vlan.go @@ -0,0 +1,65 @@ +/* +Copyright 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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// VlanLister helps list Vlans. +type VlanLister interface { + // List lists all Vlans in the indexer. + List(selector labels.Selector) (ret []*v1.Vlan, err error) + // Get retrieves the Vlan from the index for a given name. + Get(name string) (*v1.Vlan, error) + VlanListerExpansion +} + +// vlanLister implements the VlanLister interface. +type vlanLister struct { + indexer cache.Indexer +} + +// NewVlanLister returns a new VlanLister. +func NewVlanLister(indexer cache.Indexer) VlanLister { + return &vlanLister{indexer: indexer} +} + +// List lists all Vlans in the indexer. +func (s *vlanLister) List(selector labels.Selector) (ret []*v1.Vlan, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.Vlan)) + }) + return ret, err +} + +// Get retrieves the Vlan from the index for a given name. +func (s *vlanLister) Get(name string) (*v1.Vlan, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("vlan"), name) + } + return obj.(*v1.Vlan), nil +} diff --git a/pkg/client/listers/listers/kubeovn/v1/vpc.go b/pkg/client/listers/listers/kubeovn/v1/vpc.go new file mode 100644 index 00000000000..522a99e775e --- /dev/null +++ b/pkg/client/listers/listers/kubeovn/v1/vpc.go @@ -0,0 +1,65 @@ +/* +Copyright 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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// VpcLister helps list Vpcs. +type VpcLister interface { + // List lists all Vpcs in the indexer. + List(selector labels.Selector) (ret []*v1.Vpc, err error) + // Get retrieves the Vpc from the index for a given name. + Get(name string) (*v1.Vpc, error) + VpcListerExpansion +} + +// vpcLister implements the VpcLister interface. +type vpcLister struct { + indexer cache.Indexer +} + +// NewVpcLister returns a new VpcLister. +func NewVpcLister(indexer cache.Indexer) VpcLister { + return &vpcLister{indexer: indexer} +} + +// List lists all Vpcs in the indexer. +func (s *vpcLister) List(selector labels.Selector) (ret []*v1.Vpc, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.Vpc)) + }) + return ret, err +} + +// Get retrieves the Vpc from the index for a given name. +func (s *vpcLister) Get(name string) (*v1.Vpc, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("vpc"), name) + } + return obj.(*v1.Vpc), nil +} diff --git a/pkg/client/listers/listers/kubeovn/v1/vpcdns.go b/pkg/client/listers/listers/kubeovn/v1/vpcdns.go new file mode 100644 index 00000000000..93e5f650bff --- /dev/null +++ b/pkg/client/listers/listers/kubeovn/v1/vpcdns.go @@ -0,0 +1,65 @@ +/* +Copyright 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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// VpcDnsLister helps list VpcDnses. +type VpcDnsLister interface { + // List lists all VpcDnses in the indexer. + List(selector labels.Selector) (ret []*v1.VpcDns, err error) + // Get retrieves the VpcDns from the index for a given name. + Get(name string) (*v1.VpcDns, error) + VpcDnsListerExpansion +} + +// vpcDnsLister implements the VpcDnsLister interface. +type vpcDnsLister struct { + indexer cache.Indexer +} + +// NewVpcDnsLister returns a new VpcDnsLister. +func NewVpcDnsLister(indexer cache.Indexer) VpcDnsLister { + return &vpcDnsLister{indexer: indexer} +} + +// List lists all VpcDnses in the indexer. +func (s *vpcDnsLister) List(selector labels.Selector) (ret []*v1.VpcDns, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.VpcDns)) + }) + return ret, err +} + +// Get retrieves the VpcDns from the index for a given name. +func (s *vpcDnsLister) Get(name string) (*v1.VpcDns, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("vpcdns"), name) + } + return obj.(*v1.VpcDns), nil +} diff --git a/pkg/client/listers/listers/kubeovn/v1/vpcnatgateway.go b/pkg/client/listers/listers/kubeovn/v1/vpcnatgateway.go new file mode 100644 index 00000000000..2b2bcbc9654 --- /dev/null +++ b/pkg/client/listers/listers/kubeovn/v1/vpcnatgateway.go @@ -0,0 +1,65 @@ +/* +Copyright 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 lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// VpcNatGatewayLister helps list VpcNatGateways. +type VpcNatGatewayLister interface { + // List lists all VpcNatGateways in the indexer. + List(selector labels.Selector) (ret []*v1.VpcNatGateway, err error) + // Get retrieves the VpcNatGateway from the index for a given name. + Get(name string) (*v1.VpcNatGateway, error) + VpcNatGatewayListerExpansion +} + +// vpcNatGatewayLister implements the VpcNatGatewayLister interface. +type vpcNatGatewayLister struct { + indexer cache.Indexer +} + +// NewVpcNatGatewayLister returns a new VpcNatGatewayLister. +func NewVpcNatGatewayLister(indexer cache.Indexer) VpcNatGatewayLister { + return &vpcNatGatewayLister{indexer: indexer} +} + +// List lists all VpcNatGateways in the indexer. +func (s *vpcNatGatewayLister) List(selector labels.Selector) (ret []*v1.VpcNatGateway, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.VpcNatGateway)) + }) + return ret, err +} + +// Get retrieves the VpcNatGateway from the index for a given name. +func (s *vpcNatGatewayLister) Get(name string) (*v1.VpcNatGateway, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("vpcnatgateway"), name) + } + return obj.(*v1.VpcNatGateway), nil +} diff --git a/pkg/controller/controller.go b/pkg/controller/controller.go index 4524b5ccef7..adf13414ab7 100644 --- a/pkg/controller/controller.go +++ b/pkg/controller/controller.go @@ -83,9 +83,8 @@ type Controller struct { vlansLister kubeovnlister.VlanLister vlanSynced cache.InformerSynced - providerNetworksLister kubeovnlister.ProviderNetworkLister - providerNetworkSynced cache.InformerSynced - updateProviderNetworkQueue workqueue.RateLimitingInterface + providerNetworksLister kubeovnlister.ProviderNetworkLister + providerNetworkSynced cache.InformerSynced addVlanQueue workqueue.RateLimitingInterface delVlanQueue workqueue.RateLimitingInterface @@ -211,9 +210,8 @@ func NewController(config *Configuration) *Controller { delVlanQueue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "DelVlan"), updateVlanQueue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "UpdateVlan"), - providerNetworksLister: providerNetworkInformer.Lister(), - providerNetworkSynced: providerNetworkInformer.Informer().HasSynced, - updateProviderNetworkQueue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "UpdateProviderNetwork"), + providerNetworksLister: providerNetworkInformer.Lister(), + providerNetworkSynced: providerNetworkInformer.Informer().HasSynced, podsLister: podInformer.Lister(), podsSynced: podInformer.Informer().HasSynced, @@ -323,10 +321,6 @@ func NewController(config *Configuration) *Controller { UpdateFunc: controller.enqueueUpdateVlan, }) - providerNetworkInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{ - UpdateFunc: controller.enqueueUpdateProviderNetwork, - }) - if config.EnableNP { npInformer := informerFactory.Networking().V1().NetworkPolicies() controller.npsLister = npInformer.Lister() @@ -457,8 +451,6 @@ func (c *Controller) shutdown() { c.delVlanQueue.ShutDown() c.updateVlanQueue.ShutDown() - c.updateProviderNetworkQueue.ShutDown() - c.addOrUpdateVpcQueue.ShutDown() c.updateVpcStatusQueue.ShutDown() c.delVpcQueue.ShutDown() @@ -543,7 +535,6 @@ func (c *Controller) startWorkers(stopCh <-chan struct{}) { go wait.Until(c.runDelVpcWorker, time.Second, stopCh) go wait.Until(c.runUpdateVpcStatusWorker, time.Second, stopCh) - go wait.Until(c.runUpdateProviderNetworkWorker, time.Second, stopCh) if c.config.EnableLb { // run in a single worker to avoid delete the last vip, which will lead ovn to delete the loadbalancer diff --git a/pkg/controller/provider-network.go b/pkg/controller/provider-network.go index cf88ec688fc..b64359c99b2 100644 --- a/pkg/controller/provider-network.go +++ b/pkg/controller/provider-network.go @@ -4,126 +4,73 @@ import ( "context" "fmt" - corev1 "k8s.io/api/core/v1" - k8serrors "k8s.io/apimachinery/pkg/api/errors" + "github.com/kubeovn/kube-ovn/pkg/util" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/client-go/tools/cache" "k8s.io/klog/v2" - - kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" - "github.com/kubeovn/kube-ovn/pkg/util" ) -func (c *Controller) enqueueUpdateProviderNetwork(_, obj interface{}) { - if !c.isLeader() { - return - } - - key, err := cache.MetaNamespaceKeyFunc(obj) +func (c *Controller) resyncProviderNetworkStatus() { + klog.Infof("start to sync ProviderNetwork status") + pns, err := c.providerNetworksLister.List(labels.Everything()) if err != nil { - utilruntime.HandleError(err) + klog.Errorf("failed to list provider network: %v", err) return } - klog.V(3).Infof("enqueue update provider network %s", key) - c.updateProviderNetworkQueue.Add(key) -} - -func (c *Controller) runUpdateProviderNetworkWorker() { - for c.processNextUpdateProviderNetworkWorkItem() { - } -} - -func (c *Controller) processNextUpdateProviderNetworkWorkItem() bool { - obj, shutdown := c.updateProviderNetworkQueue.Get() - if shutdown { - return false - } - - err := func(obj interface{}) error { - defer c.updateProviderNetworkQueue.Done(obj) - var key string - var ok bool - if key, ok = obj.(string); !ok { - c.updateProviderNetworkQueue.Forget(obj) - utilruntime.HandleError(fmt.Errorf("expected string in workqueue but got %#v", obj)) - return nil - } - if err := c.handleUpdateProviderNetwork(key); err != nil { - c.updateProviderNetworkQueue.AddRateLimited(key) - return fmt.Errorf("error syncing '%s': %s, requeuing", key, err.Error()) - } - c.updateProviderNetworkQueue.Forget(obj) - return nil - }(obj) - - if err != nil { - utilruntime.HandleError(err) - } - - return true -} - -func (c *Controller) handleUpdateProviderNetwork(key string) error { - pn, err := c.providerNetworksLister.Get(key) - if err != nil { - if k8serrors.IsNotFound(err) { - return nil - } - return err - } - nodes, err := c.nodesLister.List(labels.Everything()) if err != nil { klog.Errorf("failed to list nodes: %v", err) - return err + return } - if providerNetworkIsReady(pn, nodes) != pn.Status.Ready { - newPn := pn.DeepCopy() - newPn.Status.Ready = !pn.Status.Ready - _, err = c.config.KubeOvnClient.KubeovnV1().ProviderNetworks().UpdateStatus(context.Background(), newPn, metav1.UpdateOptions{}) - if err != nil { - klog.Errorf("failed to update status of provider network %s: %v", pn.Name, err) - return err + for _, cachedPn := range pns { + pn := cachedPn.DeepCopy() + var readyNodes, notReadyNodes, expectNodes []string + for _, node := range nodes { + if util.ContainsString(pn.Spec.ExcludeNodes, node.Name) { + pn.Status.RemoveNodeConditions(node.Name) + continue + } + if node.Labels[fmt.Sprintf(util.ProviderNetworkReadyTemplate, pn.Name)] == "true" { + pn.Status.SetNodeReady(node.Name, "InitOVSBridgeSucceeded", "") + readyNodes = append(readyNodes, node.Name) + } else { + pods, err := c.config.KubeClient.CoreV1().Pods("").List(context.Background(), metav1.ListOptions{ + LabelSelector: "app=kube-ovn-cni", + FieldSelector: fmt.Sprintf("spec.nodeName=%s", node.Name), + }) + if err != nil { + klog.Errorf("failed to list pod: %v", err) + continue + } + + var errMsg string + if len(pods.Items) == 1 && pods.Items[0].Annotations != nil { + errMsg = pods.Items[0].Annotations[fmt.Sprintf(util.ProviderNetworkErrMessageTemplate, pn.Name)] + } + pn.Status.SetNodeNotReady(node.Name, "InitOVSBridgeFailed", errMsg) + notReadyNodes = append(notReadyNodes, node.Name) + } } - } - return nil -} - -func (c *Controller) resyncProviderNetworkStatus() { - nodeList, err := c.nodesLister.List(labels.Everything()) - if err != nil { - klog.Errorf("failed to get nodes %v", err) - return - } - pnList, err := c.providerNetworksLister.List(labels.Everything()) - if err != nil { - klog.Errorf("failed to get provider networks %v", err) - return - } - - for _, pn := range pnList { - if providerNetworkIsReady(pn, nodeList) != pn.Status.Ready { - newPn := pn.DeepCopy() - newPn.Status.Ready = !newPn.Status.Ready - _, err = c.config.KubeOvnClient.KubeovnV1().ProviderNetworks().UpdateStatus(context.Background(), newPn, metav1.UpdateOptions{}) - if err != nil { - klog.Errorf("failed to update status of provider network %s: %v", pn.Name, err) + expectNodes = append(readyNodes, notReadyNodes...) + conditionsChange := false + for _, c := range pn.Status.Conditions { + if !util.ContainsString(expectNodes, c.Node) { + pn.Status.RemoveNodeConditions(c.Node) + conditionsChange = true } } - } -} -func providerNetworkIsReady(pn *kubeovnv1.ProviderNetwork, nodes []*corev1.Node) bool { - for _, node := range nodes { - if !util.ContainsString(pn.Spec.ExcludeNodes, node.Name) && - !util.ContainsString(pn.Status.ReadyNodes, node.Name) { - return false + if conditionsChange || len(util.DiffStringSlice(pn.Status.ReadyNodes, readyNodes)) != 0 || + len(util.DiffStringSlice(pn.Status.NotReadyNodes, notReadyNodes)) != 0 { + pn.Status.ReadyNodes = readyNodes + pn.Status.NotReadyNodes = notReadyNodes + pn.Status.Ready = (len(notReadyNodes) == 0) + if _, err = c.config.KubeOvnClient.KubeovnV1().ProviderNetworks().UpdateStatus(context.Background(), pn, metav1.UpdateOptions{}); err != nil { + klog.Errorf("failed to update provider network %s: %v", pn.Name, err) + } } } - return true } diff --git a/pkg/daemon/controller.go b/pkg/daemon/controller.go index 70f0de2d94d..105bfc0c037 100644 --- a/pkg/daemon/controller.go +++ b/pkg/daemon/controller.go @@ -70,7 +70,9 @@ type Controller struct { ipsets map[string]*ipsets.IPSets ipsetLock sync.Mutex - protocol string + protocol string + localPodName string + localNamespace string } // NewController init a daemon controller @@ -264,22 +266,13 @@ func (c *Controller) handleAddOrUpdateProviderNetwork(key string) error { } if util.ContainsString(pn.Spec.ExcludeNodes, node.Name) { + c.recordProviderNetworkErr(pn.Name, "") return c.cleanProviderNetwork(pn.DeepCopy(), node.DeepCopy()) } return c.initProviderNetwork(pn.DeepCopy(), node.DeepCopy()) } func (c *Controller) initProviderNetwork(pn *kubeovnv1.ProviderNetwork, node *v1.Node) error { - if pn.Status.EnsureNodeStandardConditions(node.Name) { - var err error - pn, err = c.config.KubeOvnClient.KubeovnV1().ProviderNetworks().UpdateStatus(context.Background(), pn, metav1.UpdateOptions{}) - if err != nil { - klog.Errorf("failed to update status of provider network %s: %v", pn.Name, err) - return err - } - pn = pn.DeepCopy() - } - nic := pn.Spec.DefaultInterface for _, item := range pn.Spec.CustomInterfaces { if util.ContainsString(item.Nodes, node.Name) { @@ -304,26 +297,7 @@ func (c *Controller) initProviderNetwork(pn *kubeovnv1.ProviderNetwork, node *v1 } } } - - pn.Status.SetNodeNotReady(node.Name, "InitOVSBridgeFailed", err.Error()) - if util.ContainsString(pn.Status.ReadyNodes, node.Name) { - pn.Status.ReadyNodes = util.RemoveString(pn.Status.ReadyNodes, node.Name) - } - pn, err1 := c.config.KubeOvnClient.KubeovnV1().ProviderNetworks().UpdateStatus(context.Background(), pn, metav1.UpdateOptions{}) - if err1 != nil { - klog.Errorf("failed to update status of provider network %s: %v", pn.Name, err1) - } - - return err - } - - pn.Status.SetNodeReady(node.Name, "InitOVSBridgeSucceeded", "") - if !util.ContainsString(pn.Status.ReadyNodes, node.Name) { - pn.Status.ReadyNodes = append(pn.Status.ReadyNodes, node.Name) - } - _, err = c.config.KubeOvnClient.KubeovnV1().ProviderNetworks().UpdateStatus(context.Background(), pn, metav1.UpdateOptions{}) - if err != nil { - klog.Errorf("failed to update status of provider network %s: %v", pn.Name, err) + c.recordProviderNetworkErr(pn.Name, err.Error()) return err } @@ -345,31 +319,58 @@ func (c *Controller) initProviderNetwork(pn *kubeovnv1.ProviderNetwork, node *v1 klog.Errorf("failed to patch node %s: %v", node.Name, err) return err } - + c.recordProviderNetworkErr(pn.Name, "") return nil } -func (c *Controller) updateProviderNetworkStatusForNodeDeletion(pn *kubeovnv1.ProviderNetwork, node string) error { - var needUpdate bool - if util.ContainsString(pn.Status.ReadyNodes, node) { - pn.Status.ReadyNodes = util.RemoveString(pn.Status.ReadyNodes, node) - needUpdate = true - } - if pn.Status.RemoveNodeConditions(node) { - needUpdate = true +func (c *Controller) recordProviderNetworkErr(providerNetwork string, errMsg string) { + var currentPod *v1.Pod + var err error + if c.localPodName == "" { + pods, err := c.config.KubeClient.CoreV1().Pods("").List(context.Background(), metav1.ListOptions{ + LabelSelector: "app=kube-ovn-cni", + FieldSelector: fmt.Sprintf("spec.nodeName=%s", c.config.NodeName), + }) + if err != nil { + klog.Errorf("failed to list pod: %v", err) + return + } + for _, pod := range pods.Items { + if pod.Spec.NodeName == c.config.NodeName && pod.Status.Phase == v1.PodRunning { + c.localPodName = pod.Name + c.localNamespace = pod.Namespace + currentPod = &pod + break + } + } + } else { + if currentPod, err = c.config.KubeClient.CoreV1().Pods(c.localNamespace).Get(context.Background(), c.localPodName, metav1.GetOptions{}); err != nil { + klog.Errorf("failed to get pod %s, %v", c.localPodName, err) + return + } } - if !needUpdate { - return nil + newPod := currentPod.DeepCopy() + if newPod.Annotations == nil { + newPod.Annotations = make(map[string]string) } - - _, err := c.config.KubeOvnClient.KubeovnV1().ProviderNetworks().UpdateStatus(context.Background(), pn, metav1.UpdateOptions{}) - if err != nil { - klog.Errorf("failed to update status of provider network %s: %v", pn.Name, err) - return err + if newPod.Annotations[fmt.Sprintf(util.ProviderNetworkErrMessageTemplate, providerNetwork)] != errMsg { + if errMsg == "" { + delete(newPod.Annotations, fmt.Sprintf(util.ProviderNetworkErrMessageTemplate, providerNetwork)) + } else { + newPod.Annotations[fmt.Sprintf(util.ProviderNetworkErrMessageTemplate, providerNetwork)] = errMsg + } + patch, err := util.GenerateStrategicMergePatchPayload(currentPod, newPod) + if err != nil { + klog.Errorf("failed to gen patch payload pod %s: %v", c.localPodName, err) + return + } + if _, err = c.config.KubeClient.CoreV1().Pods(c.localNamespace).Patch(context.Background(), c.localPodName, + types.StrategicMergePatchType, patch, metav1.PatchOptions{}, ""); err != nil { + klog.Errorf("failed to patch pod %s: %v", c.localPodName, err) + return + } } - - return nil } func (c *Controller) cleanProviderNetwork(pn *kubeovnv1.ProviderNetwork, node *v1.Node) error { @@ -380,14 +381,6 @@ func (c *Controller) cleanProviderNetwork(pn *kubeovnv1.ProviderNetwork, node *v } var err error - if pn.Status.RemoveNodeConditions(node.Name) { - pn, err = c.config.KubeOvnClient.KubeovnV1().ProviderNetworks().UpdateStatus(context.Background(), pn, metav1.UpdateOptions{}) - if err != nil { - klog.Errorf("failed to update status of provider network %s: %v", pn.Name, err) - return err - } - } - delete(node.Labels, fmt.Sprintf(util.ProviderNetworkReadyTemplate, pn.Name)) delete(node.Labels, fmt.Sprintf(util.ProviderNetworkInterfaceTemplate, pn.Name)) delete(node.Labels, fmt.Sprintf(util.ProviderNetworkMtuTemplate, pn.Name)) @@ -400,9 +393,6 @@ func (c *Controller) cleanProviderNetwork(pn *kubeovnv1.ProviderNetwork, node *v return err } - if err = c.updateProviderNetworkStatusForNodeDeletion(pn.DeepCopy(), node.Name); err != nil { - return err - } if err = ovsCleanProviderNetwork(pn.Name); err != nil { return err } diff --git a/pkg/util/const.go b/pkg/util/const.go index c63557e7103..3c86a1fef99 100644 --- a/pkg/util/const.go +++ b/pkg/util/const.go @@ -54,14 +54,15 @@ const ( LiveMigrationAnnotationTemplate = "%s.kubernetes.io/allow_live_migration" DefaultRouteAnnotationTemplate = "%s.kubernetes.io/default_route" - ProviderNetworkTemplate = "%s.kubernetes.io/provider_network" - ProviderNetworkReadyTemplate = "%s.provider-network.kubernetes.io/ready" - ProviderNetworkExcludeTemplate = "%s.provider-network.kubernetes.io/exclude" - ProviderNetworkInterfaceTemplate = "%s.provider-network.kubernetes.io/interface" - ProviderNetworkMtuTemplate = "%s.provider-network.kubernetes.io/mtu" - MirrorControlAnnotationTemplate = "%s.kubernetes.io/mirror" - PodNicAnnotationTemplate = "%s.kubernetes.io/pod_nic_type" - VmTemplate = "%s.kubernetes.io/virtualmachine" + ProviderNetworkTemplate = "%s.kubernetes.io/provider_network" + ProviderNetworkErrMessageTemplate = "%s.provider-network.kubernetes.io/err_mesg" + ProviderNetworkReadyTemplate = "%s.provider-network.kubernetes.io/ready" + ProviderNetworkExcludeTemplate = "%s.provider-network.kubernetes.io/exclude" + ProviderNetworkInterfaceTemplate = "%s.provider-network.kubernetes.io/interface" + ProviderNetworkMtuTemplate = "%s.provider-network.kubernetes.io/mtu" + MirrorControlAnnotationTemplate = "%s.kubernetes.io/mirror" + PodNicAnnotationTemplate = "%s.kubernetes.io/pod_nic_type" + VmTemplate = "%s.kubernetes.io/virtualmachine" ExcludeIpsAnnotation = "ovn.kubernetes.io/exclude_ips" diff --git a/yamls/crd.yaml b/yamls/crd.yaml index 3c079677aeb..cc1a7053e6b 100644 --- a/yamls/crd.yaml +++ b/yamls/crd.yaml @@ -344,6 +344,10 @@ spec: type: array items: type: string + notReadyNodes: + type: array + items: + type: string vlans: type: array items: