diff --git a/.gitignore b/.gitignore index 35f10bb4fb7..6c02a74d038 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ kubectl-ko-log.tar.gz kube-apiserver-audit.log kube-apiserver-audit.json kube-ovn.yaml +!/charts/kube-ovn/templates/kube-ovn-crd.yaml kube-ovn-crd.yaml ovn.yaml ovn-ic-controller.yaml diff --git a/charts/kube-ovn/templates/kube-ovn-crd.yaml b/charts/kube-ovn/templates/kube-ovn-crd.yaml index 6f1bbefacb5..cab46f09965 100644 --- a/charts/kube-ovn/templates/kube-ovn-crd.yaml +++ b/charts/kube-ovn/templates/kube-ovn-crd.yaml @@ -876,12 +876,24 @@ spec: storage: true subresources: status: {} + scale: + # specReplicasPath defines the JSONPath inside of a custom resource that corresponds to Scale.Spec.Replicas. + specReplicasPath: .spec.replicas + # statusReplicasPath defines the JSONPath inside of a custom resource that corresponds to Scale.Status.Replicas. + statusReplicasPath: .status.replicas + # labelSelectorPath defines the JSONPath inside of a custom resource that corresponds to Scale.Status.Selector. + labelSelectorPath: .status.labelSelector schema: openAPIV3Schema: type: object properties: status: properties: + replicas: + type: integer + format: int32 + labelSelector: + type: string conditions: items: properties: @@ -978,6 +990,7 @@ spec: properties: replicas: type: integer + format: int32 default: 1 minimum: 1 maximum: 10 @@ -1025,12 +1038,15 @@ spec: default: false minRX: type: integer + format: int32 default: 1000 minTX: type: integer + format: int32 default: 1000 multiplier: type: integer + format: int32 default: 3 policies: type: array diff --git a/dist/images/install.sh b/dist/images/install.sh index 1ebda5655d6..99eebc0fbb8 100755 --- a/dist/images/install.sh +++ b/dist/images/install.sh @@ -1124,12 +1124,24 @@ spec: storage: true subresources: status: {} + scale: + # specReplicasPath defines the JSONPath inside of a custom resource that corresponds to Scale.Spec.Replicas. + specReplicasPath: .spec.replicas + # statusReplicasPath defines the JSONPath inside of a custom resource that corresponds to Scale.Status.Replicas. + statusReplicasPath: .status.replicas + # labelSelectorPath defines the JSONPath inside of a custom resource that corresponds to Scale.Status.Selector. + labelSelectorPath: .status.labelSelector schema: openAPIV3Schema: type: object properties: status: properties: + replicas: + type: integer + format: int32 + labelSelector: + type: string conditions: items: properties: @@ -1223,6 +1235,7 @@ spec: properties: replicas: type: integer + format: int32 default: 1 minimum: 1 maximum: 10 @@ -1270,12 +1283,15 @@ spec: default: false minRX: type: integer + format: int32 default: 1000 minTX: type: integer + format: int32 default: 1000 multiplier: type: integer + format: int32 default: 3 policies: type: array diff --git a/hack/update-codegen-docker.sh b/hack/update-codegen-docker.sh index 2afc1e978e7..abf8d8368ec 100755 --- a/hack/update-codegen-docker.sh +++ b/hack/update-codegen-docker.sh @@ -7,7 +7,7 @@ GOPROXY=${GOPROXY:-"https://goproxy.cn"} docker run -it --rm \ -v ${PWD}:/app \ -e GOPROXY=${GOPROXY} \ - ghcr.io/zhangzujian/kube-code-generator:v0.3.3 \ + ghcr.io/zhangzujian/kube-code-generator:v0.3.4 \ --boilerplate-path ./hack/boilerplate.go.txt \ --apis-in ./pkg/apis \ --go-gen-out ./pkg/client diff --git a/pkg/apis/kubeovn/v1/vpc-egress-gateway.go b/pkg/apis/kubeovn/v1/vpc-egress-gateway.go index b4752dacb99..78146afb2a6 100644 --- a/pkg/apis/kubeovn/v1/vpc-egress-gateway.go +++ b/pkg/apis/kubeovn/v1/vpc-egress-gateway.go @@ -26,6 +26,8 @@ type VpcEgressGatewayList struct { } // +genclient +// +genclient:method=GetScale,verb=get,subresource=scale,result=k8s.io/api/autoscaling/v1.Scale +// +genclient:method=UpdateScale,verb=update,subresource=scale,input=k8s.io/api/autoscaling/v1.Scale,result=k8s.io/api/autoscaling/v1.Scale // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +resourceName=vpc-egress-gateways // vpc egress gateway is used to forward the egress traffic from the VPC to the external network @@ -101,6 +103,10 @@ type VpcEgressGatewayNodeSelector struct { } type VpcEgressGatewayStatus struct { + // used by the scale subresource + Replicas int32 `json:"replicas,omitempty"` + LabelSelector string `json:"labelSelector,omitempty"` + // whether the egress gateway is ready Ready bool `json:"ready"` Phase Phase `json:"phase"` diff --git a/pkg/client/clientset/versioned/clientset.go b/pkg/client/clientset/versioned/clientset.go index 6681321648f..8ffe63ea5c7 100644 --- a/pkg/client/clientset/versioned/clientset.go +++ b/pkg/client/clientset/versioned/clientset.go @@ -19,8 +19,8 @@ limitations under the License. package versioned import ( - "fmt" - "net/http" + fmt "fmt" + http "net/http" kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned/typed/kubeovn/v1" discovery "k8s.io/client-go/discovery" diff --git a/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_ip.go b/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_ip.go index 7c00d8df67d..9b6bf2d974f 100644 --- a/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_ip.go +++ b/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_ip.go @@ -19,108 +19,30 @@ limitations under the License. package fake import ( - "context" - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned/typed/kubeovn/v1" + gentype "k8s.io/client-go/gentype" ) -// FakeIPs implements IPInterface -type FakeIPs struct { +// fakeIPs implements IPInterface +type fakeIPs struct { + *gentype.FakeClientWithList[*v1.IP, *v1.IPList] Fake *FakeKubeovnV1 } -var ipsResource = v1.SchemeGroupVersion.WithResource("ips") - -var ipsKind = v1.SchemeGroupVersion.WithKind("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 metav1.GetOptions) (result *v1.IP, err error) { - emptyResult := &v1.IP{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(ipsResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 metav1.ListOptions) (result *v1.IPList, err error) { - emptyResult := &v1.IPList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(ipsResource, ipsKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.IPList{ListMeta: obj.(*v1.IPList).ListMeta} - for _, item := range obj.(*v1.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 metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(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 *v1.IP, opts metav1.CreateOptions) (result *v1.IP, err error) { - emptyResult := &v1.IP{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(ipsResource, iP, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 *v1.IP, opts metav1.UpdateOptions) (result *v1.IP, err error) { - emptyResult := &v1.IP{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(ipsResource, iP, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(ipsResource, name, opts), &v1.IP{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeIPs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(ipsResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.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 metav1.PatchOptions, subresources ...string) (result *v1.IP, err error) { - emptyResult := &v1.IP{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(ipsResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err +func newFakeIPs(fake *FakeKubeovnV1) kubeovnv1.IPInterface { + return &fakeIPs{ + gentype.NewFakeClientWithList[*v1.IP, *v1.IPList]( + fake.Fake, + "", + v1.SchemeGroupVersion.WithResource("ips"), + v1.SchemeGroupVersion.WithKind("IP"), + func() *v1.IP { return &v1.IP{} }, + func() *v1.IPList { return &v1.IPList{} }, + func(dst, src *v1.IPList) { dst.ListMeta = src.ListMeta }, + func(list *v1.IPList) []*v1.IP { return gentype.ToPointerSlice(list.Items) }, + func(list *v1.IPList, items []*v1.IP) { list.Items = gentype.FromPointerSlice(items) }, + ), + fake, } - return obj.(*v1.IP), err } diff --git a/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_ippool.go b/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_ippool.go index 5579395e76b..7fd667a8503 100644 --- a/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_ippool.go +++ b/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_ippool.go @@ -19,120 +19,30 @@ limitations under the License. package fake import ( - "context" - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned/typed/kubeovn/v1" + gentype "k8s.io/client-go/gentype" ) -// FakeIPPools implements IPPoolInterface -type FakeIPPools struct { +// fakeIPPools implements IPPoolInterface +type fakeIPPools struct { + *gentype.FakeClientWithList[*v1.IPPool, *v1.IPPoolList] Fake *FakeKubeovnV1 } -var ippoolsResource = v1.SchemeGroupVersion.WithResource("ippools") - -var ippoolsKind = v1.SchemeGroupVersion.WithKind("IPPool") - -// Get takes name of the iPPool, and returns the corresponding iPPool object, and an error if there is any. -func (c *FakeIPPools) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.IPPool, err error) { - emptyResult := &v1.IPPool{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(ippoolsResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.IPPool), err -} - -// List takes label and field selectors, and returns the list of IPPools that match those selectors. -func (c *FakeIPPools) List(ctx context.Context, opts metav1.ListOptions) (result *v1.IPPoolList, err error) { - emptyResult := &v1.IPPoolList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(ippoolsResource, ippoolsKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.IPPoolList{ListMeta: obj.(*v1.IPPoolList).ListMeta} - for _, item := range obj.(*v1.IPPoolList).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 iPPools. -func (c *FakeIPPools) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(ippoolsResource, opts)) -} - -// Create takes the representation of a iPPool and creates it. Returns the server's representation of the iPPool, and an error, if there is any. -func (c *FakeIPPools) Create(ctx context.Context, iPPool *v1.IPPool, opts metav1.CreateOptions) (result *v1.IPPool, err error) { - emptyResult := &v1.IPPool{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(ippoolsResource, iPPool, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.IPPool), err -} - -// Update takes the representation of a iPPool and updates it. Returns the server's representation of the iPPool, and an error, if there is any. -func (c *FakeIPPools) Update(ctx context.Context, iPPool *v1.IPPool, opts metav1.UpdateOptions) (result *v1.IPPool, err error) { - emptyResult := &v1.IPPool{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(ippoolsResource, iPPool, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.IPPool), 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 *FakeIPPools) UpdateStatus(ctx context.Context, iPPool *v1.IPPool, opts metav1.UpdateOptions) (result *v1.IPPool, err error) { - emptyResult := &v1.IPPool{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceActionWithOptions(ippoolsResource, "status", iPPool, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.IPPool), err -} - -// Delete takes name of the iPPool and deletes it. Returns an error if one occurs. -func (c *FakeIPPools) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(ippoolsResource, name, opts), &v1.IPPool{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeIPPools) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(ippoolsResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.IPPoolList{}) - return err -} - -// Patch applies the patch and returns the patched iPPool. -func (c *FakeIPPools) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.IPPool, err error) { - emptyResult := &v1.IPPool{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(ippoolsResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err +func newFakeIPPools(fake *FakeKubeovnV1) kubeovnv1.IPPoolInterface { + return &fakeIPPools{ + gentype.NewFakeClientWithList[*v1.IPPool, *v1.IPPoolList]( + fake.Fake, + "", + v1.SchemeGroupVersion.WithResource("ippools"), + v1.SchemeGroupVersion.WithKind("IPPool"), + func() *v1.IPPool { return &v1.IPPool{} }, + func() *v1.IPPoolList { return &v1.IPPoolList{} }, + func(dst, src *v1.IPPoolList) { dst.ListMeta = src.ListMeta }, + func(list *v1.IPPoolList) []*v1.IPPool { return gentype.ToPointerSlice(list.Items) }, + func(list *v1.IPPoolList, items []*v1.IPPool) { list.Items = gentype.FromPointerSlice(items) }, + ), + fake, } - return obj.(*v1.IPPool), err } diff --git a/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_iptablesdnatrule.go b/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_iptablesdnatrule.go index d7ecd393144..8e2abe58c5d 100644 --- a/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_iptablesdnatrule.go +++ b/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_iptablesdnatrule.go @@ -19,120 +19,32 @@ limitations under the License. package fake import ( - "context" - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned/typed/kubeovn/v1" + gentype "k8s.io/client-go/gentype" ) -// FakeIptablesDnatRules implements IptablesDnatRuleInterface -type FakeIptablesDnatRules struct { +// fakeIptablesDnatRules implements IptablesDnatRuleInterface +type fakeIptablesDnatRules struct { + *gentype.FakeClientWithList[*v1.IptablesDnatRule, *v1.IptablesDnatRuleList] Fake *FakeKubeovnV1 } -var iptablesdnatrulesResource = v1.SchemeGroupVersion.WithResource("iptables-dnat-rules") - -var iptablesdnatrulesKind = v1.SchemeGroupVersion.WithKind("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 metav1.GetOptions) (result *v1.IptablesDnatRule, err error) { - emptyResult := &v1.IptablesDnatRule{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(iptablesdnatrulesResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 metav1.ListOptions) (result *v1.IptablesDnatRuleList, err error) { - emptyResult := &v1.IptablesDnatRuleList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(iptablesdnatrulesResource, iptablesdnatrulesKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.IptablesDnatRuleList{ListMeta: obj.(*v1.IptablesDnatRuleList).ListMeta} - for _, item := range obj.(*v1.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 metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(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 *v1.IptablesDnatRule, opts metav1.CreateOptions) (result *v1.IptablesDnatRule, err error) { - emptyResult := &v1.IptablesDnatRule{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(iptablesdnatrulesResource, iptablesDnatRule, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 *v1.IptablesDnatRule, opts metav1.UpdateOptions) (result *v1.IptablesDnatRule, err error) { - emptyResult := &v1.IptablesDnatRule{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(iptablesdnatrulesResource, iptablesDnatRule, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 *v1.IptablesDnatRule, opts metav1.UpdateOptions) (result *v1.IptablesDnatRule, err error) { - emptyResult := &v1.IptablesDnatRule{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceActionWithOptions(iptablesdnatrulesResource, "status", iptablesDnatRule, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(iptablesdnatrulesResource, name, opts), &v1.IptablesDnatRule{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeIptablesDnatRules) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(iptablesdnatrulesResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.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 metav1.PatchOptions, subresources ...string) (result *v1.IptablesDnatRule, err error) { - emptyResult := &v1.IptablesDnatRule{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(iptablesdnatrulesResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err +func newFakeIptablesDnatRules(fake *FakeKubeovnV1) kubeovnv1.IptablesDnatRuleInterface { + return &fakeIptablesDnatRules{ + gentype.NewFakeClientWithList[*v1.IptablesDnatRule, *v1.IptablesDnatRuleList]( + fake.Fake, + "", + v1.SchemeGroupVersion.WithResource("iptables-dnat-rules"), + v1.SchemeGroupVersion.WithKind("IptablesDnatRule"), + func() *v1.IptablesDnatRule { return &v1.IptablesDnatRule{} }, + func() *v1.IptablesDnatRuleList { return &v1.IptablesDnatRuleList{} }, + func(dst, src *v1.IptablesDnatRuleList) { dst.ListMeta = src.ListMeta }, + func(list *v1.IptablesDnatRuleList) []*v1.IptablesDnatRule { return gentype.ToPointerSlice(list.Items) }, + func(list *v1.IptablesDnatRuleList, items []*v1.IptablesDnatRule) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return obj.(*v1.IptablesDnatRule), err } diff --git a/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_iptableseip.go b/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_iptableseip.go index 8457a12e801..5a1ea94fc6d 100644 --- a/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_iptableseip.go +++ b/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_iptableseip.go @@ -19,120 +19,30 @@ limitations under the License. package fake import ( - "context" - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned/typed/kubeovn/v1" + gentype "k8s.io/client-go/gentype" ) -// FakeIptablesEIPs implements IptablesEIPInterface -type FakeIptablesEIPs struct { +// fakeIptablesEIPs implements IptablesEIPInterface +type fakeIptablesEIPs struct { + *gentype.FakeClientWithList[*v1.IptablesEIP, *v1.IptablesEIPList] Fake *FakeKubeovnV1 } -var iptableseipsResource = v1.SchemeGroupVersion.WithResource("iptables-eips") - -var iptableseipsKind = v1.SchemeGroupVersion.WithKind("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 metav1.GetOptions) (result *v1.IptablesEIP, err error) { - emptyResult := &v1.IptablesEIP{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(iptableseipsResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 metav1.ListOptions) (result *v1.IptablesEIPList, err error) { - emptyResult := &v1.IptablesEIPList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(iptableseipsResource, iptableseipsKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.IptablesEIPList{ListMeta: obj.(*v1.IptablesEIPList).ListMeta} - for _, item := range obj.(*v1.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 metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(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 *v1.IptablesEIP, opts metav1.CreateOptions) (result *v1.IptablesEIP, err error) { - emptyResult := &v1.IptablesEIP{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(iptableseipsResource, iptablesEIP, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 *v1.IptablesEIP, opts metav1.UpdateOptions) (result *v1.IptablesEIP, err error) { - emptyResult := &v1.IptablesEIP{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(iptableseipsResource, iptablesEIP, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 *v1.IptablesEIP, opts metav1.UpdateOptions) (result *v1.IptablesEIP, err error) { - emptyResult := &v1.IptablesEIP{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceActionWithOptions(iptableseipsResource, "status", iptablesEIP, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(iptableseipsResource, name, opts), &v1.IptablesEIP{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeIptablesEIPs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(iptableseipsResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.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 metav1.PatchOptions, subresources ...string) (result *v1.IptablesEIP, err error) { - emptyResult := &v1.IptablesEIP{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(iptableseipsResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err +func newFakeIptablesEIPs(fake *FakeKubeovnV1) kubeovnv1.IptablesEIPInterface { + return &fakeIptablesEIPs{ + gentype.NewFakeClientWithList[*v1.IptablesEIP, *v1.IptablesEIPList]( + fake.Fake, + "", + v1.SchemeGroupVersion.WithResource("iptables-eips"), + v1.SchemeGroupVersion.WithKind("IptablesEIP"), + func() *v1.IptablesEIP { return &v1.IptablesEIP{} }, + func() *v1.IptablesEIPList { return &v1.IptablesEIPList{} }, + func(dst, src *v1.IptablesEIPList) { dst.ListMeta = src.ListMeta }, + func(list *v1.IptablesEIPList) []*v1.IptablesEIP { return gentype.ToPointerSlice(list.Items) }, + func(list *v1.IptablesEIPList, items []*v1.IptablesEIP) { list.Items = gentype.FromPointerSlice(items) }, + ), + fake, } - return obj.(*v1.IptablesEIP), err } diff --git a/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_iptablesfiprule.go b/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_iptablesfiprule.go index 9414c9aecf0..ad9475cd0b7 100644 --- a/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_iptablesfiprule.go +++ b/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_iptablesfiprule.go @@ -19,120 +19,32 @@ limitations under the License. package fake import ( - "context" - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned/typed/kubeovn/v1" + gentype "k8s.io/client-go/gentype" ) -// FakeIptablesFIPRules implements IptablesFIPRuleInterface -type FakeIptablesFIPRules struct { +// fakeIptablesFIPRules implements IptablesFIPRuleInterface +type fakeIptablesFIPRules struct { + *gentype.FakeClientWithList[*v1.IptablesFIPRule, *v1.IptablesFIPRuleList] Fake *FakeKubeovnV1 } -var iptablesfiprulesResource = v1.SchemeGroupVersion.WithResource("iptables-fip-rules") - -var iptablesfiprulesKind = v1.SchemeGroupVersion.WithKind("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 metav1.GetOptions) (result *v1.IptablesFIPRule, err error) { - emptyResult := &v1.IptablesFIPRule{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(iptablesfiprulesResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 metav1.ListOptions) (result *v1.IptablesFIPRuleList, err error) { - emptyResult := &v1.IptablesFIPRuleList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(iptablesfiprulesResource, iptablesfiprulesKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.IptablesFIPRuleList{ListMeta: obj.(*v1.IptablesFIPRuleList).ListMeta} - for _, item := range obj.(*v1.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 metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(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 *v1.IptablesFIPRule, opts metav1.CreateOptions) (result *v1.IptablesFIPRule, err error) { - emptyResult := &v1.IptablesFIPRule{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(iptablesfiprulesResource, iptablesFIPRule, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 *v1.IptablesFIPRule, opts metav1.UpdateOptions) (result *v1.IptablesFIPRule, err error) { - emptyResult := &v1.IptablesFIPRule{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(iptablesfiprulesResource, iptablesFIPRule, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 *v1.IptablesFIPRule, opts metav1.UpdateOptions) (result *v1.IptablesFIPRule, err error) { - emptyResult := &v1.IptablesFIPRule{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceActionWithOptions(iptablesfiprulesResource, "status", iptablesFIPRule, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(iptablesfiprulesResource, name, opts), &v1.IptablesFIPRule{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeIptablesFIPRules) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(iptablesfiprulesResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.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 metav1.PatchOptions, subresources ...string) (result *v1.IptablesFIPRule, err error) { - emptyResult := &v1.IptablesFIPRule{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(iptablesfiprulesResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err +func newFakeIptablesFIPRules(fake *FakeKubeovnV1) kubeovnv1.IptablesFIPRuleInterface { + return &fakeIptablesFIPRules{ + gentype.NewFakeClientWithList[*v1.IptablesFIPRule, *v1.IptablesFIPRuleList]( + fake.Fake, + "", + v1.SchemeGroupVersion.WithResource("iptables-fip-rules"), + v1.SchemeGroupVersion.WithKind("IptablesFIPRule"), + func() *v1.IptablesFIPRule { return &v1.IptablesFIPRule{} }, + func() *v1.IptablesFIPRuleList { return &v1.IptablesFIPRuleList{} }, + func(dst, src *v1.IptablesFIPRuleList) { dst.ListMeta = src.ListMeta }, + func(list *v1.IptablesFIPRuleList) []*v1.IptablesFIPRule { return gentype.ToPointerSlice(list.Items) }, + func(list *v1.IptablesFIPRuleList, items []*v1.IptablesFIPRule) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return obj.(*v1.IptablesFIPRule), err } diff --git a/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_iptablessnatrule.go b/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_iptablessnatrule.go index 97a2db2601b..73b8c03c5e5 100644 --- a/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_iptablessnatrule.go +++ b/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_iptablessnatrule.go @@ -19,120 +19,32 @@ limitations under the License. package fake import ( - "context" - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned/typed/kubeovn/v1" + gentype "k8s.io/client-go/gentype" ) -// FakeIptablesSnatRules implements IptablesSnatRuleInterface -type FakeIptablesSnatRules struct { +// fakeIptablesSnatRules implements IptablesSnatRuleInterface +type fakeIptablesSnatRules struct { + *gentype.FakeClientWithList[*v1.IptablesSnatRule, *v1.IptablesSnatRuleList] Fake *FakeKubeovnV1 } -var iptablessnatrulesResource = v1.SchemeGroupVersion.WithResource("iptables-snat-rules") - -var iptablessnatrulesKind = v1.SchemeGroupVersion.WithKind("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 metav1.GetOptions) (result *v1.IptablesSnatRule, err error) { - emptyResult := &v1.IptablesSnatRule{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(iptablessnatrulesResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 metav1.ListOptions) (result *v1.IptablesSnatRuleList, err error) { - emptyResult := &v1.IptablesSnatRuleList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(iptablessnatrulesResource, iptablessnatrulesKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.IptablesSnatRuleList{ListMeta: obj.(*v1.IptablesSnatRuleList).ListMeta} - for _, item := range obj.(*v1.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 metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(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 *v1.IptablesSnatRule, opts metav1.CreateOptions) (result *v1.IptablesSnatRule, err error) { - emptyResult := &v1.IptablesSnatRule{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(iptablessnatrulesResource, iptablesSnatRule, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 *v1.IptablesSnatRule, opts metav1.UpdateOptions) (result *v1.IptablesSnatRule, err error) { - emptyResult := &v1.IptablesSnatRule{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(iptablessnatrulesResource, iptablesSnatRule, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 *v1.IptablesSnatRule, opts metav1.UpdateOptions) (result *v1.IptablesSnatRule, err error) { - emptyResult := &v1.IptablesSnatRule{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceActionWithOptions(iptablessnatrulesResource, "status", iptablesSnatRule, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(iptablessnatrulesResource, name, opts), &v1.IptablesSnatRule{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeIptablesSnatRules) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(iptablessnatrulesResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.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 metav1.PatchOptions, subresources ...string) (result *v1.IptablesSnatRule, err error) { - emptyResult := &v1.IptablesSnatRule{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(iptablessnatrulesResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err +func newFakeIptablesSnatRules(fake *FakeKubeovnV1) kubeovnv1.IptablesSnatRuleInterface { + return &fakeIptablesSnatRules{ + gentype.NewFakeClientWithList[*v1.IptablesSnatRule, *v1.IptablesSnatRuleList]( + fake.Fake, + "", + v1.SchemeGroupVersion.WithResource("iptables-snat-rules"), + v1.SchemeGroupVersion.WithKind("IptablesSnatRule"), + func() *v1.IptablesSnatRule { return &v1.IptablesSnatRule{} }, + func() *v1.IptablesSnatRuleList { return &v1.IptablesSnatRuleList{} }, + func(dst, src *v1.IptablesSnatRuleList) { dst.ListMeta = src.ListMeta }, + func(list *v1.IptablesSnatRuleList) []*v1.IptablesSnatRule { return gentype.ToPointerSlice(list.Items) }, + func(list *v1.IptablesSnatRuleList, items []*v1.IptablesSnatRule) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return obj.(*v1.IptablesSnatRule), err } diff --git a/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_kubeovn_client.go b/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_kubeovn_client.go index a4857aada11..8be54ee7e18 100644 --- a/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_kubeovn_client.go +++ b/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_kubeovn_client.go @@ -29,87 +29,87 @@ type FakeKubeovnV1 struct { } func (c *FakeKubeovnV1) IPs() v1.IPInterface { - return &FakeIPs{c} + return newFakeIPs(c) } func (c *FakeKubeovnV1) IPPools() v1.IPPoolInterface { - return &FakeIPPools{c} + return newFakeIPPools(c) } func (c *FakeKubeovnV1) IptablesDnatRules() v1.IptablesDnatRuleInterface { - return &FakeIptablesDnatRules{c} + return newFakeIptablesDnatRules(c) } func (c *FakeKubeovnV1) IptablesEIPs() v1.IptablesEIPInterface { - return &FakeIptablesEIPs{c} + return newFakeIptablesEIPs(c) } func (c *FakeKubeovnV1) IptablesFIPRules() v1.IptablesFIPRuleInterface { - return &FakeIptablesFIPRules{c} + return newFakeIptablesFIPRules(c) } func (c *FakeKubeovnV1) IptablesSnatRules() v1.IptablesSnatRuleInterface { - return &FakeIptablesSnatRules{c} + return newFakeIptablesSnatRules(c) } func (c *FakeKubeovnV1) OvnDnatRules() v1.OvnDnatRuleInterface { - return &FakeOvnDnatRules{c} + return newFakeOvnDnatRules(c) } func (c *FakeKubeovnV1) OvnEips() v1.OvnEipInterface { - return &FakeOvnEips{c} + return newFakeOvnEips(c) } func (c *FakeKubeovnV1) OvnFips() v1.OvnFipInterface { - return &FakeOvnFips{c} + return newFakeOvnFips(c) } func (c *FakeKubeovnV1) OvnSnatRules() v1.OvnSnatRuleInterface { - return &FakeOvnSnatRules{c} + return newFakeOvnSnatRules(c) } func (c *FakeKubeovnV1) ProviderNetworks() v1.ProviderNetworkInterface { - return &FakeProviderNetworks{c} + return newFakeProviderNetworks(c) } func (c *FakeKubeovnV1) QoSPolicies() v1.QoSPolicyInterface { - return &FakeQoSPolicies{c} + return newFakeQoSPolicies(c) } func (c *FakeKubeovnV1) SecurityGroups() v1.SecurityGroupInterface { - return &FakeSecurityGroups{c} + return newFakeSecurityGroups(c) } func (c *FakeKubeovnV1) Subnets() v1.SubnetInterface { - return &FakeSubnets{c} + return newFakeSubnets(c) } func (c *FakeKubeovnV1) SwitchLBRules() v1.SwitchLBRuleInterface { - return &FakeSwitchLBRules{c} + return newFakeSwitchLBRules(c) } func (c *FakeKubeovnV1) Vips() v1.VipInterface { - return &FakeVips{c} + return newFakeVips(c) } func (c *FakeKubeovnV1) Vlans() v1.VlanInterface { - return &FakeVlans{c} + return newFakeVlans(c) } func (c *FakeKubeovnV1) Vpcs() v1.VpcInterface { - return &FakeVpcs{c} + return newFakeVpcs(c) } func (c *FakeKubeovnV1) VpcDnses() v1.VpcDnsInterface { - return &FakeVpcDnses{c} + return newFakeVpcDnses(c) } func (c *FakeKubeovnV1) VpcEgressGateways(namespace string) v1.VpcEgressGatewayInterface { - return &FakeVpcEgressGateways{c, namespace} + return newFakeVpcEgressGateways(c, namespace) } func (c *FakeKubeovnV1) VpcNatGateways() v1.VpcNatGatewayInterface { - return &FakeVpcNatGateways{c} + return newFakeVpcNatGateways(c) } // RESTClient returns a RESTClient that is used to communicate diff --git a/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_ovndnatrule.go b/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_ovndnatrule.go index bbb670fbae2..c35417e2d87 100644 --- a/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_ovndnatrule.go +++ b/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_ovndnatrule.go @@ -19,120 +19,30 @@ limitations under the License. package fake import ( - "context" - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned/typed/kubeovn/v1" + gentype "k8s.io/client-go/gentype" ) -// FakeOvnDnatRules implements OvnDnatRuleInterface -type FakeOvnDnatRules struct { +// fakeOvnDnatRules implements OvnDnatRuleInterface +type fakeOvnDnatRules struct { + *gentype.FakeClientWithList[*v1.OvnDnatRule, *v1.OvnDnatRuleList] Fake *FakeKubeovnV1 } -var ovndnatrulesResource = v1.SchemeGroupVersion.WithResource("ovn-dnat-rules") - -var ovndnatrulesKind = v1.SchemeGroupVersion.WithKind("OvnDnatRule") - -// Get takes name of the ovnDnatRule, and returns the corresponding ovnDnatRule object, and an error if there is any. -func (c *FakeOvnDnatRules) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.OvnDnatRule, err error) { - emptyResult := &v1.OvnDnatRule{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(ovndnatrulesResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.OvnDnatRule), err -} - -// List takes label and field selectors, and returns the list of OvnDnatRules that match those selectors. -func (c *FakeOvnDnatRules) List(ctx context.Context, opts metav1.ListOptions) (result *v1.OvnDnatRuleList, err error) { - emptyResult := &v1.OvnDnatRuleList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(ovndnatrulesResource, ovndnatrulesKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.OvnDnatRuleList{ListMeta: obj.(*v1.OvnDnatRuleList).ListMeta} - for _, item := range obj.(*v1.OvnDnatRuleList).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 ovnDnatRules. -func (c *FakeOvnDnatRules) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(ovndnatrulesResource, opts)) -} - -// Create takes the representation of a ovnDnatRule and creates it. Returns the server's representation of the ovnDnatRule, and an error, if there is any. -func (c *FakeOvnDnatRules) Create(ctx context.Context, ovnDnatRule *v1.OvnDnatRule, opts metav1.CreateOptions) (result *v1.OvnDnatRule, err error) { - emptyResult := &v1.OvnDnatRule{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(ovndnatrulesResource, ovnDnatRule, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.OvnDnatRule), err -} - -// Update takes the representation of a ovnDnatRule and updates it. Returns the server's representation of the ovnDnatRule, and an error, if there is any. -func (c *FakeOvnDnatRules) Update(ctx context.Context, ovnDnatRule *v1.OvnDnatRule, opts metav1.UpdateOptions) (result *v1.OvnDnatRule, err error) { - emptyResult := &v1.OvnDnatRule{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(ovndnatrulesResource, ovnDnatRule, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.OvnDnatRule), 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 *FakeOvnDnatRules) UpdateStatus(ctx context.Context, ovnDnatRule *v1.OvnDnatRule, opts metav1.UpdateOptions) (result *v1.OvnDnatRule, err error) { - emptyResult := &v1.OvnDnatRule{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceActionWithOptions(ovndnatrulesResource, "status", ovnDnatRule, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.OvnDnatRule), err -} - -// Delete takes name of the ovnDnatRule and deletes it. Returns an error if one occurs. -func (c *FakeOvnDnatRules) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(ovndnatrulesResource, name, opts), &v1.OvnDnatRule{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeOvnDnatRules) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(ovndnatrulesResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.OvnDnatRuleList{}) - return err -} - -// Patch applies the patch and returns the patched ovnDnatRule. -func (c *FakeOvnDnatRules) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.OvnDnatRule, err error) { - emptyResult := &v1.OvnDnatRule{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(ovndnatrulesResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err +func newFakeOvnDnatRules(fake *FakeKubeovnV1) kubeovnv1.OvnDnatRuleInterface { + return &fakeOvnDnatRules{ + gentype.NewFakeClientWithList[*v1.OvnDnatRule, *v1.OvnDnatRuleList]( + fake.Fake, + "", + v1.SchemeGroupVersion.WithResource("ovn-dnat-rules"), + v1.SchemeGroupVersion.WithKind("OvnDnatRule"), + func() *v1.OvnDnatRule { return &v1.OvnDnatRule{} }, + func() *v1.OvnDnatRuleList { return &v1.OvnDnatRuleList{} }, + func(dst, src *v1.OvnDnatRuleList) { dst.ListMeta = src.ListMeta }, + func(list *v1.OvnDnatRuleList) []*v1.OvnDnatRule { return gentype.ToPointerSlice(list.Items) }, + func(list *v1.OvnDnatRuleList, items []*v1.OvnDnatRule) { list.Items = gentype.FromPointerSlice(items) }, + ), + fake, } - return obj.(*v1.OvnDnatRule), err } diff --git a/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_ovneip.go b/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_ovneip.go index e81a9bca8dc..2b24dd461b0 100644 --- a/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_ovneip.go +++ b/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_ovneip.go @@ -19,120 +19,30 @@ limitations under the License. package fake import ( - "context" - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned/typed/kubeovn/v1" + gentype "k8s.io/client-go/gentype" ) -// FakeOvnEips implements OvnEipInterface -type FakeOvnEips struct { +// fakeOvnEips implements OvnEipInterface +type fakeOvnEips struct { + *gentype.FakeClientWithList[*v1.OvnEip, *v1.OvnEipList] Fake *FakeKubeovnV1 } -var ovneipsResource = v1.SchemeGroupVersion.WithResource("ovn-eips") - -var ovneipsKind = v1.SchemeGroupVersion.WithKind("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 metav1.GetOptions) (result *v1.OvnEip, err error) { - emptyResult := &v1.OvnEip{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(ovneipsResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 metav1.ListOptions) (result *v1.OvnEipList, err error) { - emptyResult := &v1.OvnEipList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(ovneipsResource, ovneipsKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.OvnEipList{ListMeta: obj.(*v1.OvnEipList).ListMeta} - for _, item := range obj.(*v1.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 metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(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 *v1.OvnEip, opts metav1.CreateOptions) (result *v1.OvnEip, err error) { - emptyResult := &v1.OvnEip{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(ovneipsResource, ovnEip, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 *v1.OvnEip, opts metav1.UpdateOptions) (result *v1.OvnEip, err error) { - emptyResult := &v1.OvnEip{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(ovneipsResource, ovnEip, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 *v1.OvnEip, opts metav1.UpdateOptions) (result *v1.OvnEip, err error) { - emptyResult := &v1.OvnEip{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceActionWithOptions(ovneipsResource, "status", ovnEip, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(ovneipsResource, name, opts), &v1.OvnEip{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeOvnEips) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(ovneipsResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.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 metav1.PatchOptions, subresources ...string) (result *v1.OvnEip, err error) { - emptyResult := &v1.OvnEip{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(ovneipsResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err +func newFakeOvnEips(fake *FakeKubeovnV1) kubeovnv1.OvnEipInterface { + return &fakeOvnEips{ + gentype.NewFakeClientWithList[*v1.OvnEip, *v1.OvnEipList]( + fake.Fake, + "", + v1.SchemeGroupVersion.WithResource("ovn-eips"), + v1.SchemeGroupVersion.WithKind("OvnEip"), + func() *v1.OvnEip { return &v1.OvnEip{} }, + func() *v1.OvnEipList { return &v1.OvnEipList{} }, + func(dst, src *v1.OvnEipList) { dst.ListMeta = src.ListMeta }, + func(list *v1.OvnEipList) []*v1.OvnEip { return gentype.ToPointerSlice(list.Items) }, + func(list *v1.OvnEipList, items []*v1.OvnEip) { list.Items = gentype.FromPointerSlice(items) }, + ), + fake, } - return obj.(*v1.OvnEip), err } diff --git a/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_ovnfip.go b/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_ovnfip.go index ae43f080952..daf00260b12 100644 --- a/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_ovnfip.go +++ b/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_ovnfip.go @@ -19,120 +19,30 @@ limitations under the License. package fake import ( - "context" - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned/typed/kubeovn/v1" + gentype "k8s.io/client-go/gentype" ) -// FakeOvnFips implements OvnFipInterface -type FakeOvnFips struct { +// fakeOvnFips implements OvnFipInterface +type fakeOvnFips struct { + *gentype.FakeClientWithList[*v1.OvnFip, *v1.OvnFipList] Fake *FakeKubeovnV1 } -var ovnfipsResource = v1.SchemeGroupVersion.WithResource("ovn-fips") - -var ovnfipsKind = v1.SchemeGroupVersion.WithKind("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 metav1.GetOptions) (result *v1.OvnFip, err error) { - emptyResult := &v1.OvnFip{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(ovnfipsResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 metav1.ListOptions) (result *v1.OvnFipList, err error) { - emptyResult := &v1.OvnFipList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(ovnfipsResource, ovnfipsKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.OvnFipList{ListMeta: obj.(*v1.OvnFipList).ListMeta} - for _, item := range obj.(*v1.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 metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(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 *v1.OvnFip, opts metav1.CreateOptions) (result *v1.OvnFip, err error) { - emptyResult := &v1.OvnFip{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(ovnfipsResource, ovnFip, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 *v1.OvnFip, opts metav1.UpdateOptions) (result *v1.OvnFip, err error) { - emptyResult := &v1.OvnFip{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(ovnfipsResource, ovnFip, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 *v1.OvnFip, opts metav1.UpdateOptions) (result *v1.OvnFip, err error) { - emptyResult := &v1.OvnFip{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceActionWithOptions(ovnfipsResource, "status", ovnFip, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(ovnfipsResource, name, opts), &v1.OvnFip{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeOvnFips) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(ovnfipsResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.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 metav1.PatchOptions, subresources ...string) (result *v1.OvnFip, err error) { - emptyResult := &v1.OvnFip{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(ovnfipsResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err +func newFakeOvnFips(fake *FakeKubeovnV1) kubeovnv1.OvnFipInterface { + return &fakeOvnFips{ + gentype.NewFakeClientWithList[*v1.OvnFip, *v1.OvnFipList]( + fake.Fake, + "", + v1.SchemeGroupVersion.WithResource("ovn-fips"), + v1.SchemeGroupVersion.WithKind("OvnFip"), + func() *v1.OvnFip { return &v1.OvnFip{} }, + func() *v1.OvnFipList { return &v1.OvnFipList{} }, + func(dst, src *v1.OvnFipList) { dst.ListMeta = src.ListMeta }, + func(list *v1.OvnFipList) []*v1.OvnFip { return gentype.ToPointerSlice(list.Items) }, + func(list *v1.OvnFipList, items []*v1.OvnFip) { list.Items = gentype.FromPointerSlice(items) }, + ), + fake, } - return obj.(*v1.OvnFip), err } diff --git a/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_ovnsnatrule.go b/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_ovnsnatrule.go index cab29ba95fe..dc588242ffb 100644 --- a/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_ovnsnatrule.go +++ b/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_ovnsnatrule.go @@ -19,120 +19,30 @@ limitations under the License. package fake import ( - "context" - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned/typed/kubeovn/v1" + gentype "k8s.io/client-go/gentype" ) -// FakeOvnSnatRules implements OvnSnatRuleInterface -type FakeOvnSnatRules struct { +// fakeOvnSnatRules implements OvnSnatRuleInterface +type fakeOvnSnatRules struct { + *gentype.FakeClientWithList[*v1.OvnSnatRule, *v1.OvnSnatRuleList] Fake *FakeKubeovnV1 } -var ovnsnatrulesResource = v1.SchemeGroupVersion.WithResource("ovn-snat-rules") - -var ovnsnatrulesKind = v1.SchemeGroupVersion.WithKind("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 metav1.GetOptions) (result *v1.OvnSnatRule, err error) { - emptyResult := &v1.OvnSnatRule{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(ovnsnatrulesResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 metav1.ListOptions) (result *v1.OvnSnatRuleList, err error) { - emptyResult := &v1.OvnSnatRuleList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(ovnsnatrulesResource, ovnsnatrulesKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.OvnSnatRuleList{ListMeta: obj.(*v1.OvnSnatRuleList).ListMeta} - for _, item := range obj.(*v1.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 metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(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 *v1.OvnSnatRule, opts metav1.CreateOptions) (result *v1.OvnSnatRule, err error) { - emptyResult := &v1.OvnSnatRule{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(ovnsnatrulesResource, ovnSnatRule, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 *v1.OvnSnatRule, opts metav1.UpdateOptions) (result *v1.OvnSnatRule, err error) { - emptyResult := &v1.OvnSnatRule{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(ovnsnatrulesResource, ovnSnatRule, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 *v1.OvnSnatRule, opts metav1.UpdateOptions) (result *v1.OvnSnatRule, err error) { - emptyResult := &v1.OvnSnatRule{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceActionWithOptions(ovnsnatrulesResource, "status", ovnSnatRule, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(ovnsnatrulesResource, name, opts), &v1.OvnSnatRule{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeOvnSnatRules) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(ovnsnatrulesResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.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 metav1.PatchOptions, subresources ...string) (result *v1.OvnSnatRule, err error) { - emptyResult := &v1.OvnSnatRule{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(ovnsnatrulesResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err +func newFakeOvnSnatRules(fake *FakeKubeovnV1) kubeovnv1.OvnSnatRuleInterface { + return &fakeOvnSnatRules{ + gentype.NewFakeClientWithList[*v1.OvnSnatRule, *v1.OvnSnatRuleList]( + fake.Fake, + "", + v1.SchemeGroupVersion.WithResource("ovn-snat-rules"), + v1.SchemeGroupVersion.WithKind("OvnSnatRule"), + func() *v1.OvnSnatRule { return &v1.OvnSnatRule{} }, + func() *v1.OvnSnatRuleList { return &v1.OvnSnatRuleList{} }, + func(dst, src *v1.OvnSnatRuleList) { dst.ListMeta = src.ListMeta }, + func(list *v1.OvnSnatRuleList) []*v1.OvnSnatRule { return gentype.ToPointerSlice(list.Items) }, + func(list *v1.OvnSnatRuleList, items []*v1.OvnSnatRule) { list.Items = gentype.FromPointerSlice(items) }, + ), + fake, } - return obj.(*v1.OvnSnatRule), err } diff --git a/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_providernetwork.go b/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_providernetwork.go index d7c9a1a4af0..709ea40f835 100644 --- a/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_providernetwork.go +++ b/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_providernetwork.go @@ -19,120 +19,32 @@ limitations under the License. package fake import ( - "context" - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned/typed/kubeovn/v1" + gentype "k8s.io/client-go/gentype" ) -// FakeProviderNetworks implements ProviderNetworkInterface -type FakeProviderNetworks struct { +// fakeProviderNetworks implements ProviderNetworkInterface +type fakeProviderNetworks struct { + *gentype.FakeClientWithList[*v1.ProviderNetwork, *v1.ProviderNetworkList] Fake *FakeKubeovnV1 } -var providernetworksResource = v1.SchemeGroupVersion.WithResource("provider-networks") - -var providernetworksKind = v1.SchemeGroupVersion.WithKind("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 metav1.GetOptions) (result *v1.ProviderNetwork, err error) { - emptyResult := &v1.ProviderNetwork{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(providernetworksResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 metav1.ListOptions) (result *v1.ProviderNetworkList, err error) { - emptyResult := &v1.ProviderNetworkList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(providernetworksResource, providernetworksKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.ProviderNetworkList{ListMeta: obj.(*v1.ProviderNetworkList).ListMeta} - for _, item := range obj.(*v1.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 metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(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 *v1.ProviderNetwork, opts metav1.CreateOptions) (result *v1.ProviderNetwork, err error) { - emptyResult := &v1.ProviderNetwork{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(providernetworksResource, providerNetwork, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 *v1.ProviderNetwork, opts metav1.UpdateOptions) (result *v1.ProviderNetwork, err error) { - emptyResult := &v1.ProviderNetwork{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(providernetworksResource, providerNetwork, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 *v1.ProviderNetwork, opts metav1.UpdateOptions) (result *v1.ProviderNetwork, err error) { - emptyResult := &v1.ProviderNetwork{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceActionWithOptions(providernetworksResource, "status", providerNetwork, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(providernetworksResource, name, opts), &v1.ProviderNetwork{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeProviderNetworks) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(providernetworksResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.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 metav1.PatchOptions, subresources ...string) (result *v1.ProviderNetwork, err error) { - emptyResult := &v1.ProviderNetwork{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(providernetworksResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err +func newFakeProviderNetworks(fake *FakeKubeovnV1) kubeovnv1.ProviderNetworkInterface { + return &fakeProviderNetworks{ + gentype.NewFakeClientWithList[*v1.ProviderNetwork, *v1.ProviderNetworkList]( + fake.Fake, + "", + v1.SchemeGroupVersion.WithResource("provider-networks"), + v1.SchemeGroupVersion.WithKind("ProviderNetwork"), + func() *v1.ProviderNetwork { return &v1.ProviderNetwork{} }, + func() *v1.ProviderNetworkList { return &v1.ProviderNetworkList{} }, + func(dst, src *v1.ProviderNetworkList) { dst.ListMeta = src.ListMeta }, + func(list *v1.ProviderNetworkList) []*v1.ProviderNetwork { return gentype.ToPointerSlice(list.Items) }, + func(list *v1.ProviderNetworkList, items []*v1.ProviderNetwork) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return obj.(*v1.ProviderNetwork), err } diff --git a/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_qospolicy.go b/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_qospolicy.go index 96b8ed1b023..f691a801b9a 100644 --- a/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_qospolicy.go +++ b/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_qospolicy.go @@ -19,120 +19,30 @@ limitations under the License. package fake import ( - "context" - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned/typed/kubeovn/v1" + gentype "k8s.io/client-go/gentype" ) -// FakeQoSPolicies implements QoSPolicyInterface -type FakeQoSPolicies struct { +// fakeQoSPolicies implements QoSPolicyInterface +type fakeQoSPolicies struct { + *gentype.FakeClientWithList[*v1.QoSPolicy, *v1.QoSPolicyList] Fake *FakeKubeovnV1 } -var qospoliciesResource = v1.SchemeGroupVersion.WithResource("qos-policies") - -var qospoliciesKind = v1.SchemeGroupVersion.WithKind("QoSPolicy") - -// Get takes name of the qoSPolicy, and returns the corresponding qoSPolicy object, and an error if there is any. -func (c *FakeQoSPolicies) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.QoSPolicy, err error) { - emptyResult := &v1.QoSPolicy{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(qospoliciesResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.QoSPolicy), err -} - -// List takes label and field selectors, and returns the list of QoSPolicies that match those selectors. -func (c *FakeQoSPolicies) List(ctx context.Context, opts metav1.ListOptions) (result *v1.QoSPolicyList, err error) { - emptyResult := &v1.QoSPolicyList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(qospoliciesResource, qospoliciesKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.QoSPolicyList{ListMeta: obj.(*v1.QoSPolicyList).ListMeta} - for _, item := range obj.(*v1.QoSPolicyList).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 qoSPolicies. -func (c *FakeQoSPolicies) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(qospoliciesResource, opts)) -} - -// Create takes the representation of a qoSPolicy and creates it. Returns the server's representation of the qoSPolicy, and an error, if there is any. -func (c *FakeQoSPolicies) Create(ctx context.Context, qoSPolicy *v1.QoSPolicy, opts metav1.CreateOptions) (result *v1.QoSPolicy, err error) { - emptyResult := &v1.QoSPolicy{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(qospoliciesResource, qoSPolicy, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.QoSPolicy), err -} - -// Update takes the representation of a qoSPolicy and updates it. Returns the server's representation of the qoSPolicy, and an error, if there is any. -func (c *FakeQoSPolicies) Update(ctx context.Context, qoSPolicy *v1.QoSPolicy, opts metav1.UpdateOptions) (result *v1.QoSPolicy, err error) { - emptyResult := &v1.QoSPolicy{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(qospoliciesResource, qoSPolicy, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.QoSPolicy), 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 *FakeQoSPolicies) UpdateStatus(ctx context.Context, qoSPolicy *v1.QoSPolicy, opts metav1.UpdateOptions) (result *v1.QoSPolicy, err error) { - emptyResult := &v1.QoSPolicy{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceActionWithOptions(qospoliciesResource, "status", qoSPolicy, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.QoSPolicy), err -} - -// Delete takes name of the qoSPolicy and deletes it. Returns an error if one occurs. -func (c *FakeQoSPolicies) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(qospoliciesResource, name, opts), &v1.QoSPolicy{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeQoSPolicies) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(qospoliciesResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.QoSPolicyList{}) - return err -} - -// Patch applies the patch and returns the patched qoSPolicy. -func (c *FakeQoSPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.QoSPolicy, err error) { - emptyResult := &v1.QoSPolicy{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(qospoliciesResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err +func newFakeQoSPolicies(fake *FakeKubeovnV1) kubeovnv1.QoSPolicyInterface { + return &fakeQoSPolicies{ + gentype.NewFakeClientWithList[*v1.QoSPolicy, *v1.QoSPolicyList]( + fake.Fake, + "", + v1.SchemeGroupVersion.WithResource("qos-policies"), + v1.SchemeGroupVersion.WithKind("QoSPolicy"), + func() *v1.QoSPolicy { return &v1.QoSPolicy{} }, + func() *v1.QoSPolicyList { return &v1.QoSPolicyList{} }, + func(dst, src *v1.QoSPolicyList) { dst.ListMeta = src.ListMeta }, + func(list *v1.QoSPolicyList) []*v1.QoSPolicy { return gentype.ToPointerSlice(list.Items) }, + func(list *v1.QoSPolicyList, items []*v1.QoSPolicy) { list.Items = gentype.FromPointerSlice(items) }, + ), + fake, } - return obj.(*v1.QoSPolicy), err } diff --git a/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_securitygroup.go b/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_securitygroup.go index bc2807dbc6c..a09ecfce72b 100644 --- a/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_securitygroup.go +++ b/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_securitygroup.go @@ -19,120 +19,32 @@ limitations under the License. package fake import ( - "context" - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned/typed/kubeovn/v1" + gentype "k8s.io/client-go/gentype" ) -// FakeSecurityGroups implements SecurityGroupInterface -type FakeSecurityGroups struct { +// fakeSecurityGroups implements SecurityGroupInterface +type fakeSecurityGroups struct { + *gentype.FakeClientWithList[*v1.SecurityGroup, *v1.SecurityGroupList] Fake *FakeKubeovnV1 } -var securitygroupsResource = v1.SchemeGroupVersion.WithResource("security-groups") - -var securitygroupsKind = v1.SchemeGroupVersion.WithKind("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 metav1.GetOptions) (result *v1.SecurityGroup, err error) { - emptyResult := &v1.SecurityGroup{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(securitygroupsResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 metav1.ListOptions) (result *v1.SecurityGroupList, err error) { - emptyResult := &v1.SecurityGroupList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(securitygroupsResource, securitygroupsKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.SecurityGroupList{ListMeta: obj.(*v1.SecurityGroupList).ListMeta} - for _, item := range obj.(*v1.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 metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(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 *v1.SecurityGroup, opts metav1.CreateOptions) (result *v1.SecurityGroup, err error) { - emptyResult := &v1.SecurityGroup{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(securitygroupsResource, securityGroup, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 *v1.SecurityGroup, opts metav1.UpdateOptions) (result *v1.SecurityGroup, err error) { - emptyResult := &v1.SecurityGroup{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(securitygroupsResource, securityGroup, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 *v1.SecurityGroup, opts metav1.UpdateOptions) (result *v1.SecurityGroup, err error) { - emptyResult := &v1.SecurityGroup{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceActionWithOptions(securitygroupsResource, "status", securityGroup, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(securitygroupsResource, name, opts), &v1.SecurityGroup{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeSecurityGroups) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(securitygroupsResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.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 metav1.PatchOptions, subresources ...string) (result *v1.SecurityGroup, err error) { - emptyResult := &v1.SecurityGroup{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(securitygroupsResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err +func newFakeSecurityGroups(fake *FakeKubeovnV1) kubeovnv1.SecurityGroupInterface { + return &fakeSecurityGroups{ + gentype.NewFakeClientWithList[*v1.SecurityGroup, *v1.SecurityGroupList]( + fake.Fake, + "", + v1.SchemeGroupVersion.WithResource("security-groups"), + v1.SchemeGroupVersion.WithKind("SecurityGroup"), + func() *v1.SecurityGroup { return &v1.SecurityGroup{} }, + func() *v1.SecurityGroupList { return &v1.SecurityGroupList{} }, + func(dst, src *v1.SecurityGroupList) { dst.ListMeta = src.ListMeta }, + func(list *v1.SecurityGroupList) []*v1.SecurityGroup { return gentype.ToPointerSlice(list.Items) }, + func(list *v1.SecurityGroupList, items []*v1.SecurityGroup) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return obj.(*v1.SecurityGroup), err } diff --git a/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_subnet.go b/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_subnet.go index 7c98aff3336..507b5d04f6e 100644 --- a/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_subnet.go +++ b/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_subnet.go @@ -19,120 +19,30 @@ limitations under the License. package fake import ( - "context" - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned/typed/kubeovn/v1" + gentype "k8s.io/client-go/gentype" ) -// FakeSubnets implements SubnetInterface -type FakeSubnets struct { +// fakeSubnets implements SubnetInterface +type fakeSubnets struct { + *gentype.FakeClientWithList[*v1.Subnet, *v1.SubnetList] Fake *FakeKubeovnV1 } -var subnetsResource = v1.SchemeGroupVersion.WithResource("subnets") - -var subnetsKind = v1.SchemeGroupVersion.WithKind("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 metav1.GetOptions) (result *v1.Subnet, err error) { - emptyResult := &v1.Subnet{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(subnetsResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 metav1.ListOptions) (result *v1.SubnetList, err error) { - emptyResult := &v1.SubnetList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(subnetsResource, subnetsKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.SubnetList{ListMeta: obj.(*v1.SubnetList).ListMeta} - for _, item := range obj.(*v1.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 metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(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 *v1.Subnet, opts metav1.CreateOptions) (result *v1.Subnet, err error) { - emptyResult := &v1.Subnet{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(subnetsResource, subnet, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 *v1.Subnet, opts metav1.UpdateOptions) (result *v1.Subnet, err error) { - emptyResult := &v1.Subnet{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(subnetsResource, subnet, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 *v1.Subnet, opts metav1.UpdateOptions) (result *v1.Subnet, err error) { - emptyResult := &v1.Subnet{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceActionWithOptions(subnetsResource, "status", subnet, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(subnetsResource, name, opts), &v1.Subnet{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeSubnets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(subnetsResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.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 metav1.PatchOptions, subresources ...string) (result *v1.Subnet, err error) { - emptyResult := &v1.Subnet{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(subnetsResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err +func newFakeSubnets(fake *FakeKubeovnV1) kubeovnv1.SubnetInterface { + return &fakeSubnets{ + gentype.NewFakeClientWithList[*v1.Subnet, *v1.SubnetList]( + fake.Fake, + "", + v1.SchemeGroupVersion.WithResource("subnets"), + v1.SchemeGroupVersion.WithKind("Subnet"), + func() *v1.Subnet { return &v1.Subnet{} }, + func() *v1.SubnetList { return &v1.SubnetList{} }, + func(dst, src *v1.SubnetList) { dst.ListMeta = src.ListMeta }, + func(list *v1.SubnetList) []*v1.Subnet { return gentype.ToPointerSlice(list.Items) }, + func(list *v1.SubnetList, items []*v1.Subnet) { list.Items = gentype.FromPointerSlice(items) }, + ), + fake, } - return obj.(*v1.Subnet), err } diff --git a/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_switchlbrule.go b/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_switchlbrule.go index b11f4342c11..7bbae6f2c17 100644 --- a/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_switchlbrule.go +++ b/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_switchlbrule.go @@ -19,120 +19,32 @@ limitations under the License. package fake import ( - "context" - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned/typed/kubeovn/v1" + gentype "k8s.io/client-go/gentype" ) -// FakeSwitchLBRules implements SwitchLBRuleInterface -type FakeSwitchLBRules struct { +// fakeSwitchLBRules implements SwitchLBRuleInterface +type fakeSwitchLBRules struct { + *gentype.FakeClientWithList[*v1.SwitchLBRule, *v1.SwitchLBRuleList] Fake *FakeKubeovnV1 } -var switchlbrulesResource = v1.SchemeGroupVersion.WithResource("switch-lb-rules") - -var switchlbrulesKind = v1.SchemeGroupVersion.WithKind("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 metav1.GetOptions) (result *v1.SwitchLBRule, err error) { - emptyResult := &v1.SwitchLBRule{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(switchlbrulesResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 metav1.ListOptions) (result *v1.SwitchLBRuleList, err error) { - emptyResult := &v1.SwitchLBRuleList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(switchlbrulesResource, switchlbrulesKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.SwitchLBRuleList{ListMeta: obj.(*v1.SwitchLBRuleList).ListMeta} - for _, item := range obj.(*v1.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 metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(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 *v1.SwitchLBRule, opts metav1.CreateOptions) (result *v1.SwitchLBRule, err error) { - emptyResult := &v1.SwitchLBRule{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(switchlbrulesResource, switchLBRule, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 *v1.SwitchLBRule, opts metav1.UpdateOptions) (result *v1.SwitchLBRule, err error) { - emptyResult := &v1.SwitchLBRule{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(switchlbrulesResource, switchLBRule, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 *v1.SwitchLBRule, opts metav1.UpdateOptions) (result *v1.SwitchLBRule, err error) { - emptyResult := &v1.SwitchLBRule{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceActionWithOptions(switchlbrulesResource, "status", switchLBRule, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(switchlbrulesResource, name, opts), &v1.SwitchLBRule{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeSwitchLBRules) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(switchlbrulesResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.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 metav1.PatchOptions, subresources ...string) (result *v1.SwitchLBRule, err error) { - emptyResult := &v1.SwitchLBRule{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(switchlbrulesResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err +func newFakeSwitchLBRules(fake *FakeKubeovnV1) kubeovnv1.SwitchLBRuleInterface { + return &fakeSwitchLBRules{ + gentype.NewFakeClientWithList[*v1.SwitchLBRule, *v1.SwitchLBRuleList]( + fake.Fake, + "", + v1.SchemeGroupVersion.WithResource("switch-lb-rules"), + v1.SchemeGroupVersion.WithKind("SwitchLBRule"), + func() *v1.SwitchLBRule { return &v1.SwitchLBRule{} }, + func() *v1.SwitchLBRuleList { return &v1.SwitchLBRuleList{} }, + func(dst, src *v1.SwitchLBRuleList) { dst.ListMeta = src.ListMeta }, + func(list *v1.SwitchLBRuleList) []*v1.SwitchLBRule { return gentype.ToPointerSlice(list.Items) }, + func(list *v1.SwitchLBRuleList, items []*v1.SwitchLBRule) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return obj.(*v1.SwitchLBRule), err } diff --git a/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_vip.go b/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_vip.go index 87fbfa0e40c..53240da99c3 100644 --- a/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_vip.go +++ b/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_vip.go @@ -19,120 +19,30 @@ limitations under the License. package fake import ( - "context" - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned/typed/kubeovn/v1" + gentype "k8s.io/client-go/gentype" ) -// FakeVips implements VipInterface -type FakeVips struct { +// fakeVips implements VipInterface +type fakeVips struct { + *gentype.FakeClientWithList[*v1.Vip, *v1.VipList] Fake *FakeKubeovnV1 } -var vipsResource = v1.SchemeGroupVersion.WithResource("vips") - -var vipsKind = v1.SchemeGroupVersion.WithKind("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 metav1.GetOptions) (result *v1.Vip, err error) { - emptyResult := &v1.Vip{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(vipsResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 metav1.ListOptions) (result *v1.VipList, err error) { - emptyResult := &v1.VipList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(vipsResource, vipsKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.VipList{ListMeta: obj.(*v1.VipList).ListMeta} - for _, item := range obj.(*v1.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 metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(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 *v1.Vip, opts metav1.CreateOptions) (result *v1.Vip, err error) { - emptyResult := &v1.Vip{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(vipsResource, vip, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 *v1.Vip, opts metav1.UpdateOptions) (result *v1.Vip, err error) { - emptyResult := &v1.Vip{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(vipsResource, vip, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 *v1.Vip, opts metav1.UpdateOptions) (result *v1.Vip, err error) { - emptyResult := &v1.Vip{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceActionWithOptions(vipsResource, "status", vip, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(vipsResource, name, opts), &v1.Vip{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeVips) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(vipsResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.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 metav1.PatchOptions, subresources ...string) (result *v1.Vip, err error) { - emptyResult := &v1.Vip{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(vipsResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err +func newFakeVips(fake *FakeKubeovnV1) kubeovnv1.VipInterface { + return &fakeVips{ + gentype.NewFakeClientWithList[*v1.Vip, *v1.VipList]( + fake.Fake, + "", + v1.SchemeGroupVersion.WithResource("vips"), + v1.SchemeGroupVersion.WithKind("Vip"), + func() *v1.Vip { return &v1.Vip{} }, + func() *v1.VipList { return &v1.VipList{} }, + func(dst, src *v1.VipList) { dst.ListMeta = src.ListMeta }, + func(list *v1.VipList) []*v1.Vip { return gentype.ToPointerSlice(list.Items) }, + func(list *v1.VipList, items []*v1.Vip) { list.Items = gentype.FromPointerSlice(items) }, + ), + fake, } - return obj.(*v1.Vip), err } diff --git a/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_vlan.go b/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_vlan.go index efb1e37decc..d55d6a4bc3c 100644 --- a/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_vlan.go +++ b/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_vlan.go @@ -19,120 +19,30 @@ limitations under the License. package fake import ( - "context" - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned/typed/kubeovn/v1" + gentype "k8s.io/client-go/gentype" ) -// FakeVlans implements VlanInterface -type FakeVlans struct { +// fakeVlans implements VlanInterface +type fakeVlans struct { + *gentype.FakeClientWithList[*v1.Vlan, *v1.VlanList] Fake *FakeKubeovnV1 } -var vlansResource = v1.SchemeGroupVersion.WithResource("vlans") - -var vlansKind = v1.SchemeGroupVersion.WithKind("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 metav1.GetOptions) (result *v1.Vlan, err error) { - emptyResult := &v1.Vlan{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(vlansResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 metav1.ListOptions) (result *v1.VlanList, err error) { - emptyResult := &v1.VlanList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(vlansResource, vlansKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.VlanList{ListMeta: obj.(*v1.VlanList).ListMeta} - for _, item := range obj.(*v1.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 metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(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 *v1.Vlan, opts metav1.CreateOptions) (result *v1.Vlan, err error) { - emptyResult := &v1.Vlan{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(vlansResource, vlan, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 *v1.Vlan, opts metav1.UpdateOptions) (result *v1.Vlan, err error) { - emptyResult := &v1.Vlan{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(vlansResource, vlan, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 *v1.Vlan, opts metav1.UpdateOptions) (result *v1.Vlan, err error) { - emptyResult := &v1.Vlan{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceActionWithOptions(vlansResource, "status", vlan, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(vlansResource, name, opts), &v1.Vlan{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeVlans) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(vlansResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.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 metav1.PatchOptions, subresources ...string) (result *v1.Vlan, err error) { - emptyResult := &v1.Vlan{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(vlansResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err +func newFakeVlans(fake *FakeKubeovnV1) kubeovnv1.VlanInterface { + return &fakeVlans{ + gentype.NewFakeClientWithList[*v1.Vlan, *v1.VlanList]( + fake.Fake, + "", + v1.SchemeGroupVersion.WithResource("vlans"), + v1.SchemeGroupVersion.WithKind("Vlan"), + func() *v1.Vlan { return &v1.Vlan{} }, + func() *v1.VlanList { return &v1.VlanList{} }, + func(dst, src *v1.VlanList) { dst.ListMeta = src.ListMeta }, + func(list *v1.VlanList) []*v1.Vlan { return gentype.ToPointerSlice(list.Items) }, + func(list *v1.VlanList, items []*v1.Vlan) { list.Items = gentype.FromPointerSlice(items) }, + ), + fake, } - return obj.(*v1.Vlan), err } diff --git a/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_vpc.go b/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_vpc.go index 2b2ca6f17c3..e00a4134ee2 100644 --- a/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_vpc.go +++ b/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_vpc.go @@ -19,120 +19,30 @@ limitations under the License. package fake import ( - "context" - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned/typed/kubeovn/v1" + gentype "k8s.io/client-go/gentype" ) -// FakeVpcs implements VpcInterface -type FakeVpcs struct { +// fakeVpcs implements VpcInterface +type fakeVpcs struct { + *gentype.FakeClientWithList[*v1.Vpc, *v1.VpcList] Fake *FakeKubeovnV1 } -var vpcsResource = v1.SchemeGroupVersion.WithResource("vpcs") - -var vpcsKind = v1.SchemeGroupVersion.WithKind("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 metav1.GetOptions) (result *v1.Vpc, err error) { - emptyResult := &v1.Vpc{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(vpcsResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 metav1.ListOptions) (result *v1.VpcList, err error) { - emptyResult := &v1.VpcList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(vpcsResource, vpcsKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.VpcList{ListMeta: obj.(*v1.VpcList).ListMeta} - for _, item := range obj.(*v1.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 metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(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 *v1.Vpc, opts metav1.CreateOptions) (result *v1.Vpc, err error) { - emptyResult := &v1.Vpc{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(vpcsResource, vpc, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 *v1.Vpc, opts metav1.UpdateOptions) (result *v1.Vpc, err error) { - emptyResult := &v1.Vpc{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(vpcsResource, vpc, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 *v1.Vpc, opts metav1.UpdateOptions) (result *v1.Vpc, err error) { - emptyResult := &v1.Vpc{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceActionWithOptions(vpcsResource, "status", vpc, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(vpcsResource, name, opts), &v1.Vpc{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeVpcs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(vpcsResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.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 metav1.PatchOptions, subresources ...string) (result *v1.Vpc, err error) { - emptyResult := &v1.Vpc{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(vpcsResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err +func newFakeVpcs(fake *FakeKubeovnV1) kubeovnv1.VpcInterface { + return &fakeVpcs{ + gentype.NewFakeClientWithList[*v1.Vpc, *v1.VpcList]( + fake.Fake, + "", + v1.SchemeGroupVersion.WithResource("vpcs"), + v1.SchemeGroupVersion.WithKind("Vpc"), + func() *v1.Vpc { return &v1.Vpc{} }, + func() *v1.VpcList { return &v1.VpcList{} }, + func(dst, src *v1.VpcList) { dst.ListMeta = src.ListMeta }, + func(list *v1.VpcList) []*v1.Vpc { return gentype.ToPointerSlice(list.Items) }, + func(list *v1.VpcList, items []*v1.Vpc) { list.Items = gentype.FromPointerSlice(items) }, + ), + fake, } - return obj.(*v1.Vpc), err } diff --git a/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_vpcdns.go b/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_vpcdns.go index a615f2a0b29..e002ca174e7 100644 --- a/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_vpcdns.go +++ b/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_vpcdns.go @@ -19,120 +19,30 @@ limitations under the License. package fake import ( - "context" - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned/typed/kubeovn/v1" + gentype "k8s.io/client-go/gentype" ) -// FakeVpcDnses implements VpcDnsInterface -type FakeVpcDnses struct { +// fakeVpcDnses implements VpcDnsInterface +type fakeVpcDnses struct { + *gentype.FakeClientWithList[*v1.VpcDns, *v1.VpcDnsList] Fake *FakeKubeovnV1 } -var vpcdnsesResource = v1.SchemeGroupVersion.WithResource("vpc-dnses") - -var vpcdnsesKind = v1.SchemeGroupVersion.WithKind("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 metav1.GetOptions) (result *v1.VpcDns, err error) { - emptyResult := &v1.VpcDns{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(vpcdnsesResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 metav1.ListOptions) (result *v1.VpcDnsList, err error) { - emptyResult := &v1.VpcDnsList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(vpcdnsesResource, vpcdnsesKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.VpcDnsList{ListMeta: obj.(*v1.VpcDnsList).ListMeta} - for _, item := range obj.(*v1.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 metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(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 *v1.VpcDns, opts metav1.CreateOptions) (result *v1.VpcDns, err error) { - emptyResult := &v1.VpcDns{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(vpcdnsesResource, vpcDns, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 *v1.VpcDns, opts metav1.UpdateOptions) (result *v1.VpcDns, err error) { - emptyResult := &v1.VpcDns{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(vpcdnsesResource, vpcDns, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 *v1.VpcDns, opts metav1.UpdateOptions) (result *v1.VpcDns, err error) { - emptyResult := &v1.VpcDns{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceActionWithOptions(vpcdnsesResource, "status", vpcDns, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(vpcdnsesResource, name, opts), &v1.VpcDns{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeVpcDnses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(vpcdnsesResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.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 metav1.PatchOptions, subresources ...string) (result *v1.VpcDns, err error) { - emptyResult := &v1.VpcDns{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(vpcdnsesResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err +func newFakeVpcDnses(fake *FakeKubeovnV1) kubeovnv1.VpcDnsInterface { + return &fakeVpcDnses{ + gentype.NewFakeClientWithList[*v1.VpcDns, *v1.VpcDnsList]( + fake.Fake, + "", + v1.SchemeGroupVersion.WithResource("vpc-dnses"), + v1.SchemeGroupVersion.WithKind("VpcDns"), + func() *v1.VpcDns { return &v1.VpcDns{} }, + func() *v1.VpcDnsList { return &v1.VpcDnsList{} }, + func(dst, src *v1.VpcDnsList) { dst.ListMeta = src.ListMeta }, + func(list *v1.VpcDnsList) []*v1.VpcDns { return gentype.ToPointerSlice(list.Items) }, + func(list *v1.VpcDnsList, items []*v1.VpcDns) { list.Items = gentype.FromPointerSlice(items) }, + ), + fake, } - return obj.(*v1.VpcDns), err } diff --git a/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_vpcegressgateway.go b/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_vpcegressgateway.go index 013cca6d5f7..095d9628147 100644 --- a/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_vpcegressgateway.go +++ b/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_vpcegressgateway.go @@ -19,129 +19,61 @@ limitations under the License. package fake import ( - "context" + context "context" v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned/typed/kubeovn/v1" + autoscalingv1 "k8s.io/api/autoscaling/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" + gentype "k8s.io/client-go/gentype" testing "k8s.io/client-go/testing" ) -// FakeVpcEgressGateways implements VpcEgressGatewayInterface -type FakeVpcEgressGateways struct { +// fakeVpcEgressGateways implements VpcEgressGatewayInterface +type fakeVpcEgressGateways struct { + *gentype.FakeClientWithList[*v1.VpcEgressGateway, *v1.VpcEgressGatewayList] Fake *FakeKubeovnV1 - ns string } -var vpcegressgatewaysResource = v1.SchemeGroupVersion.WithResource("vpc-egress-gateways") - -var vpcegressgatewaysKind = v1.SchemeGroupVersion.WithKind("VpcEgressGateway") - -// Get takes name of the vpcEgressGateway, and returns the corresponding vpcEgressGateway object, and an error if there is any. -func (c *FakeVpcEgressGateways) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.VpcEgressGateway, err error) { - emptyResult := &v1.VpcEgressGateway{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(vpcegressgatewaysResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.VpcEgressGateway), err -} - -// List takes label and field selectors, and returns the list of VpcEgressGateways that match those selectors. -func (c *FakeVpcEgressGateways) List(ctx context.Context, opts metav1.ListOptions) (result *v1.VpcEgressGatewayList, err error) { - emptyResult := &v1.VpcEgressGatewayList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(vpcegressgatewaysResource, vpcegressgatewaysKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() +func newFakeVpcEgressGateways(fake *FakeKubeovnV1, namespace string) kubeovnv1.VpcEgressGatewayInterface { + return &fakeVpcEgressGateways{ + gentype.NewFakeClientWithList[*v1.VpcEgressGateway, *v1.VpcEgressGatewayList]( + fake.Fake, + namespace, + v1.SchemeGroupVersion.WithResource("vpc-egress-gateways"), + v1.SchemeGroupVersion.WithKind("VpcEgressGateway"), + func() *v1.VpcEgressGateway { return &v1.VpcEgressGateway{} }, + func() *v1.VpcEgressGatewayList { return &v1.VpcEgressGatewayList{} }, + func(dst, src *v1.VpcEgressGatewayList) { dst.ListMeta = src.ListMeta }, + func(list *v1.VpcEgressGatewayList) []*v1.VpcEgressGateway { return gentype.ToPointerSlice(list.Items) }, + func(list *v1.VpcEgressGatewayList, items []*v1.VpcEgressGateway) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - list := &v1.VpcEgressGatewayList{ListMeta: obj.(*v1.VpcEgressGatewayList).ListMeta} - for _, item := range obj.(*v1.VpcEgressGatewayList).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 vpcEgressGateways. -func (c *FakeVpcEgressGateways) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(vpcegressgatewaysResource, c.ns, opts)) - -} - -// Create takes the representation of a vpcEgressGateway and creates it. Returns the server's representation of the vpcEgressGateway, and an error, if there is any. -func (c *FakeVpcEgressGateways) Create(ctx context.Context, vpcEgressGateway *v1.VpcEgressGateway, opts metav1.CreateOptions) (result *v1.VpcEgressGateway, err error) { - emptyResult := &v1.VpcEgressGateway{} +// GetScale takes name of the vpcEgressGateway, and returns the corresponding scale object, and an error if there is any. +func (c *fakeVpcEgressGateways) GetScale(ctx context.Context, vpcEgressGatewayName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) { + emptyResult := &autoscalingv1.Scale{} obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(vpcegressgatewaysResource, c.ns, vpcEgressGateway, opts), emptyResult) + Invokes(testing.NewGetSubresourceActionWithOptions(c.Resource(), c.Namespace(), "scale", vpcEgressGatewayName, options), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1.VpcEgressGateway), err -} - -// Update takes the representation of a vpcEgressGateway and updates it. Returns the server's representation of the vpcEgressGateway, and an error, if there is any. -func (c *FakeVpcEgressGateways) Update(ctx context.Context, vpcEgressGateway *v1.VpcEgressGateway, opts metav1.UpdateOptions) (result *v1.VpcEgressGateway, err error) { - emptyResult := &v1.VpcEgressGateway{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(vpcegressgatewaysResource, c.ns, vpcEgressGateway, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.VpcEgressGateway), 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 *FakeVpcEgressGateways) UpdateStatus(ctx context.Context, vpcEgressGateway *v1.VpcEgressGateway, opts metav1.UpdateOptions) (result *v1.VpcEgressGateway, err error) { - emptyResult := &v1.VpcEgressGateway{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(vpcegressgatewaysResource, "status", c.ns, vpcEgressGateway, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.VpcEgressGateway), err -} - -// Delete takes name of the vpcEgressGateway and deletes it. Returns an error if one occurs. -func (c *FakeVpcEgressGateways) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(vpcegressgatewaysResource, c.ns, name, opts), &v1.VpcEgressGateway{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeVpcEgressGateways) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(vpcegressgatewaysResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.VpcEgressGatewayList{}) - return err + return obj.(*autoscalingv1.Scale), err } -// Patch applies the patch and returns the patched vpcEgressGateway. -func (c *FakeVpcEgressGateways) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VpcEgressGateway, err error) { - emptyResult := &v1.VpcEgressGateway{} +// UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. +func (c *fakeVpcEgressGateways) UpdateScale(ctx context.Context, vpcEgressGatewayName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (result *autoscalingv1.Scale, err error) { + emptyResult := &autoscalingv1.Scale{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(vpcegressgatewaysResource, c.ns, name, pt, data, opts, subresources...), emptyResult) + Invokes(testing.NewUpdateSubresourceActionWithOptions(c.Resource(), "scale", c.Namespace(), scale, opts), &autoscalingv1.Scale{}) if obj == nil { return emptyResult, err } - return obj.(*v1.VpcEgressGateway), err + return obj.(*autoscalingv1.Scale), err } diff --git a/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_vpcnatgateway.go b/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_vpcnatgateway.go index 6ef40bc4774..434e1e14bd1 100644 --- a/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_vpcnatgateway.go +++ b/pkg/client/clientset/versioned/typed/kubeovn/v1/fake/fake_vpcnatgateway.go @@ -19,120 +19,32 @@ limitations under the License. package fake import ( - "context" - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned/typed/kubeovn/v1" + gentype "k8s.io/client-go/gentype" ) -// FakeVpcNatGateways implements VpcNatGatewayInterface -type FakeVpcNatGateways struct { +// fakeVpcNatGateways implements VpcNatGatewayInterface +type fakeVpcNatGateways struct { + *gentype.FakeClientWithList[*v1.VpcNatGateway, *v1.VpcNatGatewayList] Fake *FakeKubeovnV1 } -var vpcnatgatewaysResource = v1.SchemeGroupVersion.WithResource("vpc-nat-gateways") - -var vpcnatgatewaysKind = v1.SchemeGroupVersion.WithKind("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 metav1.GetOptions) (result *v1.VpcNatGateway, err error) { - emptyResult := &v1.VpcNatGateway{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(vpcnatgatewaysResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 metav1.ListOptions) (result *v1.VpcNatGatewayList, err error) { - emptyResult := &v1.VpcNatGatewayList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(vpcnatgatewaysResource, vpcnatgatewaysKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.VpcNatGatewayList{ListMeta: obj.(*v1.VpcNatGatewayList).ListMeta} - for _, item := range obj.(*v1.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 metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(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 *v1.VpcNatGateway, opts metav1.CreateOptions) (result *v1.VpcNatGateway, err error) { - emptyResult := &v1.VpcNatGateway{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(vpcnatgatewaysResource, vpcNatGateway, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 *v1.VpcNatGateway, opts metav1.UpdateOptions) (result *v1.VpcNatGateway, err error) { - emptyResult := &v1.VpcNatGateway{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(vpcnatgatewaysResource, vpcNatGateway, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.VpcNatGateway), 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 *FakeVpcNatGateways) UpdateStatus(ctx context.Context, vpcNatGateway *v1.VpcNatGateway, opts metav1.UpdateOptions) (result *v1.VpcNatGateway, err error) { - emptyResult := &v1.VpcNatGateway{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceActionWithOptions(vpcnatgatewaysResource, "status", vpcNatGateway, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.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 metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(vpcnatgatewaysResource, name, opts), &v1.VpcNatGateway{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeVpcNatGateways) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(vpcnatgatewaysResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.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 metav1.PatchOptions, subresources ...string) (result *v1.VpcNatGateway, err error) { - emptyResult := &v1.VpcNatGateway{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(vpcnatgatewaysResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err +func newFakeVpcNatGateways(fake *FakeKubeovnV1) kubeovnv1.VpcNatGatewayInterface { + return &fakeVpcNatGateways{ + gentype.NewFakeClientWithList[*v1.VpcNatGateway, *v1.VpcNatGatewayList]( + fake.Fake, + "", + v1.SchemeGroupVersion.WithResource("vpc-nat-gateways"), + v1.SchemeGroupVersion.WithKind("VpcNatGateway"), + func() *v1.VpcNatGateway { return &v1.VpcNatGateway{} }, + func() *v1.VpcNatGatewayList { return &v1.VpcNatGatewayList{} }, + func(dst, src *v1.VpcNatGatewayList) { dst.ListMeta = src.ListMeta }, + func(list *v1.VpcNatGatewayList) []*v1.VpcNatGateway { return gentype.ToPointerSlice(list.Items) }, + func(list *v1.VpcNatGatewayList, items []*v1.VpcNatGateway) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return obj.(*v1.VpcNatGateway), err } diff --git a/pkg/client/clientset/versioned/typed/kubeovn/v1/ip.go b/pkg/client/clientset/versioned/typed/kubeovn/v1/ip.go index 62a0c930b1c..757c360861f 100644 --- a/pkg/client/clientset/versioned/typed/kubeovn/v1/ip.go +++ b/pkg/client/clientset/versioned/typed/kubeovn/v1/ip.go @@ -19,9 +19,9 @@ limitations under the License. package v1 import ( - "context" + context "context" - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + kubeovnv1 "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" @@ -37,31 +37,32 @@ type IPsGetter interface { // 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) + Create(ctx context.Context, iP *kubeovnv1.IP, opts metav1.CreateOptions) (*kubeovnv1.IP, error) + Update(ctx context.Context, iP *kubeovnv1.IP, opts metav1.UpdateOptions) (*kubeovnv1.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) + Get(ctx context.Context, name string, opts metav1.GetOptions) (*kubeovnv1.IP, error) + List(ctx context.Context, opts metav1.ListOptions) (*kubeovnv1.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) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *kubeovnv1.IP, err error) IPExpansion } // iPs implements IPInterface type iPs struct { - *gentype.ClientWithList[*v1.IP, *v1.IPList] + *gentype.ClientWithList[*kubeovnv1.IP, *kubeovnv1.IPList] } // newIPs returns a IPs func newIPs(c *KubeovnV1Client) *iPs { return &iPs{ - gentype.NewClientWithList[*v1.IP, *v1.IPList]( + gentype.NewClientWithList[*kubeovnv1.IP, *kubeovnv1.IPList]( "ips", c.RESTClient(), scheme.ParameterCodec, "", - func() *v1.IP { return &v1.IP{} }, - func() *v1.IPList { return &v1.IPList{} }), + func() *kubeovnv1.IP { return &kubeovnv1.IP{} }, + func() *kubeovnv1.IPList { return &kubeovnv1.IPList{} }, + ), } } diff --git a/pkg/client/clientset/versioned/typed/kubeovn/v1/ippool.go b/pkg/client/clientset/versioned/typed/kubeovn/v1/ippool.go index c307de9ba95..934f422e8d1 100644 --- a/pkg/client/clientset/versioned/typed/kubeovn/v1/ippool.go +++ b/pkg/client/clientset/versioned/typed/kubeovn/v1/ippool.go @@ -19,9 +19,9 @@ limitations under the License. package v1 import ( - "context" + context "context" - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + kubeovnv1 "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" @@ -37,33 +37,34 @@ type IPPoolsGetter interface { // IPPoolInterface has methods to work with IPPool resources. type IPPoolInterface interface { - Create(ctx context.Context, iPPool *v1.IPPool, opts metav1.CreateOptions) (*v1.IPPool, error) - Update(ctx context.Context, iPPool *v1.IPPool, opts metav1.UpdateOptions) (*v1.IPPool, error) + Create(ctx context.Context, iPPool *kubeovnv1.IPPool, opts metav1.CreateOptions) (*kubeovnv1.IPPool, error) + Update(ctx context.Context, iPPool *kubeovnv1.IPPool, opts metav1.UpdateOptions) (*kubeovnv1.IPPool, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, iPPool *v1.IPPool, opts metav1.UpdateOptions) (*v1.IPPool, error) + UpdateStatus(ctx context.Context, iPPool *kubeovnv1.IPPool, opts metav1.UpdateOptions) (*kubeovnv1.IPPool, 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.IPPool, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.IPPoolList, error) + Get(ctx context.Context, name string, opts metav1.GetOptions) (*kubeovnv1.IPPool, error) + List(ctx context.Context, opts metav1.ListOptions) (*kubeovnv1.IPPoolList, 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.IPPool, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *kubeovnv1.IPPool, err error) IPPoolExpansion } // iPPools implements IPPoolInterface type iPPools struct { - *gentype.ClientWithList[*v1.IPPool, *v1.IPPoolList] + *gentype.ClientWithList[*kubeovnv1.IPPool, *kubeovnv1.IPPoolList] } // newIPPools returns a IPPools func newIPPools(c *KubeovnV1Client) *iPPools { return &iPPools{ - gentype.NewClientWithList[*v1.IPPool, *v1.IPPoolList]( + gentype.NewClientWithList[*kubeovnv1.IPPool, *kubeovnv1.IPPoolList]( "ippools", c.RESTClient(), scheme.ParameterCodec, "", - func() *v1.IPPool { return &v1.IPPool{} }, - func() *v1.IPPoolList { return &v1.IPPoolList{} }), + func() *kubeovnv1.IPPool { return &kubeovnv1.IPPool{} }, + func() *kubeovnv1.IPPoolList { return &kubeovnv1.IPPoolList{} }, + ), } } diff --git a/pkg/client/clientset/versioned/typed/kubeovn/v1/iptablesdnatrule.go b/pkg/client/clientset/versioned/typed/kubeovn/v1/iptablesdnatrule.go index 89ac3cdf6d5..962c78e6172 100644 --- a/pkg/client/clientset/versioned/typed/kubeovn/v1/iptablesdnatrule.go +++ b/pkg/client/clientset/versioned/typed/kubeovn/v1/iptablesdnatrule.go @@ -19,9 +19,9 @@ limitations under the License. package v1 import ( - "context" + context "context" - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + kubeovnv1 "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" @@ -37,33 +37,34 @@ type IptablesDnatRulesGetter interface { // 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) + Create(ctx context.Context, iptablesDnatRule *kubeovnv1.IptablesDnatRule, opts metav1.CreateOptions) (*kubeovnv1.IptablesDnatRule, error) + Update(ctx context.Context, iptablesDnatRule *kubeovnv1.IptablesDnatRule, opts metav1.UpdateOptions) (*kubeovnv1.IptablesDnatRule, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, iptablesDnatRule *v1.IptablesDnatRule, opts metav1.UpdateOptions) (*v1.IptablesDnatRule, error) + UpdateStatus(ctx context.Context, iptablesDnatRule *kubeovnv1.IptablesDnatRule, opts metav1.UpdateOptions) (*kubeovnv1.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) + Get(ctx context.Context, name string, opts metav1.GetOptions) (*kubeovnv1.IptablesDnatRule, error) + List(ctx context.Context, opts metav1.ListOptions) (*kubeovnv1.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) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *kubeovnv1.IptablesDnatRule, err error) IptablesDnatRuleExpansion } // iptablesDnatRules implements IptablesDnatRuleInterface type iptablesDnatRules struct { - *gentype.ClientWithList[*v1.IptablesDnatRule, *v1.IptablesDnatRuleList] + *gentype.ClientWithList[*kubeovnv1.IptablesDnatRule, *kubeovnv1.IptablesDnatRuleList] } // newIptablesDnatRules returns a IptablesDnatRules func newIptablesDnatRules(c *KubeovnV1Client) *iptablesDnatRules { return &iptablesDnatRules{ - gentype.NewClientWithList[*v1.IptablesDnatRule, *v1.IptablesDnatRuleList]( + gentype.NewClientWithList[*kubeovnv1.IptablesDnatRule, *kubeovnv1.IptablesDnatRuleList]( "iptables-dnat-rules", c.RESTClient(), scheme.ParameterCodec, "", - func() *v1.IptablesDnatRule { return &v1.IptablesDnatRule{} }, - func() *v1.IptablesDnatRuleList { return &v1.IptablesDnatRuleList{} }), + func() *kubeovnv1.IptablesDnatRule { return &kubeovnv1.IptablesDnatRule{} }, + func() *kubeovnv1.IptablesDnatRuleList { return &kubeovnv1.IptablesDnatRuleList{} }, + ), } } diff --git a/pkg/client/clientset/versioned/typed/kubeovn/v1/iptableseip.go b/pkg/client/clientset/versioned/typed/kubeovn/v1/iptableseip.go index 5a17e62469e..7a963c32af1 100644 --- a/pkg/client/clientset/versioned/typed/kubeovn/v1/iptableseip.go +++ b/pkg/client/clientset/versioned/typed/kubeovn/v1/iptableseip.go @@ -19,9 +19,9 @@ limitations under the License. package v1 import ( - "context" + context "context" - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + kubeovnv1 "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" @@ -37,33 +37,34 @@ type IptablesEIPsGetter interface { // 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) + Create(ctx context.Context, iptablesEIP *kubeovnv1.IptablesEIP, opts metav1.CreateOptions) (*kubeovnv1.IptablesEIP, error) + Update(ctx context.Context, iptablesEIP *kubeovnv1.IptablesEIP, opts metav1.UpdateOptions) (*kubeovnv1.IptablesEIP, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, iptablesEIP *v1.IptablesEIP, opts metav1.UpdateOptions) (*v1.IptablesEIP, error) + UpdateStatus(ctx context.Context, iptablesEIP *kubeovnv1.IptablesEIP, opts metav1.UpdateOptions) (*kubeovnv1.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) + Get(ctx context.Context, name string, opts metav1.GetOptions) (*kubeovnv1.IptablesEIP, error) + List(ctx context.Context, opts metav1.ListOptions) (*kubeovnv1.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) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *kubeovnv1.IptablesEIP, err error) IptablesEIPExpansion } // iptablesEIPs implements IptablesEIPInterface type iptablesEIPs struct { - *gentype.ClientWithList[*v1.IptablesEIP, *v1.IptablesEIPList] + *gentype.ClientWithList[*kubeovnv1.IptablesEIP, *kubeovnv1.IptablesEIPList] } // newIptablesEIPs returns a IptablesEIPs func newIptablesEIPs(c *KubeovnV1Client) *iptablesEIPs { return &iptablesEIPs{ - gentype.NewClientWithList[*v1.IptablesEIP, *v1.IptablesEIPList]( + gentype.NewClientWithList[*kubeovnv1.IptablesEIP, *kubeovnv1.IptablesEIPList]( "iptables-eips", c.RESTClient(), scheme.ParameterCodec, "", - func() *v1.IptablesEIP { return &v1.IptablesEIP{} }, - func() *v1.IptablesEIPList { return &v1.IptablesEIPList{} }), + func() *kubeovnv1.IptablesEIP { return &kubeovnv1.IptablesEIP{} }, + func() *kubeovnv1.IptablesEIPList { return &kubeovnv1.IptablesEIPList{} }, + ), } } diff --git a/pkg/client/clientset/versioned/typed/kubeovn/v1/iptablesfiprule.go b/pkg/client/clientset/versioned/typed/kubeovn/v1/iptablesfiprule.go index 7ea4e7d2824..1906421b225 100644 --- a/pkg/client/clientset/versioned/typed/kubeovn/v1/iptablesfiprule.go +++ b/pkg/client/clientset/versioned/typed/kubeovn/v1/iptablesfiprule.go @@ -19,9 +19,9 @@ limitations under the License. package v1 import ( - "context" + context "context" - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + kubeovnv1 "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" @@ -37,33 +37,34 @@ type IptablesFIPRulesGetter interface { // 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) + Create(ctx context.Context, iptablesFIPRule *kubeovnv1.IptablesFIPRule, opts metav1.CreateOptions) (*kubeovnv1.IptablesFIPRule, error) + Update(ctx context.Context, iptablesFIPRule *kubeovnv1.IptablesFIPRule, opts metav1.UpdateOptions) (*kubeovnv1.IptablesFIPRule, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, iptablesFIPRule *v1.IptablesFIPRule, opts metav1.UpdateOptions) (*v1.IptablesFIPRule, error) + UpdateStatus(ctx context.Context, iptablesFIPRule *kubeovnv1.IptablesFIPRule, opts metav1.UpdateOptions) (*kubeovnv1.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) + Get(ctx context.Context, name string, opts metav1.GetOptions) (*kubeovnv1.IptablesFIPRule, error) + List(ctx context.Context, opts metav1.ListOptions) (*kubeovnv1.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) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *kubeovnv1.IptablesFIPRule, err error) IptablesFIPRuleExpansion } // iptablesFIPRules implements IptablesFIPRuleInterface type iptablesFIPRules struct { - *gentype.ClientWithList[*v1.IptablesFIPRule, *v1.IptablesFIPRuleList] + *gentype.ClientWithList[*kubeovnv1.IptablesFIPRule, *kubeovnv1.IptablesFIPRuleList] } // newIptablesFIPRules returns a IptablesFIPRules func newIptablesFIPRules(c *KubeovnV1Client) *iptablesFIPRules { return &iptablesFIPRules{ - gentype.NewClientWithList[*v1.IptablesFIPRule, *v1.IptablesFIPRuleList]( + gentype.NewClientWithList[*kubeovnv1.IptablesFIPRule, *kubeovnv1.IptablesFIPRuleList]( "iptables-fip-rules", c.RESTClient(), scheme.ParameterCodec, "", - func() *v1.IptablesFIPRule { return &v1.IptablesFIPRule{} }, - func() *v1.IptablesFIPRuleList { return &v1.IptablesFIPRuleList{} }), + func() *kubeovnv1.IptablesFIPRule { return &kubeovnv1.IptablesFIPRule{} }, + func() *kubeovnv1.IptablesFIPRuleList { return &kubeovnv1.IptablesFIPRuleList{} }, + ), } } diff --git a/pkg/client/clientset/versioned/typed/kubeovn/v1/iptablessnatrule.go b/pkg/client/clientset/versioned/typed/kubeovn/v1/iptablessnatrule.go index 9b34cc4fa3a..1e6e4e2ccfc 100644 --- a/pkg/client/clientset/versioned/typed/kubeovn/v1/iptablessnatrule.go +++ b/pkg/client/clientset/versioned/typed/kubeovn/v1/iptablessnatrule.go @@ -19,9 +19,9 @@ limitations under the License. package v1 import ( - "context" + context "context" - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + kubeovnv1 "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" @@ -37,33 +37,34 @@ type IptablesSnatRulesGetter interface { // 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) + Create(ctx context.Context, iptablesSnatRule *kubeovnv1.IptablesSnatRule, opts metav1.CreateOptions) (*kubeovnv1.IptablesSnatRule, error) + Update(ctx context.Context, iptablesSnatRule *kubeovnv1.IptablesSnatRule, opts metav1.UpdateOptions) (*kubeovnv1.IptablesSnatRule, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, iptablesSnatRule *v1.IptablesSnatRule, opts metav1.UpdateOptions) (*v1.IptablesSnatRule, error) + UpdateStatus(ctx context.Context, iptablesSnatRule *kubeovnv1.IptablesSnatRule, opts metav1.UpdateOptions) (*kubeovnv1.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) + Get(ctx context.Context, name string, opts metav1.GetOptions) (*kubeovnv1.IptablesSnatRule, error) + List(ctx context.Context, opts metav1.ListOptions) (*kubeovnv1.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) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *kubeovnv1.IptablesSnatRule, err error) IptablesSnatRuleExpansion } // iptablesSnatRules implements IptablesSnatRuleInterface type iptablesSnatRules struct { - *gentype.ClientWithList[*v1.IptablesSnatRule, *v1.IptablesSnatRuleList] + *gentype.ClientWithList[*kubeovnv1.IptablesSnatRule, *kubeovnv1.IptablesSnatRuleList] } // newIptablesSnatRules returns a IptablesSnatRules func newIptablesSnatRules(c *KubeovnV1Client) *iptablesSnatRules { return &iptablesSnatRules{ - gentype.NewClientWithList[*v1.IptablesSnatRule, *v1.IptablesSnatRuleList]( + gentype.NewClientWithList[*kubeovnv1.IptablesSnatRule, *kubeovnv1.IptablesSnatRuleList]( "iptables-snat-rules", c.RESTClient(), scheme.ParameterCodec, "", - func() *v1.IptablesSnatRule { return &v1.IptablesSnatRule{} }, - func() *v1.IptablesSnatRuleList { return &v1.IptablesSnatRuleList{} }), + func() *kubeovnv1.IptablesSnatRule { return &kubeovnv1.IptablesSnatRule{} }, + func() *kubeovnv1.IptablesSnatRuleList { return &kubeovnv1.IptablesSnatRuleList{} }, + ), } } diff --git a/pkg/client/clientset/versioned/typed/kubeovn/v1/kubeovn_client.go b/pkg/client/clientset/versioned/typed/kubeovn/v1/kubeovn_client.go index aa73b0f4b66..24dc5ea5a1f 100644 --- a/pkg/client/clientset/versioned/typed/kubeovn/v1/kubeovn_client.go +++ b/pkg/client/clientset/versioned/typed/kubeovn/v1/kubeovn_client.go @@ -19,10 +19,10 @@ limitations under the License. package v1 import ( - "net/http" + http "net/http" - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" - "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned/scheme" + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + scheme "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned/scheme" rest "k8s.io/client-go/rest" ) @@ -185,10 +185,10 @@ func New(c rest.Interface) *KubeovnV1Client { } func setConfigDefaults(config *rest.Config) error { - gv := v1.SchemeGroupVersion + gv := kubeovnv1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" - config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() diff --git a/pkg/client/clientset/versioned/typed/kubeovn/v1/ovndnatrule.go b/pkg/client/clientset/versioned/typed/kubeovn/v1/ovndnatrule.go index ce15014da81..a40f25d47f1 100644 --- a/pkg/client/clientset/versioned/typed/kubeovn/v1/ovndnatrule.go +++ b/pkg/client/clientset/versioned/typed/kubeovn/v1/ovndnatrule.go @@ -19,9 +19,9 @@ limitations under the License. package v1 import ( - "context" + context "context" - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + kubeovnv1 "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" @@ -37,33 +37,34 @@ type OvnDnatRulesGetter interface { // OvnDnatRuleInterface has methods to work with OvnDnatRule resources. type OvnDnatRuleInterface interface { - Create(ctx context.Context, ovnDnatRule *v1.OvnDnatRule, opts metav1.CreateOptions) (*v1.OvnDnatRule, error) - Update(ctx context.Context, ovnDnatRule *v1.OvnDnatRule, opts metav1.UpdateOptions) (*v1.OvnDnatRule, error) + Create(ctx context.Context, ovnDnatRule *kubeovnv1.OvnDnatRule, opts metav1.CreateOptions) (*kubeovnv1.OvnDnatRule, error) + Update(ctx context.Context, ovnDnatRule *kubeovnv1.OvnDnatRule, opts metav1.UpdateOptions) (*kubeovnv1.OvnDnatRule, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, ovnDnatRule *v1.OvnDnatRule, opts metav1.UpdateOptions) (*v1.OvnDnatRule, error) + UpdateStatus(ctx context.Context, ovnDnatRule *kubeovnv1.OvnDnatRule, opts metav1.UpdateOptions) (*kubeovnv1.OvnDnatRule, 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.OvnDnatRule, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.OvnDnatRuleList, error) + Get(ctx context.Context, name string, opts metav1.GetOptions) (*kubeovnv1.OvnDnatRule, error) + List(ctx context.Context, opts metav1.ListOptions) (*kubeovnv1.OvnDnatRuleList, 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.OvnDnatRule, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *kubeovnv1.OvnDnatRule, err error) OvnDnatRuleExpansion } // ovnDnatRules implements OvnDnatRuleInterface type ovnDnatRules struct { - *gentype.ClientWithList[*v1.OvnDnatRule, *v1.OvnDnatRuleList] + *gentype.ClientWithList[*kubeovnv1.OvnDnatRule, *kubeovnv1.OvnDnatRuleList] } // newOvnDnatRules returns a OvnDnatRules func newOvnDnatRules(c *KubeovnV1Client) *ovnDnatRules { return &ovnDnatRules{ - gentype.NewClientWithList[*v1.OvnDnatRule, *v1.OvnDnatRuleList]( + gentype.NewClientWithList[*kubeovnv1.OvnDnatRule, *kubeovnv1.OvnDnatRuleList]( "ovn-dnat-rules", c.RESTClient(), scheme.ParameterCodec, "", - func() *v1.OvnDnatRule { return &v1.OvnDnatRule{} }, - func() *v1.OvnDnatRuleList { return &v1.OvnDnatRuleList{} }), + func() *kubeovnv1.OvnDnatRule { return &kubeovnv1.OvnDnatRule{} }, + func() *kubeovnv1.OvnDnatRuleList { return &kubeovnv1.OvnDnatRuleList{} }, + ), } } diff --git a/pkg/client/clientset/versioned/typed/kubeovn/v1/ovneip.go b/pkg/client/clientset/versioned/typed/kubeovn/v1/ovneip.go index 4fbed307958..f73856e674f 100644 --- a/pkg/client/clientset/versioned/typed/kubeovn/v1/ovneip.go +++ b/pkg/client/clientset/versioned/typed/kubeovn/v1/ovneip.go @@ -19,9 +19,9 @@ limitations under the License. package v1 import ( - "context" + context "context" - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + kubeovnv1 "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" @@ -37,33 +37,34 @@ type OvnEipsGetter interface { // 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) + Create(ctx context.Context, ovnEip *kubeovnv1.OvnEip, opts metav1.CreateOptions) (*kubeovnv1.OvnEip, error) + Update(ctx context.Context, ovnEip *kubeovnv1.OvnEip, opts metav1.UpdateOptions) (*kubeovnv1.OvnEip, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, ovnEip *v1.OvnEip, opts metav1.UpdateOptions) (*v1.OvnEip, error) + UpdateStatus(ctx context.Context, ovnEip *kubeovnv1.OvnEip, opts metav1.UpdateOptions) (*kubeovnv1.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) + Get(ctx context.Context, name string, opts metav1.GetOptions) (*kubeovnv1.OvnEip, error) + List(ctx context.Context, opts metav1.ListOptions) (*kubeovnv1.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) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *kubeovnv1.OvnEip, err error) OvnEipExpansion } // ovnEips implements OvnEipInterface type ovnEips struct { - *gentype.ClientWithList[*v1.OvnEip, *v1.OvnEipList] + *gentype.ClientWithList[*kubeovnv1.OvnEip, *kubeovnv1.OvnEipList] } // newOvnEips returns a OvnEips func newOvnEips(c *KubeovnV1Client) *ovnEips { return &ovnEips{ - gentype.NewClientWithList[*v1.OvnEip, *v1.OvnEipList]( + gentype.NewClientWithList[*kubeovnv1.OvnEip, *kubeovnv1.OvnEipList]( "ovn-eips", c.RESTClient(), scheme.ParameterCodec, "", - func() *v1.OvnEip { return &v1.OvnEip{} }, - func() *v1.OvnEipList { return &v1.OvnEipList{} }), + func() *kubeovnv1.OvnEip { return &kubeovnv1.OvnEip{} }, + func() *kubeovnv1.OvnEipList { return &kubeovnv1.OvnEipList{} }, + ), } } diff --git a/pkg/client/clientset/versioned/typed/kubeovn/v1/ovnfip.go b/pkg/client/clientset/versioned/typed/kubeovn/v1/ovnfip.go index 0f8e23d7f24..6a79b78b95d 100644 --- a/pkg/client/clientset/versioned/typed/kubeovn/v1/ovnfip.go +++ b/pkg/client/clientset/versioned/typed/kubeovn/v1/ovnfip.go @@ -19,9 +19,9 @@ limitations under the License. package v1 import ( - "context" + context "context" - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + kubeovnv1 "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" @@ -37,33 +37,34 @@ type OvnFipsGetter interface { // 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) + Create(ctx context.Context, ovnFip *kubeovnv1.OvnFip, opts metav1.CreateOptions) (*kubeovnv1.OvnFip, error) + Update(ctx context.Context, ovnFip *kubeovnv1.OvnFip, opts metav1.UpdateOptions) (*kubeovnv1.OvnFip, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, ovnFip *v1.OvnFip, opts metav1.UpdateOptions) (*v1.OvnFip, error) + UpdateStatus(ctx context.Context, ovnFip *kubeovnv1.OvnFip, opts metav1.UpdateOptions) (*kubeovnv1.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) + Get(ctx context.Context, name string, opts metav1.GetOptions) (*kubeovnv1.OvnFip, error) + List(ctx context.Context, opts metav1.ListOptions) (*kubeovnv1.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) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *kubeovnv1.OvnFip, err error) OvnFipExpansion } // ovnFips implements OvnFipInterface type ovnFips struct { - *gentype.ClientWithList[*v1.OvnFip, *v1.OvnFipList] + *gentype.ClientWithList[*kubeovnv1.OvnFip, *kubeovnv1.OvnFipList] } // newOvnFips returns a OvnFips func newOvnFips(c *KubeovnV1Client) *ovnFips { return &ovnFips{ - gentype.NewClientWithList[*v1.OvnFip, *v1.OvnFipList]( + gentype.NewClientWithList[*kubeovnv1.OvnFip, *kubeovnv1.OvnFipList]( "ovn-fips", c.RESTClient(), scheme.ParameterCodec, "", - func() *v1.OvnFip { return &v1.OvnFip{} }, - func() *v1.OvnFipList { return &v1.OvnFipList{} }), + func() *kubeovnv1.OvnFip { return &kubeovnv1.OvnFip{} }, + func() *kubeovnv1.OvnFipList { return &kubeovnv1.OvnFipList{} }, + ), } } diff --git a/pkg/client/clientset/versioned/typed/kubeovn/v1/ovnsnatrule.go b/pkg/client/clientset/versioned/typed/kubeovn/v1/ovnsnatrule.go index b485fc4ebd6..a24bca6fbf7 100644 --- a/pkg/client/clientset/versioned/typed/kubeovn/v1/ovnsnatrule.go +++ b/pkg/client/clientset/versioned/typed/kubeovn/v1/ovnsnatrule.go @@ -19,9 +19,9 @@ limitations under the License. package v1 import ( - "context" + context "context" - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + kubeovnv1 "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" @@ -37,33 +37,34 @@ type OvnSnatRulesGetter interface { // 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) + Create(ctx context.Context, ovnSnatRule *kubeovnv1.OvnSnatRule, opts metav1.CreateOptions) (*kubeovnv1.OvnSnatRule, error) + Update(ctx context.Context, ovnSnatRule *kubeovnv1.OvnSnatRule, opts metav1.UpdateOptions) (*kubeovnv1.OvnSnatRule, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, ovnSnatRule *v1.OvnSnatRule, opts metav1.UpdateOptions) (*v1.OvnSnatRule, error) + UpdateStatus(ctx context.Context, ovnSnatRule *kubeovnv1.OvnSnatRule, opts metav1.UpdateOptions) (*kubeovnv1.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) + Get(ctx context.Context, name string, opts metav1.GetOptions) (*kubeovnv1.OvnSnatRule, error) + List(ctx context.Context, opts metav1.ListOptions) (*kubeovnv1.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) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *kubeovnv1.OvnSnatRule, err error) OvnSnatRuleExpansion } // ovnSnatRules implements OvnSnatRuleInterface type ovnSnatRules struct { - *gentype.ClientWithList[*v1.OvnSnatRule, *v1.OvnSnatRuleList] + *gentype.ClientWithList[*kubeovnv1.OvnSnatRule, *kubeovnv1.OvnSnatRuleList] } // newOvnSnatRules returns a OvnSnatRules func newOvnSnatRules(c *KubeovnV1Client) *ovnSnatRules { return &ovnSnatRules{ - gentype.NewClientWithList[*v1.OvnSnatRule, *v1.OvnSnatRuleList]( + gentype.NewClientWithList[*kubeovnv1.OvnSnatRule, *kubeovnv1.OvnSnatRuleList]( "ovn-snat-rules", c.RESTClient(), scheme.ParameterCodec, "", - func() *v1.OvnSnatRule { return &v1.OvnSnatRule{} }, - func() *v1.OvnSnatRuleList { return &v1.OvnSnatRuleList{} }), + func() *kubeovnv1.OvnSnatRule { return &kubeovnv1.OvnSnatRule{} }, + func() *kubeovnv1.OvnSnatRuleList { return &kubeovnv1.OvnSnatRuleList{} }, + ), } } diff --git a/pkg/client/clientset/versioned/typed/kubeovn/v1/providernetwork.go b/pkg/client/clientset/versioned/typed/kubeovn/v1/providernetwork.go index e1c7f09f614..2b6a1715051 100644 --- a/pkg/client/clientset/versioned/typed/kubeovn/v1/providernetwork.go +++ b/pkg/client/clientset/versioned/typed/kubeovn/v1/providernetwork.go @@ -19,9 +19,9 @@ limitations under the License. package v1 import ( - "context" + context "context" - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + kubeovnv1 "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" @@ -37,33 +37,34 @@ type ProviderNetworksGetter interface { // 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) + Create(ctx context.Context, providerNetwork *kubeovnv1.ProviderNetwork, opts metav1.CreateOptions) (*kubeovnv1.ProviderNetwork, error) + Update(ctx context.Context, providerNetwork *kubeovnv1.ProviderNetwork, opts metav1.UpdateOptions) (*kubeovnv1.ProviderNetwork, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, providerNetwork *v1.ProviderNetwork, opts metav1.UpdateOptions) (*v1.ProviderNetwork, error) + UpdateStatus(ctx context.Context, providerNetwork *kubeovnv1.ProviderNetwork, opts metav1.UpdateOptions) (*kubeovnv1.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) + Get(ctx context.Context, name string, opts metav1.GetOptions) (*kubeovnv1.ProviderNetwork, error) + List(ctx context.Context, opts metav1.ListOptions) (*kubeovnv1.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) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *kubeovnv1.ProviderNetwork, err error) ProviderNetworkExpansion } // providerNetworks implements ProviderNetworkInterface type providerNetworks struct { - *gentype.ClientWithList[*v1.ProviderNetwork, *v1.ProviderNetworkList] + *gentype.ClientWithList[*kubeovnv1.ProviderNetwork, *kubeovnv1.ProviderNetworkList] } // newProviderNetworks returns a ProviderNetworks func newProviderNetworks(c *KubeovnV1Client) *providerNetworks { return &providerNetworks{ - gentype.NewClientWithList[*v1.ProviderNetwork, *v1.ProviderNetworkList]( + gentype.NewClientWithList[*kubeovnv1.ProviderNetwork, *kubeovnv1.ProviderNetworkList]( "provider-networks", c.RESTClient(), scheme.ParameterCodec, "", - func() *v1.ProviderNetwork { return &v1.ProviderNetwork{} }, - func() *v1.ProviderNetworkList { return &v1.ProviderNetworkList{} }), + func() *kubeovnv1.ProviderNetwork { return &kubeovnv1.ProviderNetwork{} }, + func() *kubeovnv1.ProviderNetworkList { return &kubeovnv1.ProviderNetworkList{} }, + ), } } diff --git a/pkg/client/clientset/versioned/typed/kubeovn/v1/qospolicy.go b/pkg/client/clientset/versioned/typed/kubeovn/v1/qospolicy.go index 2580941f872..593bc021b15 100644 --- a/pkg/client/clientset/versioned/typed/kubeovn/v1/qospolicy.go +++ b/pkg/client/clientset/versioned/typed/kubeovn/v1/qospolicy.go @@ -19,9 +19,9 @@ limitations under the License. package v1 import ( - "context" + context "context" - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + kubeovnv1 "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" @@ -37,33 +37,34 @@ type QoSPoliciesGetter interface { // QoSPolicyInterface has methods to work with QoSPolicy resources. type QoSPolicyInterface interface { - Create(ctx context.Context, qoSPolicy *v1.QoSPolicy, opts metav1.CreateOptions) (*v1.QoSPolicy, error) - Update(ctx context.Context, qoSPolicy *v1.QoSPolicy, opts metav1.UpdateOptions) (*v1.QoSPolicy, error) + Create(ctx context.Context, qoSPolicy *kubeovnv1.QoSPolicy, opts metav1.CreateOptions) (*kubeovnv1.QoSPolicy, error) + Update(ctx context.Context, qoSPolicy *kubeovnv1.QoSPolicy, opts metav1.UpdateOptions) (*kubeovnv1.QoSPolicy, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, qoSPolicy *v1.QoSPolicy, opts metav1.UpdateOptions) (*v1.QoSPolicy, error) + UpdateStatus(ctx context.Context, qoSPolicy *kubeovnv1.QoSPolicy, opts metav1.UpdateOptions) (*kubeovnv1.QoSPolicy, 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.QoSPolicy, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.QoSPolicyList, error) + Get(ctx context.Context, name string, opts metav1.GetOptions) (*kubeovnv1.QoSPolicy, error) + List(ctx context.Context, opts metav1.ListOptions) (*kubeovnv1.QoSPolicyList, 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.QoSPolicy, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *kubeovnv1.QoSPolicy, err error) QoSPolicyExpansion } // qoSPolicies implements QoSPolicyInterface type qoSPolicies struct { - *gentype.ClientWithList[*v1.QoSPolicy, *v1.QoSPolicyList] + *gentype.ClientWithList[*kubeovnv1.QoSPolicy, *kubeovnv1.QoSPolicyList] } // newQoSPolicies returns a QoSPolicies func newQoSPolicies(c *KubeovnV1Client) *qoSPolicies { return &qoSPolicies{ - gentype.NewClientWithList[*v1.QoSPolicy, *v1.QoSPolicyList]( + gentype.NewClientWithList[*kubeovnv1.QoSPolicy, *kubeovnv1.QoSPolicyList]( "qos-policies", c.RESTClient(), scheme.ParameterCodec, "", - func() *v1.QoSPolicy { return &v1.QoSPolicy{} }, - func() *v1.QoSPolicyList { return &v1.QoSPolicyList{} }), + func() *kubeovnv1.QoSPolicy { return &kubeovnv1.QoSPolicy{} }, + func() *kubeovnv1.QoSPolicyList { return &kubeovnv1.QoSPolicyList{} }, + ), } } diff --git a/pkg/client/clientset/versioned/typed/kubeovn/v1/securitygroup.go b/pkg/client/clientset/versioned/typed/kubeovn/v1/securitygroup.go index 6ec917d5a83..fb45dbeaae0 100644 --- a/pkg/client/clientset/versioned/typed/kubeovn/v1/securitygroup.go +++ b/pkg/client/clientset/versioned/typed/kubeovn/v1/securitygroup.go @@ -19,9 +19,9 @@ limitations under the License. package v1 import ( - "context" + context "context" - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + kubeovnv1 "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" @@ -37,33 +37,34 @@ type SecurityGroupsGetter interface { // 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) + Create(ctx context.Context, securityGroup *kubeovnv1.SecurityGroup, opts metav1.CreateOptions) (*kubeovnv1.SecurityGroup, error) + Update(ctx context.Context, securityGroup *kubeovnv1.SecurityGroup, opts metav1.UpdateOptions) (*kubeovnv1.SecurityGroup, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, securityGroup *v1.SecurityGroup, opts metav1.UpdateOptions) (*v1.SecurityGroup, error) + UpdateStatus(ctx context.Context, securityGroup *kubeovnv1.SecurityGroup, opts metav1.UpdateOptions) (*kubeovnv1.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) + Get(ctx context.Context, name string, opts metav1.GetOptions) (*kubeovnv1.SecurityGroup, error) + List(ctx context.Context, opts metav1.ListOptions) (*kubeovnv1.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) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *kubeovnv1.SecurityGroup, err error) SecurityGroupExpansion } // securityGroups implements SecurityGroupInterface type securityGroups struct { - *gentype.ClientWithList[*v1.SecurityGroup, *v1.SecurityGroupList] + *gentype.ClientWithList[*kubeovnv1.SecurityGroup, *kubeovnv1.SecurityGroupList] } // newSecurityGroups returns a SecurityGroups func newSecurityGroups(c *KubeovnV1Client) *securityGroups { return &securityGroups{ - gentype.NewClientWithList[*v1.SecurityGroup, *v1.SecurityGroupList]( + gentype.NewClientWithList[*kubeovnv1.SecurityGroup, *kubeovnv1.SecurityGroupList]( "security-groups", c.RESTClient(), scheme.ParameterCodec, "", - func() *v1.SecurityGroup { return &v1.SecurityGroup{} }, - func() *v1.SecurityGroupList { return &v1.SecurityGroupList{} }), + func() *kubeovnv1.SecurityGroup { return &kubeovnv1.SecurityGroup{} }, + func() *kubeovnv1.SecurityGroupList { return &kubeovnv1.SecurityGroupList{} }, + ), } } diff --git a/pkg/client/clientset/versioned/typed/kubeovn/v1/subnet.go b/pkg/client/clientset/versioned/typed/kubeovn/v1/subnet.go index f546e4cc9ec..d2a4f7e40a1 100644 --- a/pkg/client/clientset/versioned/typed/kubeovn/v1/subnet.go +++ b/pkg/client/clientset/versioned/typed/kubeovn/v1/subnet.go @@ -19,9 +19,9 @@ limitations under the License. package v1 import ( - "context" + context "context" - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + kubeovnv1 "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" @@ -37,33 +37,34 @@ type SubnetsGetter interface { // 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) + Create(ctx context.Context, subnet *kubeovnv1.Subnet, opts metav1.CreateOptions) (*kubeovnv1.Subnet, error) + Update(ctx context.Context, subnet *kubeovnv1.Subnet, opts metav1.UpdateOptions) (*kubeovnv1.Subnet, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, subnet *v1.Subnet, opts metav1.UpdateOptions) (*v1.Subnet, error) + UpdateStatus(ctx context.Context, subnet *kubeovnv1.Subnet, opts metav1.UpdateOptions) (*kubeovnv1.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) + Get(ctx context.Context, name string, opts metav1.GetOptions) (*kubeovnv1.Subnet, error) + List(ctx context.Context, opts metav1.ListOptions) (*kubeovnv1.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) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *kubeovnv1.Subnet, err error) SubnetExpansion } // subnets implements SubnetInterface type subnets struct { - *gentype.ClientWithList[*v1.Subnet, *v1.SubnetList] + *gentype.ClientWithList[*kubeovnv1.Subnet, *kubeovnv1.SubnetList] } // newSubnets returns a Subnets func newSubnets(c *KubeovnV1Client) *subnets { return &subnets{ - gentype.NewClientWithList[*v1.Subnet, *v1.SubnetList]( + gentype.NewClientWithList[*kubeovnv1.Subnet, *kubeovnv1.SubnetList]( "subnets", c.RESTClient(), scheme.ParameterCodec, "", - func() *v1.Subnet { return &v1.Subnet{} }, - func() *v1.SubnetList { return &v1.SubnetList{} }), + func() *kubeovnv1.Subnet { return &kubeovnv1.Subnet{} }, + func() *kubeovnv1.SubnetList { return &kubeovnv1.SubnetList{} }, + ), } } diff --git a/pkg/client/clientset/versioned/typed/kubeovn/v1/switchlbrule.go b/pkg/client/clientset/versioned/typed/kubeovn/v1/switchlbrule.go index 8b1bdbb0ef0..6c463440bfe 100644 --- a/pkg/client/clientset/versioned/typed/kubeovn/v1/switchlbrule.go +++ b/pkg/client/clientset/versioned/typed/kubeovn/v1/switchlbrule.go @@ -19,9 +19,9 @@ limitations under the License. package v1 import ( - "context" + context "context" - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + kubeovnv1 "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" @@ -37,33 +37,34 @@ type SwitchLBRulesGetter interface { // 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) + Create(ctx context.Context, switchLBRule *kubeovnv1.SwitchLBRule, opts metav1.CreateOptions) (*kubeovnv1.SwitchLBRule, error) + Update(ctx context.Context, switchLBRule *kubeovnv1.SwitchLBRule, opts metav1.UpdateOptions) (*kubeovnv1.SwitchLBRule, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, switchLBRule *v1.SwitchLBRule, opts metav1.UpdateOptions) (*v1.SwitchLBRule, error) + UpdateStatus(ctx context.Context, switchLBRule *kubeovnv1.SwitchLBRule, opts metav1.UpdateOptions) (*kubeovnv1.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) + Get(ctx context.Context, name string, opts metav1.GetOptions) (*kubeovnv1.SwitchLBRule, error) + List(ctx context.Context, opts metav1.ListOptions) (*kubeovnv1.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) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *kubeovnv1.SwitchLBRule, err error) SwitchLBRuleExpansion } // switchLBRules implements SwitchLBRuleInterface type switchLBRules struct { - *gentype.ClientWithList[*v1.SwitchLBRule, *v1.SwitchLBRuleList] + *gentype.ClientWithList[*kubeovnv1.SwitchLBRule, *kubeovnv1.SwitchLBRuleList] } // newSwitchLBRules returns a SwitchLBRules func newSwitchLBRules(c *KubeovnV1Client) *switchLBRules { return &switchLBRules{ - gentype.NewClientWithList[*v1.SwitchLBRule, *v1.SwitchLBRuleList]( + gentype.NewClientWithList[*kubeovnv1.SwitchLBRule, *kubeovnv1.SwitchLBRuleList]( "switch-lb-rules", c.RESTClient(), scheme.ParameterCodec, "", - func() *v1.SwitchLBRule { return &v1.SwitchLBRule{} }, - func() *v1.SwitchLBRuleList { return &v1.SwitchLBRuleList{} }), + func() *kubeovnv1.SwitchLBRule { return &kubeovnv1.SwitchLBRule{} }, + func() *kubeovnv1.SwitchLBRuleList { return &kubeovnv1.SwitchLBRuleList{} }, + ), } } diff --git a/pkg/client/clientset/versioned/typed/kubeovn/v1/vip.go b/pkg/client/clientset/versioned/typed/kubeovn/v1/vip.go index 9c8f3d73b29..6d8a3ad26b6 100644 --- a/pkg/client/clientset/versioned/typed/kubeovn/v1/vip.go +++ b/pkg/client/clientset/versioned/typed/kubeovn/v1/vip.go @@ -19,9 +19,9 @@ limitations under the License. package v1 import ( - "context" + context "context" - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + kubeovnv1 "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" @@ -37,33 +37,34 @@ type VipsGetter interface { // 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) + Create(ctx context.Context, vip *kubeovnv1.Vip, opts metav1.CreateOptions) (*kubeovnv1.Vip, error) + Update(ctx context.Context, vip *kubeovnv1.Vip, opts metav1.UpdateOptions) (*kubeovnv1.Vip, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, vip *v1.Vip, opts metav1.UpdateOptions) (*v1.Vip, error) + UpdateStatus(ctx context.Context, vip *kubeovnv1.Vip, opts metav1.UpdateOptions) (*kubeovnv1.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) + Get(ctx context.Context, name string, opts metav1.GetOptions) (*kubeovnv1.Vip, error) + List(ctx context.Context, opts metav1.ListOptions) (*kubeovnv1.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) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *kubeovnv1.Vip, err error) VipExpansion } // vips implements VipInterface type vips struct { - *gentype.ClientWithList[*v1.Vip, *v1.VipList] + *gentype.ClientWithList[*kubeovnv1.Vip, *kubeovnv1.VipList] } // newVips returns a Vips func newVips(c *KubeovnV1Client) *vips { return &vips{ - gentype.NewClientWithList[*v1.Vip, *v1.VipList]( + gentype.NewClientWithList[*kubeovnv1.Vip, *kubeovnv1.VipList]( "vips", c.RESTClient(), scheme.ParameterCodec, "", - func() *v1.Vip { return &v1.Vip{} }, - func() *v1.VipList { return &v1.VipList{} }), + func() *kubeovnv1.Vip { return &kubeovnv1.Vip{} }, + func() *kubeovnv1.VipList { return &kubeovnv1.VipList{} }, + ), } } diff --git a/pkg/client/clientset/versioned/typed/kubeovn/v1/vlan.go b/pkg/client/clientset/versioned/typed/kubeovn/v1/vlan.go index 958f0be2dce..f057cd368f5 100644 --- a/pkg/client/clientset/versioned/typed/kubeovn/v1/vlan.go +++ b/pkg/client/clientset/versioned/typed/kubeovn/v1/vlan.go @@ -19,9 +19,9 @@ limitations under the License. package v1 import ( - "context" + context "context" - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + kubeovnv1 "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" @@ -37,33 +37,34 @@ type VlansGetter interface { // 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) + Create(ctx context.Context, vlan *kubeovnv1.Vlan, opts metav1.CreateOptions) (*kubeovnv1.Vlan, error) + Update(ctx context.Context, vlan *kubeovnv1.Vlan, opts metav1.UpdateOptions) (*kubeovnv1.Vlan, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, vlan *v1.Vlan, opts metav1.UpdateOptions) (*v1.Vlan, error) + UpdateStatus(ctx context.Context, vlan *kubeovnv1.Vlan, opts metav1.UpdateOptions) (*kubeovnv1.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) + Get(ctx context.Context, name string, opts metav1.GetOptions) (*kubeovnv1.Vlan, error) + List(ctx context.Context, opts metav1.ListOptions) (*kubeovnv1.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) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *kubeovnv1.Vlan, err error) VlanExpansion } // vlans implements VlanInterface type vlans struct { - *gentype.ClientWithList[*v1.Vlan, *v1.VlanList] + *gentype.ClientWithList[*kubeovnv1.Vlan, *kubeovnv1.VlanList] } // newVlans returns a Vlans func newVlans(c *KubeovnV1Client) *vlans { return &vlans{ - gentype.NewClientWithList[*v1.Vlan, *v1.VlanList]( + gentype.NewClientWithList[*kubeovnv1.Vlan, *kubeovnv1.VlanList]( "vlans", c.RESTClient(), scheme.ParameterCodec, "", - func() *v1.Vlan { return &v1.Vlan{} }, - func() *v1.VlanList { return &v1.VlanList{} }), + func() *kubeovnv1.Vlan { return &kubeovnv1.Vlan{} }, + func() *kubeovnv1.VlanList { return &kubeovnv1.VlanList{} }, + ), } } diff --git a/pkg/client/clientset/versioned/typed/kubeovn/v1/vpc.go b/pkg/client/clientset/versioned/typed/kubeovn/v1/vpc.go index 84ba616217c..7335b7c26ec 100644 --- a/pkg/client/clientset/versioned/typed/kubeovn/v1/vpc.go +++ b/pkg/client/clientset/versioned/typed/kubeovn/v1/vpc.go @@ -19,9 +19,9 @@ limitations under the License. package v1 import ( - "context" + context "context" - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + kubeovnv1 "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" @@ -37,33 +37,34 @@ type VpcsGetter interface { // 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) + Create(ctx context.Context, vpc *kubeovnv1.Vpc, opts metav1.CreateOptions) (*kubeovnv1.Vpc, error) + Update(ctx context.Context, vpc *kubeovnv1.Vpc, opts metav1.UpdateOptions) (*kubeovnv1.Vpc, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, vpc *v1.Vpc, opts metav1.UpdateOptions) (*v1.Vpc, error) + UpdateStatus(ctx context.Context, vpc *kubeovnv1.Vpc, opts metav1.UpdateOptions) (*kubeovnv1.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) + Get(ctx context.Context, name string, opts metav1.GetOptions) (*kubeovnv1.Vpc, error) + List(ctx context.Context, opts metav1.ListOptions) (*kubeovnv1.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) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *kubeovnv1.Vpc, err error) VpcExpansion } // vpcs implements VpcInterface type vpcs struct { - *gentype.ClientWithList[*v1.Vpc, *v1.VpcList] + *gentype.ClientWithList[*kubeovnv1.Vpc, *kubeovnv1.VpcList] } // newVpcs returns a Vpcs func newVpcs(c *KubeovnV1Client) *vpcs { return &vpcs{ - gentype.NewClientWithList[*v1.Vpc, *v1.VpcList]( + gentype.NewClientWithList[*kubeovnv1.Vpc, *kubeovnv1.VpcList]( "vpcs", c.RESTClient(), scheme.ParameterCodec, "", - func() *v1.Vpc { return &v1.Vpc{} }, - func() *v1.VpcList { return &v1.VpcList{} }), + func() *kubeovnv1.Vpc { return &kubeovnv1.Vpc{} }, + func() *kubeovnv1.VpcList { return &kubeovnv1.VpcList{} }, + ), } } diff --git a/pkg/client/clientset/versioned/typed/kubeovn/v1/vpcdns.go b/pkg/client/clientset/versioned/typed/kubeovn/v1/vpcdns.go index 02e8ec80882..e73a29e0865 100644 --- a/pkg/client/clientset/versioned/typed/kubeovn/v1/vpcdns.go +++ b/pkg/client/clientset/versioned/typed/kubeovn/v1/vpcdns.go @@ -19,9 +19,9 @@ limitations under the License. package v1 import ( - "context" + context "context" - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + kubeovnv1 "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" @@ -37,33 +37,34 @@ type VpcDnsesGetter interface { // 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) + Create(ctx context.Context, vpcDns *kubeovnv1.VpcDns, opts metav1.CreateOptions) (*kubeovnv1.VpcDns, error) + Update(ctx context.Context, vpcDns *kubeovnv1.VpcDns, opts metav1.UpdateOptions) (*kubeovnv1.VpcDns, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, vpcDns *v1.VpcDns, opts metav1.UpdateOptions) (*v1.VpcDns, error) + UpdateStatus(ctx context.Context, vpcDns *kubeovnv1.VpcDns, opts metav1.UpdateOptions) (*kubeovnv1.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) + Get(ctx context.Context, name string, opts metav1.GetOptions) (*kubeovnv1.VpcDns, error) + List(ctx context.Context, opts metav1.ListOptions) (*kubeovnv1.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) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *kubeovnv1.VpcDns, err error) VpcDnsExpansion } // vpcDnses implements VpcDnsInterface type vpcDnses struct { - *gentype.ClientWithList[*v1.VpcDns, *v1.VpcDnsList] + *gentype.ClientWithList[*kubeovnv1.VpcDns, *kubeovnv1.VpcDnsList] } // newVpcDnses returns a VpcDnses func newVpcDnses(c *KubeovnV1Client) *vpcDnses { return &vpcDnses{ - gentype.NewClientWithList[*v1.VpcDns, *v1.VpcDnsList]( + gentype.NewClientWithList[*kubeovnv1.VpcDns, *kubeovnv1.VpcDnsList]( "vpc-dnses", c.RESTClient(), scheme.ParameterCodec, "", - func() *v1.VpcDns { return &v1.VpcDns{} }, - func() *v1.VpcDnsList { return &v1.VpcDnsList{} }), + func() *kubeovnv1.VpcDns { return &kubeovnv1.VpcDns{} }, + func() *kubeovnv1.VpcDnsList { return &kubeovnv1.VpcDnsList{} }, + ), } } diff --git a/pkg/client/clientset/versioned/typed/kubeovn/v1/vpcegressgateway.go b/pkg/client/clientset/versioned/typed/kubeovn/v1/vpcegressgateway.go index 09f4bafa669..9a3c3e7972a 100644 --- a/pkg/client/clientset/versioned/typed/kubeovn/v1/vpcegressgateway.go +++ b/pkg/client/clientset/versioned/typed/kubeovn/v1/vpcegressgateway.go @@ -19,10 +19,11 @@ limitations under the License. package v1 import ( - "context" + context "context" - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" scheme "github.com/kubeovn/kube-ovn/pkg/client/clientset/versioned/scheme" + autoscalingv1 "k8s.io/api/autoscaling/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" @@ -37,33 +38,66 @@ type VpcEgressGatewaysGetter interface { // VpcEgressGatewayInterface has methods to work with VpcEgressGateway resources. type VpcEgressGatewayInterface interface { - Create(ctx context.Context, vpcEgressGateway *v1.VpcEgressGateway, opts metav1.CreateOptions) (*v1.VpcEgressGateway, error) - Update(ctx context.Context, vpcEgressGateway *v1.VpcEgressGateway, opts metav1.UpdateOptions) (*v1.VpcEgressGateway, error) + Create(ctx context.Context, vpcEgressGateway *kubeovnv1.VpcEgressGateway, opts metav1.CreateOptions) (*kubeovnv1.VpcEgressGateway, error) + Update(ctx context.Context, vpcEgressGateway *kubeovnv1.VpcEgressGateway, opts metav1.UpdateOptions) (*kubeovnv1.VpcEgressGateway, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, vpcEgressGateway *v1.VpcEgressGateway, opts metav1.UpdateOptions) (*v1.VpcEgressGateway, error) + UpdateStatus(ctx context.Context, vpcEgressGateway *kubeovnv1.VpcEgressGateway, opts metav1.UpdateOptions) (*kubeovnv1.VpcEgressGateway, 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.VpcEgressGateway, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.VpcEgressGatewayList, error) + Get(ctx context.Context, name string, opts metav1.GetOptions) (*kubeovnv1.VpcEgressGateway, error) + List(ctx context.Context, opts metav1.ListOptions) (*kubeovnv1.VpcEgressGatewayList, 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.VpcEgressGateway, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *kubeovnv1.VpcEgressGateway, err error) + GetScale(ctx context.Context, vpcEgressGatewayName string, options metav1.GetOptions) (*autoscalingv1.Scale, error) + UpdateScale(ctx context.Context, vpcEgressGatewayName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (*autoscalingv1.Scale, error) + VpcEgressGatewayExpansion } // vpcEgressGateways implements VpcEgressGatewayInterface type vpcEgressGateways struct { - *gentype.ClientWithList[*v1.VpcEgressGateway, *v1.VpcEgressGatewayList] + *gentype.ClientWithList[*kubeovnv1.VpcEgressGateway, *kubeovnv1.VpcEgressGatewayList] } // newVpcEgressGateways returns a VpcEgressGateways func newVpcEgressGateways(c *KubeovnV1Client, namespace string) *vpcEgressGateways { return &vpcEgressGateways{ - gentype.NewClientWithList[*v1.VpcEgressGateway, *v1.VpcEgressGatewayList]( + gentype.NewClientWithList[*kubeovnv1.VpcEgressGateway, *kubeovnv1.VpcEgressGatewayList]( "vpc-egress-gateways", c.RESTClient(), scheme.ParameterCodec, namespace, - func() *v1.VpcEgressGateway { return &v1.VpcEgressGateway{} }, - func() *v1.VpcEgressGatewayList { return &v1.VpcEgressGatewayList{} }), + func() *kubeovnv1.VpcEgressGateway { return &kubeovnv1.VpcEgressGateway{} }, + func() *kubeovnv1.VpcEgressGatewayList { return &kubeovnv1.VpcEgressGatewayList{} }, + ), } } + +// GetScale takes name of the vpcEgressGateway, and returns the corresponding autoscalingv1.Scale object, and an error if there is any. +func (c *vpcEgressGateways) GetScale(ctx context.Context, vpcEgressGatewayName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) { + result = &autoscalingv1.Scale{} + err = c.GetClient().Get(). + Namespace(c.GetNamespace()). + Resource("vpc-egress-gateways"). + Name(vpcEgressGatewayName). + SubResource("scale"). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// UpdateScale takes the top resource name and the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. +func (c *vpcEgressGateways) UpdateScale(ctx context.Context, vpcEgressGatewayName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (result *autoscalingv1.Scale, err error) { + result = &autoscalingv1.Scale{} + err = c.GetClient().Put(). + Namespace(c.GetNamespace()). + Resource("vpc-egress-gateways"). + Name(vpcEgressGatewayName). + SubResource("scale"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(scale). + Do(ctx). + Into(result) + return +} diff --git a/pkg/client/clientset/versioned/typed/kubeovn/v1/vpcnatgateway.go b/pkg/client/clientset/versioned/typed/kubeovn/v1/vpcnatgateway.go index d94f35ce6ab..44de855df65 100644 --- a/pkg/client/clientset/versioned/typed/kubeovn/v1/vpcnatgateway.go +++ b/pkg/client/clientset/versioned/typed/kubeovn/v1/vpcnatgateway.go @@ -19,9 +19,9 @@ limitations under the License. package v1 import ( - "context" + context "context" - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + kubeovnv1 "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" @@ -37,33 +37,34 @@ type VpcNatGatewaysGetter interface { // 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) + Create(ctx context.Context, vpcNatGateway *kubeovnv1.VpcNatGateway, opts metav1.CreateOptions) (*kubeovnv1.VpcNatGateway, error) + Update(ctx context.Context, vpcNatGateway *kubeovnv1.VpcNatGateway, opts metav1.UpdateOptions) (*kubeovnv1.VpcNatGateway, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, vpcNatGateway *v1.VpcNatGateway, opts metav1.UpdateOptions) (*v1.VpcNatGateway, error) + UpdateStatus(ctx context.Context, vpcNatGateway *kubeovnv1.VpcNatGateway, opts metav1.UpdateOptions) (*kubeovnv1.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) + Get(ctx context.Context, name string, opts metav1.GetOptions) (*kubeovnv1.VpcNatGateway, error) + List(ctx context.Context, opts metav1.ListOptions) (*kubeovnv1.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) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *kubeovnv1.VpcNatGateway, err error) VpcNatGatewayExpansion } // vpcNatGateways implements VpcNatGatewayInterface type vpcNatGateways struct { - *gentype.ClientWithList[*v1.VpcNatGateway, *v1.VpcNatGatewayList] + *gentype.ClientWithList[*kubeovnv1.VpcNatGateway, *kubeovnv1.VpcNatGatewayList] } // newVpcNatGateways returns a VpcNatGateways func newVpcNatGateways(c *KubeovnV1Client) *vpcNatGateways { return &vpcNatGateways{ - gentype.NewClientWithList[*v1.VpcNatGateway, *v1.VpcNatGatewayList]( + gentype.NewClientWithList[*kubeovnv1.VpcNatGateway, *kubeovnv1.VpcNatGatewayList]( "vpc-nat-gateways", c.RESTClient(), scheme.ParameterCodec, "", - func() *v1.VpcNatGateway { return &v1.VpcNatGateway{} }, - func() *v1.VpcNatGatewayList { return &v1.VpcNatGatewayList{} }), + func() *kubeovnv1.VpcNatGateway { return &kubeovnv1.VpcNatGateway{} }, + func() *kubeovnv1.VpcNatGatewayList { return &kubeovnv1.VpcNatGatewayList{} }, + ), } } diff --git a/pkg/client/informers/externalversions/generic.go b/pkg/client/informers/externalversions/generic.go index 03bcdd8f8ef..01c67b1c70c 100644 --- a/pkg/client/informers/externalversions/generic.go +++ b/pkg/client/informers/externalversions/generic.go @@ -19,7 +19,7 @@ limitations under the License. package externalversions import ( - "fmt" + fmt "fmt" v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" schema "k8s.io/apimachinery/pkg/runtime/schema" diff --git a/pkg/client/informers/externalversions/kubeovn/v1/ip.go b/pkg/client/informers/externalversions/kubeovn/v1/ip.go index 37743e1390e..0e18d8eda38 100644 --- a/pkg/client/informers/externalversions/kubeovn/v1/ip.go +++ b/pkg/client/informers/externalversions/kubeovn/v1/ip.go @@ -19,13 +19,13 @@ limitations under the License. package v1 import ( - "context" + context "context" time "time" - kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + apiskubeovnv1 "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" + kubeovnv1 "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" @@ -36,7 +36,7 @@ import ( // IPs. type IPInformer interface { Informer() cache.SharedIndexInformer - Lister() v1.IPLister + Lister() kubeovnv1.IPLister } type iPInformer struct { @@ -70,7 +70,7 @@ func NewFilteredIPInformer(client versioned.Interface, resyncPeriod time.Duratio return client.KubeovnV1().IPs().Watch(context.TODO(), options) }, }, - &kubeovnv1.IP{}, + &apiskubeovnv1.IP{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *iPInformer) defaultInformer(client versioned.Interface, resyncPeriod ti } func (f *iPInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&kubeovnv1.IP{}, f.defaultInformer) + return f.factory.InformerFor(&apiskubeovnv1.IP{}, f.defaultInformer) } -func (f *iPInformer) Lister() v1.IPLister { - return v1.NewIPLister(f.Informer().GetIndexer()) +func (f *iPInformer) Lister() kubeovnv1.IPLister { + return kubeovnv1.NewIPLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/informers/externalversions/kubeovn/v1/ippool.go b/pkg/client/informers/externalversions/kubeovn/v1/ippool.go index ea6559ef6f6..2bdd317e6ce 100644 --- a/pkg/client/informers/externalversions/kubeovn/v1/ippool.go +++ b/pkg/client/informers/externalversions/kubeovn/v1/ippool.go @@ -19,13 +19,13 @@ limitations under the License. package v1 import ( - "context" + context "context" time "time" - kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + apiskubeovnv1 "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" + kubeovnv1 "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" @@ -36,7 +36,7 @@ import ( // IPPools. type IPPoolInformer interface { Informer() cache.SharedIndexInformer - Lister() v1.IPPoolLister + Lister() kubeovnv1.IPPoolLister } type iPPoolInformer struct { @@ -70,7 +70,7 @@ func NewFilteredIPPoolInformer(client versioned.Interface, resyncPeriod time.Dur return client.KubeovnV1().IPPools().Watch(context.TODO(), options) }, }, - &kubeovnv1.IPPool{}, + &apiskubeovnv1.IPPool{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *iPPoolInformer) defaultInformer(client versioned.Interface, resyncPerio } func (f *iPPoolInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&kubeovnv1.IPPool{}, f.defaultInformer) + return f.factory.InformerFor(&apiskubeovnv1.IPPool{}, f.defaultInformer) } -func (f *iPPoolInformer) Lister() v1.IPPoolLister { - return v1.NewIPPoolLister(f.Informer().GetIndexer()) +func (f *iPPoolInformer) Lister() kubeovnv1.IPPoolLister { + return kubeovnv1.NewIPPoolLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/informers/externalversions/kubeovn/v1/iptablesdnatrule.go b/pkg/client/informers/externalversions/kubeovn/v1/iptablesdnatrule.go index 48bdd4e5851..9c7486eb1fd 100644 --- a/pkg/client/informers/externalversions/kubeovn/v1/iptablesdnatrule.go +++ b/pkg/client/informers/externalversions/kubeovn/v1/iptablesdnatrule.go @@ -19,13 +19,13 @@ limitations under the License. package v1 import ( - "context" + context "context" time "time" - kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + apiskubeovnv1 "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" + kubeovnv1 "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" @@ -36,7 +36,7 @@ import ( // IptablesDnatRules. type IptablesDnatRuleInformer interface { Informer() cache.SharedIndexInformer - Lister() v1.IptablesDnatRuleLister + Lister() kubeovnv1.IptablesDnatRuleLister } type iptablesDnatRuleInformer struct { @@ -70,7 +70,7 @@ func NewFilteredIptablesDnatRuleInformer(client versioned.Interface, resyncPerio return client.KubeovnV1().IptablesDnatRules().Watch(context.TODO(), options) }, }, - &kubeovnv1.IptablesDnatRule{}, + &apiskubeovnv1.IptablesDnatRule{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *iptablesDnatRuleInformer) defaultInformer(client versioned.Interface, r } func (f *iptablesDnatRuleInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&kubeovnv1.IptablesDnatRule{}, f.defaultInformer) + return f.factory.InformerFor(&apiskubeovnv1.IptablesDnatRule{}, f.defaultInformer) } -func (f *iptablesDnatRuleInformer) Lister() v1.IptablesDnatRuleLister { - return v1.NewIptablesDnatRuleLister(f.Informer().GetIndexer()) +func (f *iptablesDnatRuleInformer) Lister() kubeovnv1.IptablesDnatRuleLister { + return kubeovnv1.NewIptablesDnatRuleLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/informers/externalversions/kubeovn/v1/iptableseip.go b/pkg/client/informers/externalversions/kubeovn/v1/iptableseip.go index a624ddee327..466ceab0588 100644 --- a/pkg/client/informers/externalversions/kubeovn/v1/iptableseip.go +++ b/pkg/client/informers/externalversions/kubeovn/v1/iptableseip.go @@ -19,13 +19,13 @@ limitations under the License. package v1 import ( - "context" + context "context" time "time" - kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + apiskubeovnv1 "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" + kubeovnv1 "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" @@ -36,7 +36,7 @@ import ( // IptablesEIPs. type IptablesEIPInformer interface { Informer() cache.SharedIndexInformer - Lister() v1.IptablesEIPLister + Lister() kubeovnv1.IptablesEIPLister } type iptablesEIPInformer struct { @@ -70,7 +70,7 @@ func NewFilteredIptablesEIPInformer(client versioned.Interface, resyncPeriod tim return client.KubeovnV1().IptablesEIPs().Watch(context.TODO(), options) }, }, - &kubeovnv1.IptablesEIP{}, + &apiskubeovnv1.IptablesEIP{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *iptablesEIPInformer) defaultInformer(client versioned.Interface, resync } func (f *iptablesEIPInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&kubeovnv1.IptablesEIP{}, f.defaultInformer) + return f.factory.InformerFor(&apiskubeovnv1.IptablesEIP{}, f.defaultInformer) } -func (f *iptablesEIPInformer) Lister() v1.IptablesEIPLister { - return v1.NewIptablesEIPLister(f.Informer().GetIndexer()) +func (f *iptablesEIPInformer) Lister() kubeovnv1.IptablesEIPLister { + return kubeovnv1.NewIptablesEIPLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/informers/externalversions/kubeovn/v1/iptablesfiprule.go b/pkg/client/informers/externalversions/kubeovn/v1/iptablesfiprule.go index 44a547fb274..8e5264b3eec 100644 --- a/pkg/client/informers/externalversions/kubeovn/v1/iptablesfiprule.go +++ b/pkg/client/informers/externalversions/kubeovn/v1/iptablesfiprule.go @@ -19,13 +19,13 @@ limitations under the License. package v1 import ( - "context" + context "context" time "time" - kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + apiskubeovnv1 "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" + kubeovnv1 "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" @@ -36,7 +36,7 @@ import ( // IptablesFIPRules. type IptablesFIPRuleInformer interface { Informer() cache.SharedIndexInformer - Lister() v1.IptablesFIPRuleLister + Lister() kubeovnv1.IptablesFIPRuleLister } type iptablesFIPRuleInformer struct { @@ -70,7 +70,7 @@ func NewFilteredIptablesFIPRuleInformer(client versioned.Interface, resyncPeriod return client.KubeovnV1().IptablesFIPRules().Watch(context.TODO(), options) }, }, - &kubeovnv1.IptablesFIPRule{}, + &apiskubeovnv1.IptablesFIPRule{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *iptablesFIPRuleInformer) defaultInformer(client versioned.Interface, re } func (f *iptablesFIPRuleInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&kubeovnv1.IptablesFIPRule{}, f.defaultInformer) + return f.factory.InformerFor(&apiskubeovnv1.IptablesFIPRule{}, f.defaultInformer) } -func (f *iptablesFIPRuleInformer) Lister() v1.IptablesFIPRuleLister { - return v1.NewIptablesFIPRuleLister(f.Informer().GetIndexer()) +func (f *iptablesFIPRuleInformer) Lister() kubeovnv1.IptablesFIPRuleLister { + return kubeovnv1.NewIptablesFIPRuleLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/informers/externalversions/kubeovn/v1/iptablessnatrule.go b/pkg/client/informers/externalversions/kubeovn/v1/iptablessnatrule.go index 8ae4adb8b7d..12aaf9c01c8 100644 --- a/pkg/client/informers/externalversions/kubeovn/v1/iptablessnatrule.go +++ b/pkg/client/informers/externalversions/kubeovn/v1/iptablessnatrule.go @@ -19,13 +19,13 @@ limitations under the License. package v1 import ( - "context" + context "context" time "time" - kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + apiskubeovnv1 "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" + kubeovnv1 "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" @@ -36,7 +36,7 @@ import ( // IptablesSnatRules. type IptablesSnatRuleInformer interface { Informer() cache.SharedIndexInformer - Lister() v1.IptablesSnatRuleLister + Lister() kubeovnv1.IptablesSnatRuleLister } type iptablesSnatRuleInformer struct { @@ -70,7 +70,7 @@ func NewFilteredIptablesSnatRuleInformer(client versioned.Interface, resyncPerio return client.KubeovnV1().IptablesSnatRules().Watch(context.TODO(), options) }, }, - &kubeovnv1.IptablesSnatRule{}, + &apiskubeovnv1.IptablesSnatRule{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *iptablesSnatRuleInformer) defaultInformer(client versioned.Interface, r } func (f *iptablesSnatRuleInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&kubeovnv1.IptablesSnatRule{}, f.defaultInformer) + return f.factory.InformerFor(&apiskubeovnv1.IptablesSnatRule{}, f.defaultInformer) } -func (f *iptablesSnatRuleInformer) Lister() v1.IptablesSnatRuleLister { - return v1.NewIptablesSnatRuleLister(f.Informer().GetIndexer()) +func (f *iptablesSnatRuleInformer) Lister() kubeovnv1.IptablesSnatRuleLister { + return kubeovnv1.NewIptablesSnatRuleLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/informers/externalversions/kubeovn/v1/ovndnatrule.go b/pkg/client/informers/externalversions/kubeovn/v1/ovndnatrule.go index 8489533cfaa..f7ae80143fe 100644 --- a/pkg/client/informers/externalversions/kubeovn/v1/ovndnatrule.go +++ b/pkg/client/informers/externalversions/kubeovn/v1/ovndnatrule.go @@ -19,13 +19,13 @@ limitations under the License. package v1 import ( - "context" + context "context" time "time" - kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + apiskubeovnv1 "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" + kubeovnv1 "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" @@ -36,7 +36,7 @@ import ( // OvnDnatRules. type OvnDnatRuleInformer interface { Informer() cache.SharedIndexInformer - Lister() v1.OvnDnatRuleLister + Lister() kubeovnv1.OvnDnatRuleLister } type ovnDnatRuleInformer struct { @@ -70,7 +70,7 @@ func NewFilteredOvnDnatRuleInformer(client versioned.Interface, resyncPeriod tim return client.KubeovnV1().OvnDnatRules().Watch(context.TODO(), options) }, }, - &kubeovnv1.OvnDnatRule{}, + &apiskubeovnv1.OvnDnatRule{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *ovnDnatRuleInformer) defaultInformer(client versioned.Interface, resync } func (f *ovnDnatRuleInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&kubeovnv1.OvnDnatRule{}, f.defaultInformer) + return f.factory.InformerFor(&apiskubeovnv1.OvnDnatRule{}, f.defaultInformer) } -func (f *ovnDnatRuleInformer) Lister() v1.OvnDnatRuleLister { - return v1.NewOvnDnatRuleLister(f.Informer().GetIndexer()) +func (f *ovnDnatRuleInformer) Lister() kubeovnv1.OvnDnatRuleLister { + return kubeovnv1.NewOvnDnatRuleLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/informers/externalversions/kubeovn/v1/ovneip.go b/pkg/client/informers/externalversions/kubeovn/v1/ovneip.go index 89d5353e2de..3664ec7b9c4 100644 --- a/pkg/client/informers/externalversions/kubeovn/v1/ovneip.go +++ b/pkg/client/informers/externalversions/kubeovn/v1/ovneip.go @@ -19,13 +19,13 @@ limitations under the License. package v1 import ( - "context" + context "context" time "time" - kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + apiskubeovnv1 "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" + kubeovnv1 "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" @@ -36,7 +36,7 @@ import ( // OvnEips. type OvnEipInformer interface { Informer() cache.SharedIndexInformer - Lister() v1.OvnEipLister + Lister() kubeovnv1.OvnEipLister } type ovnEipInformer struct { @@ -70,7 +70,7 @@ func NewFilteredOvnEipInformer(client versioned.Interface, resyncPeriod time.Dur return client.KubeovnV1().OvnEips().Watch(context.TODO(), options) }, }, - &kubeovnv1.OvnEip{}, + &apiskubeovnv1.OvnEip{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *ovnEipInformer) defaultInformer(client versioned.Interface, resyncPerio } func (f *ovnEipInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&kubeovnv1.OvnEip{}, f.defaultInformer) + return f.factory.InformerFor(&apiskubeovnv1.OvnEip{}, f.defaultInformer) } -func (f *ovnEipInformer) Lister() v1.OvnEipLister { - return v1.NewOvnEipLister(f.Informer().GetIndexer()) +func (f *ovnEipInformer) Lister() kubeovnv1.OvnEipLister { + return kubeovnv1.NewOvnEipLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/informers/externalversions/kubeovn/v1/ovnfip.go b/pkg/client/informers/externalversions/kubeovn/v1/ovnfip.go index 8d582d92862..ae318ec82a2 100644 --- a/pkg/client/informers/externalversions/kubeovn/v1/ovnfip.go +++ b/pkg/client/informers/externalversions/kubeovn/v1/ovnfip.go @@ -19,13 +19,13 @@ limitations under the License. package v1 import ( - "context" + context "context" time "time" - kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + apiskubeovnv1 "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" + kubeovnv1 "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" @@ -36,7 +36,7 @@ import ( // OvnFips. type OvnFipInformer interface { Informer() cache.SharedIndexInformer - Lister() v1.OvnFipLister + Lister() kubeovnv1.OvnFipLister } type ovnFipInformer struct { @@ -70,7 +70,7 @@ func NewFilteredOvnFipInformer(client versioned.Interface, resyncPeriod time.Dur return client.KubeovnV1().OvnFips().Watch(context.TODO(), options) }, }, - &kubeovnv1.OvnFip{}, + &apiskubeovnv1.OvnFip{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *ovnFipInformer) defaultInformer(client versioned.Interface, resyncPerio } func (f *ovnFipInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&kubeovnv1.OvnFip{}, f.defaultInformer) + return f.factory.InformerFor(&apiskubeovnv1.OvnFip{}, f.defaultInformer) } -func (f *ovnFipInformer) Lister() v1.OvnFipLister { - return v1.NewOvnFipLister(f.Informer().GetIndexer()) +func (f *ovnFipInformer) Lister() kubeovnv1.OvnFipLister { + return kubeovnv1.NewOvnFipLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/informers/externalversions/kubeovn/v1/ovnsnatrule.go b/pkg/client/informers/externalversions/kubeovn/v1/ovnsnatrule.go index 676db376b8c..000c2a85cb2 100644 --- a/pkg/client/informers/externalversions/kubeovn/v1/ovnsnatrule.go +++ b/pkg/client/informers/externalversions/kubeovn/v1/ovnsnatrule.go @@ -19,13 +19,13 @@ limitations under the License. package v1 import ( - "context" + context "context" time "time" - kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + apiskubeovnv1 "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" + kubeovnv1 "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" @@ -36,7 +36,7 @@ import ( // OvnSnatRules. type OvnSnatRuleInformer interface { Informer() cache.SharedIndexInformer - Lister() v1.OvnSnatRuleLister + Lister() kubeovnv1.OvnSnatRuleLister } type ovnSnatRuleInformer struct { @@ -70,7 +70,7 @@ func NewFilteredOvnSnatRuleInformer(client versioned.Interface, resyncPeriod tim return client.KubeovnV1().OvnSnatRules().Watch(context.TODO(), options) }, }, - &kubeovnv1.OvnSnatRule{}, + &apiskubeovnv1.OvnSnatRule{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *ovnSnatRuleInformer) defaultInformer(client versioned.Interface, resync } func (f *ovnSnatRuleInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&kubeovnv1.OvnSnatRule{}, f.defaultInformer) + return f.factory.InformerFor(&apiskubeovnv1.OvnSnatRule{}, f.defaultInformer) } -func (f *ovnSnatRuleInformer) Lister() v1.OvnSnatRuleLister { - return v1.NewOvnSnatRuleLister(f.Informer().GetIndexer()) +func (f *ovnSnatRuleInformer) Lister() kubeovnv1.OvnSnatRuleLister { + return kubeovnv1.NewOvnSnatRuleLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/informers/externalversions/kubeovn/v1/providernetwork.go b/pkg/client/informers/externalversions/kubeovn/v1/providernetwork.go index 2a6d8bfdcd5..daf8d1a24d1 100644 --- a/pkg/client/informers/externalversions/kubeovn/v1/providernetwork.go +++ b/pkg/client/informers/externalversions/kubeovn/v1/providernetwork.go @@ -19,13 +19,13 @@ limitations under the License. package v1 import ( - "context" + context "context" time "time" - kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + apiskubeovnv1 "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" + kubeovnv1 "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" @@ -36,7 +36,7 @@ import ( // ProviderNetworks. type ProviderNetworkInformer interface { Informer() cache.SharedIndexInformer - Lister() v1.ProviderNetworkLister + Lister() kubeovnv1.ProviderNetworkLister } type providerNetworkInformer struct { @@ -70,7 +70,7 @@ func NewFilteredProviderNetworkInformer(client versioned.Interface, resyncPeriod return client.KubeovnV1().ProviderNetworks().Watch(context.TODO(), options) }, }, - &kubeovnv1.ProviderNetwork{}, + &apiskubeovnv1.ProviderNetwork{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *providerNetworkInformer) defaultInformer(client versioned.Interface, re } func (f *providerNetworkInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&kubeovnv1.ProviderNetwork{}, f.defaultInformer) + return f.factory.InformerFor(&apiskubeovnv1.ProviderNetwork{}, f.defaultInformer) } -func (f *providerNetworkInformer) Lister() v1.ProviderNetworkLister { - return v1.NewProviderNetworkLister(f.Informer().GetIndexer()) +func (f *providerNetworkInformer) Lister() kubeovnv1.ProviderNetworkLister { + return kubeovnv1.NewProviderNetworkLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/informers/externalversions/kubeovn/v1/qospolicy.go b/pkg/client/informers/externalversions/kubeovn/v1/qospolicy.go index de1c953a45b..df113d13d7b 100644 --- a/pkg/client/informers/externalversions/kubeovn/v1/qospolicy.go +++ b/pkg/client/informers/externalversions/kubeovn/v1/qospolicy.go @@ -19,13 +19,13 @@ limitations under the License. package v1 import ( - "context" + context "context" time "time" - kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + apiskubeovnv1 "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" + kubeovnv1 "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" @@ -36,7 +36,7 @@ import ( // QoSPolicies. type QoSPolicyInformer interface { Informer() cache.SharedIndexInformer - Lister() v1.QoSPolicyLister + Lister() kubeovnv1.QoSPolicyLister } type qoSPolicyInformer struct { @@ -70,7 +70,7 @@ func NewFilteredQoSPolicyInformer(client versioned.Interface, resyncPeriod time. return client.KubeovnV1().QoSPolicies().Watch(context.TODO(), options) }, }, - &kubeovnv1.QoSPolicy{}, + &apiskubeovnv1.QoSPolicy{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *qoSPolicyInformer) defaultInformer(client versioned.Interface, resyncPe } func (f *qoSPolicyInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&kubeovnv1.QoSPolicy{}, f.defaultInformer) + return f.factory.InformerFor(&apiskubeovnv1.QoSPolicy{}, f.defaultInformer) } -func (f *qoSPolicyInformer) Lister() v1.QoSPolicyLister { - return v1.NewQoSPolicyLister(f.Informer().GetIndexer()) +func (f *qoSPolicyInformer) Lister() kubeovnv1.QoSPolicyLister { + return kubeovnv1.NewQoSPolicyLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/informers/externalversions/kubeovn/v1/securitygroup.go b/pkg/client/informers/externalversions/kubeovn/v1/securitygroup.go index fc108011aa5..a29ab9c68ac 100644 --- a/pkg/client/informers/externalversions/kubeovn/v1/securitygroup.go +++ b/pkg/client/informers/externalversions/kubeovn/v1/securitygroup.go @@ -19,13 +19,13 @@ limitations under the License. package v1 import ( - "context" + context "context" time "time" - kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + apiskubeovnv1 "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" + kubeovnv1 "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" @@ -36,7 +36,7 @@ import ( // SecurityGroups. type SecurityGroupInformer interface { Informer() cache.SharedIndexInformer - Lister() v1.SecurityGroupLister + Lister() kubeovnv1.SecurityGroupLister } type securityGroupInformer struct { @@ -70,7 +70,7 @@ func NewFilteredSecurityGroupInformer(client versioned.Interface, resyncPeriod t return client.KubeovnV1().SecurityGroups().Watch(context.TODO(), options) }, }, - &kubeovnv1.SecurityGroup{}, + &apiskubeovnv1.SecurityGroup{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *securityGroupInformer) defaultInformer(client versioned.Interface, resy } func (f *securityGroupInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&kubeovnv1.SecurityGroup{}, f.defaultInformer) + return f.factory.InformerFor(&apiskubeovnv1.SecurityGroup{}, f.defaultInformer) } -func (f *securityGroupInformer) Lister() v1.SecurityGroupLister { - return v1.NewSecurityGroupLister(f.Informer().GetIndexer()) +func (f *securityGroupInformer) Lister() kubeovnv1.SecurityGroupLister { + return kubeovnv1.NewSecurityGroupLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/informers/externalversions/kubeovn/v1/subnet.go b/pkg/client/informers/externalversions/kubeovn/v1/subnet.go index 8a185ef0d55..42d2e0bac69 100644 --- a/pkg/client/informers/externalversions/kubeovn/v1/subnet.go +++ b/pkg/client/informers/externalversions/kubeovn/v1/subnet.go @@ -19,13 +19,13 @@ limitations under the License. package v1 import ( - "context" + context "context" time "time" - kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + apiskubeovnv1 "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" + kubeovnv1 "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" @@ -36,7 +36,7 @@ import ( // Subnets. type SubnetInformer interface { Informer() cache.SharedIndexInformer - Lister() v1.SubnetLister + Lister() kubeovnv1.SubnetLister } type subnetInformer struct { @@ -70,7 +70,7 @@ func NewFilteredSubnetInformer(client versioned.Interface, resyncPeriod time.Dur return client.KubeovnV1().Subnets().Watch(context.TODO(), options) }, }, - &kubeovnv1.Subnet{}, + &apiskubeovnv1.Subnet{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *subnetInformer) defaultInformer(client versioned.Interface, resyncPerio } func (f *subnetInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&kubeovnv1.Subnet{}, f.defaultInformer) + return f.factory.InformerFor(&apiskubeovnv1.Subnet{}, f.defaultInformer) } -func (f *subnetInformer) Lister() v1.SubnetLister { - return v1.NewSubnetLister(f.Informer().GetIndexer()) +func (f *subnetInformer) Lister() kubeovnv1.SubnetLister { + return kubeovnv1.NewSubnetLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/informers/externalversions/kubeovn/v1/switchlbrule.go b/pkg/client/informers/externalversions/kubeovn/v1/switchlbrule.go index 5f2794bb246..00396d8c464 100644 --- a/pkg/client/informers/externalversions/kubeovn/v1/switchlbrule.go +++ b/pkg/client/informers/externalversions/kubeovn/v1/switchlbrule.go @@ -19,13 +19,13 @@ limitations under the License. package v1 import ( - "context" + context "context" time "time" - kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + apiskubeovnv1 "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" + kubeovnv1 "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" @@ -36,7 +36,7 @@ import ( // SwitchLBRules. type SwitchLBRuleInformer interface { Informer() cache.SharedIndexInformer - Lister() v1.SwitchLBRuleLister + Lister() kubeovnv1.SwitchLBRuleLister } type switchLBRuleInformer struct { @@ -70,7 +70,7 @@ func NewFilteredSwitchLBRuleInformer(client versioned.Interface, resyncPeriod ti return client.KubeovnV1().SwitchLBRules().Watch(context.TODO(), options) }, }, - &kubeovnv1.SwitchLBRule{}, + &apiskubeovnv1.SwitchLBRule{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *switchLBRuleInformer) defaultInformer(client versioned.Interface, resyn } func (f *switchLBRuleInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&kubeovnv1.SwitchLBRule{}, f.defaultInformer) + return f.factory.InformerFor(&apiskubeovnv1.SwitchLBRule{}, f.defaultInformer) } -func (f *switchLBRuleInformer) Lister() v1.SwitchLBRuleLister { - return v1.NewSwitchLBRuleLister(f.Informer().GetIndexer()) +func (f *switchLBRuleInformer) Lister() kubeovnv1.SwitchLBRuleLister { + return kubeovnv1.NewSwitchLBRuleLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/informers/externalversions/kubeovn/v1/vip.go b/pkg/client/informers/externalversions/kubeovn/v1/vip.go index 30932f68f31..98216cb94ae 100644 --- a/pkg/client/informers/externalversions/kubeovn/v1/vip.go +++ b/pkg/client/informers/externalversions/kubeovn/v1/vip.go @@ -19,13 +19,13 @@ limitations under the License. package v1 import ( - "context" + context "context" time "time" - kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + apiskubeovnv1 "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" + kubeovnv1 "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" @@ -36,7 +36,7 @@ import ( // Vips. type VipInformer interface { Informer() cache.SharedIndexInformer - Lister() v1.VipLister + Lister() kubeovnv1.VipLister } type vipInformer struct { @@ -70,7 +70,7 @@ func NewFilteredVipInformer(client versioned.Interface, resyncPeriod time.Durati return client.KubeovnV1().Vips().Watch(context.TODO(), options) }, }, - &kubeovnv1.Vip{}, + &apiskubeovnv1.Vip{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *vipInformer) defaultInformer(client versioned.Interface, resyncPeriod t } func (f *vipInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&kubeovnv1.Vip{}, f.defaultInformer) + return f.factory.InformerFor(&apiskubeovnv1.Vip{}, f.defaultInformer) } -func (f *vipInformer) Lister() v1.VipLister { - return v1.NewVipLister(f.Informer().GetIndexer()) +func (f *vipInformer) Lister() kubeovnv1.VipLister { + return kubeovnv1.NewVipLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/informers/externalversions/kubeovn/v1/vlan.go b/pkg/client/informers/externalversions/kubeovn/v1/vlan.go index 498bfa28f88..1fb2308727c 100644 --- a/pkg/client/informers/externalversions/kubeovn/v1/vlan.go +++ b/pkg/client/informers/externalversions/kubeovn/v1/vlan.go @@ -19,13 +19,13 @@ limitations under the License. package v1 import ( - "context" + context "context" time "time" - kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + apiskubeovnv1 "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" + kubeovnv1 "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" @@ -36,7 +36,7 @@ import ( // Vlans. type VlanInformer interface { Informer() cache.SharedIndexInformer - Lister() v1.VlanLister + Lister() kubeovnv1.VlanLister } type vlanInformer struct { @@ -70,7 +70,7 @@ func NewFilteredVlanInformer(client versioned.Interface, resyncPeriod time.Durat return client.KubeovnV1().Vlans().Watch(context.TODO(), options) }, }, - &kubeovnv1.Vlan{}, + &apiskubeovnv1.Vlan{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *vlanInformer) defaultInformer(client versioned.Interface, resyncPeriod } func (f *vlanInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&kubeovnv1.Vlan{}, f.defaultInformer) + return f.factory.InformerFor(&apiskubeovnv1.Vlan{}, f.defaultInformer) } -func (f *vlanInformer) Lister() v1.VlanLister { - return v1.NewVlanLister(f.Informer().GetIndexer()) +func (f *vlanInformer) Lister() kubeovnv1.VlanLister { + return kubeovnv1.NewVlanLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/informers/externalversions/kubeovn/v1/vpc.go b/pkg/client/informers/externalversions/kubeovn/v1/vpc.go index 029578d4e7c..65055a51dc7 100644 --- a/pkg/client/informers/externalversions/kubeovn/v1/vpc.go +++ b/pkg/client/informers/externalversions/kubeovn/v1/vpc.go @@ -19,13 +19,13 @@ limitations under the License. package v1 import ( - "context" + context "context" time "time" - kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + apiskubeovnv1 "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" + kubeovnv1 "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" @@ -36,7 +36,7 @@ import ( // Vpcs. type VpcInformer interface { Informer() cache.SharedIndexInformer - Lister() v1.VpcLister + Lister() kubeovnv1.VpcLister } type vpcInformer struct { @@ -70,7 +70,7 @@ func NewFilteredVpcInformer(client versioned.Interface, resyncPeriod time.Durati return client.KubeovnV1().Vpcs().Watch(context.TODO(), options) }, }, - &kubeovnv1.Vpc{}, + &apiskubeovnv1.Vpc{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *vpcInformer) defaultInformer(client versioned.Interface, resyncPeriod t } func (f *vpcInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&kubeovnv1.Vpc{}, f.defaultInformer) + return f.factory.InformerFor(&apiskubeovnv1.Vpc{}, f.defaultInformer) } -func (f *vpcInformer) Lister() v1.VpcLister { - return v1.NewVpcLister(f.Informer().GetIndexer()) +func (f *vpcInformer) Lister() kubeovnv1.VpcLister { + return kubeovnv1.NewVpcLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/informers/externalversions/kubeovn/v1/vpcdns.go b/pkg/client/informers/externalversions/kubeovn/v1/vpcdns.go index 57ec5af21e5..b14b0db6e21 100644 --- a/pkg/client/informers/externalversions/kubeovn/v1/vpcdns.go +++ b/pkg/client/informers/externalversions/kubeovn/v1/vpcdns.go @@ -19,13 +19,13 @@ limitations under the License. package v1 import ( - "context" + context "context" time "time" - kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + apiskubeovnv1 "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" + kubeovnv1 "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" @@ -36,7 +36,7 @@ import ( // VpcDnses. type VpcDnsInformer interface { Informer() cache.SharedIndexInformer - Lister() v1.VpcDnsLister + Lister() kubeovnv1.VpcDnsLister } type vpcDnsInformer struct { @@ -70,7 +70,7 @@ func NewFilteredVpcDnsInformer(client versioned.Interface, resyncPeriod time.Dur return client.KubeovnV1().VpcDnses().Watch(context.TODO(), options) }, }, - &kubeovnv1.VpcDns{}, + &apiskubeovnv1.VpcDns{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *vpcDnsInformer) defaultInformer(client versioned.Interface, resyncPerio } func (f *vpcDnsInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&kubeovnv1.VpcDns{}, f.defaultInformer) + return f.factory.InformerFor(&apiskubeovnv1.VpcDns{}, f.defaultInformer) } -func (f *vpcDnsInformer) Lister() v1.VpcDnsLister { - return v1.NewVpcDnsLister(f.Informer().GetIndexer()) +func (f *vpcDnsInformer) Lister() kubeovnv1.VpcDnsLister { + return kubeovnv1.NewVpcDnsLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/informers/externalversions/kubeovn/v1/vpcegressgateway.go b/pkg/client/informers/externalversions/kubeovn/v1/vpcegressgateway.go index aa8f3e94067..bf820c2b561 100644 --- a/pkg/client/informers/externalversions/kubeovn/v1/vpcegressgateway.go +++ b/pkg/client/informers/externalversions/kubeovn/v1/vpcegressgateway.go @@ -19,13 +19,13 @@ limitations under the License. package v1 import ( - "context" + context "context" time "time" - kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + apiskubeovnv1 "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" + kubeovnv1 "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" @@ -36,7 +36,7 @@ import ( // VpcEgressGateways. type VpcEgressGatewayInformer interface { Informer() cache.SharedIndexInformer - Lister() v1.VpcEgressGatewayLister + Lister() kubeovnv1.VpcEgressGatewayLister } type vpcEgressGatewayInformer struct { @@ -71,7 +71,7 @@ func NewFilteredVpcEgressGatewayInformer(client versioned.Interface, namespace s return client.KubeovnV1().VpcEgressGateways(namespace).Watch(context.TODO(), options) }, }, - &kubeovnv1.VpcEgressGateway{}, + &apiskubeovnv1.VpcEgressGateway{}, resyncPeriod, indexers, ) @@ -82,9 +82,9 @@ func (f *vpcEgressGatewayInformer) defaultInformer(client versioned.Interface, r } func (f *vpcEgressGatewayInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&kubeovnv1.VpcEgressGateway{}, f.defaultInformer) + return f.factory.InformerFor(&apiskubeovnv1.VpcEgressGateway{}, f.defaultInformer) } -func (f *vpcEgressGatewayInformer) Lister() v1.VpcEgressGatewayLister { - return v1.NewVpcEgressGatewayLister(f.Informer().GetIndexer()) +func (f *vpcEgressGatewayInformer) Lister() kubeovnv1.VpcEgressGatewayLister { + return kubeovnv1.NewVpcEgressGatewayLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/informers/externalversions/kubeovn/v1/vpcnatgateway.go b/pkg/client/informers/externalversions/kubeovn/v1/vpcnatgateway.go index 2c9a1639c15..fb1a938366e 100644 --- a/pkg/client/informers/externalversions/kubeovn/v1/vpcnatgateway.go +++ b/pkg/client/informers/externalversions/kubeovn/v1/vpcnatgateway.go @@ -19,13 +19,13 @@ limitations under the License. package v1 import ( - "context" + context "context" time "time" - kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + apiskubeovnv1 "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" + kubeovnv1 "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" @@ -36,7 +36,7 @@ import ( // VpcNatGateways. type VpcNatGatewayInformer interface { Informer() cache.SharedIndexInformer - Lister() v1.VpcNatGatewayLister + Lister() kubeovnv1.VpcNatGatewayLister } type vpcNatGatewayInformer struct { @@ -70,7 +70,7 @@ func NewFilteredVpcNatGatewayInformer(client versioned.Interface, resyncPeriod t return client.KubeovnV1().VpcNatGateways().Watch(context.TODO(), options) }, }, - &kubeovnv1.VpcNatGateway{}, + &apiskubeovnv1.VpcNatGateway{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *vpcNatGatewayInformer) defaultInformer(client versioned.Interface, resy } func (f *vpcNatGatewayInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&kubeovnv1.VpcNatGateway{}, f.defaultInformer) + return f.factory.InformerFor(&apiskubeovnv1.VpcNatGateway{}, f.defaultInformer) } -func (f *vpcNatGatewayInformer) Lister() v1.VpcNatGatewayLister { - return v1.NewVpcNatGatewayLister(f.Informer().GetIndexer()) +func (f *vpcNatGatewayInformer) Lister() kubeovnv1.VpcNatGatewayLister { + return kubeovnv1.NewVpcNatGatewayLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/listers/kubeovn/v1/ip.go b/pkg/client/listers/kubeovn/v1/ip.go index e32e6099ee9..e14a46ff9e7 100644 --- a/pkg/client/listers/kubeovn/v1/ip.go +++ b/pkg/client/listers/kubeovn/v1/ip.go @@ -19,10 +19,10 @@ limitations under the License. package v1 import ( - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // IPLister helps list IPs. @@ -30,19 +30,19 @@ import ( type IPLister interface { // List lists all IPs in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.IP, err error) + List(selector labels.Selector) (ret []*kubeovnv1.IP, err error) // Get retrieves the IP from the index for a given name. // Objects returned here must be treated as read-only. - Get(name string) (*v1.IP, error) + Get(name string) (*kubeovnv1.IP, error) IPListerExpansion } // iPLister implements the IPLister interface. type iPLister struct { - listers.ResourceIndexer[*v1.IP] + listers.ResourceIndexer[*kubeovnv1.IP] } // NewIPLister returns a new IPLister. func NewIPLister(indexer cache.Indexer) IPLister { - return &iPLister{listers.New[*v1.IP](indexer, v1.Resource("ip"))} + return &iPLister{listers.New[*kubeovnv1.IP](indexer, kubeovnv1.Resource("ip"))} } diff --git a/pkg/client/listers/kubeovn/v1/ippool.go b/pkg/client/listers/kubeovn/v1/ippool.go index cfb6329f8d3..538e40e53e2 100644 --- a/pkg/client/listers/kubeovn/v1/ippool.go +++ b/pkg/client/listers/kubeovn/v1/ippool.go @@ -19,10 +19,10 @@ limitations under the License. package v1 import ( - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // IPPoolLister helps list IPPools. @@ -30,19 +30,19 @@ import ( type IPPoolLister interface { // List lists all IPPools in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.IPPool, err error) + List(selector labels.Selector) (ret []*kubeovnv1.IPPool, err error) // Get retrieves the IPPool from the index for a given name. // Objects returned here must be treated as read-only. - Get(name string) (*v1.IPPool, error) + Get(name string) (*kubeovnv1.IPPool, error) IPPoolListerExpansion } // iPPoolLister implements the IPPoolLister interface. type iPPoolLister struct { - listers.ResourceIndexer[*v1.IPPool] + listers.ResourceIndexer[*kubeovnv1.IPPool] } // NewIPPoolLister returns a new IPPoolLister. func NewIPPoolLister(indexer cache.Indexer) IPPoolLister { - return &iPPoolLister{listers.New[*v1.IPPool](indexer, v1.Resource("ippool"))} + return &iPPoolLister{listers.New[*kubeovnv1.IPPool](indexer, kubeovnv1.Resource("ippool"))} } diff --git a/pkg/client/listers/kubeovn/v1/iptablesdnatrule.go b/pkg/client/listers/kubeovn/v1/iptablesdnatrule.go index 94e98336ef8..d3bdf9b3d0d 100644 --- a/pkg/client/listers/kubeovn/v1/iptablesdnatrule.go +++ b/pkg/client/listers/kubeovn/v1/iptablesdnatrule.go @@ -19,10 +19,10 @@ limitations under the License. package v1 import ( - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // IptablesDnatRuleLister helps list IptablesDnatRules. @@ -30,19 +30,19 @@ import ( type IptablesDnatRuleLister interface { // List lists all IptablesDnatRules in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.IptablesDnatRule, err error) + List(selector labels.Selector) (ret []*kubeovnv1.IptablesDnatRule, err error) // Get retrieves the IptablesDnatRule from the index for a given name. // Objects returned here must be treated as read-only. - Get(name string) (*v1.IptablesDnatRule, error) + Get(name string) (*kubeovnv1.IptablesDnatRule, error) IptablesDnatRuleListerExpansion } // iptablesDnatRuleLister implements the IptablesDnatRuleLister interface. type iptablesDnatRuleLister struct { - listers.ResourceIndexer[*v1.IptablesDnatRule] + listers.ResourceIndexer[*kubeovnv1.IptablesDnatRule] } // NewIptablesDnatRuleLister returns a new IptablesDnatRuleLister. func NewIptablesDnatRuleLister(indexer cache.Indexer) IptablesDnatRuleLister { - return &iptablesDnatRuleLister{listers.New[*v1.IptablesDnatRule](indexer, v1.Resource("iptablesdnatrule"))} + return &iptablesDnatRuleLister{listers.New[*kubeovnv1.IptablesDnatRule](indexer, kubeovnv1.Resource("iptablesdnatrule"))} } diff --git a/pkg/client/listers/kubeovn/v1/iptableseip.go b/pkg/client/listers/kubeovn/v1/iptableseip.go index 160e8c5f586..b5860fd646b 100644 --- a/pkg/client/listers/kubeovn/v1/iptableseip.go +++ b/pkg/client/listers/kubeovn/v1/iptableseip.go @@ -19,10 +19,10 @@ limitations under the License. package v1 import ( - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // IptablesEIPLister helps list IptablesEIPs. @@ -30,19 +30,19 @@ import ( type IptablesEIPLister interface { // List lists all IptablesEIPs in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.IptablesEIP, err error) + List(selector labels.Selector) (ret []*kubeovnv1.IptablesEIP, err error) // Get retrieves the IptablesEIP from the index for a given name. // Objects returned here must be treated as read-only. - Get(name string) (*v1.IptablesEIP, error) + Get(name string) (*kubeovnv1.IptablesEIP, error) IptablesEIPListerExpansion } // iptablesEIPLister implements the IptablesEIPLister interface. type iptablesEIPLister struct { - listers.ResourceIndexer[*v1.IptablesEIP] + listers.ResourceIndexer[*kubeovnv1.IptablesEIP] } // NewIptablesEIPLister returns a new IptablesEIPLister. func NewIptablesEIPLister(indexer cache.Indexer) IptablesEIPLister { - return &iptablesEIPLister{listers.New[*v1.IptablesEIP](indexer, v1.Resource("iptableseip"))} + return &iptablesEIPLister{listers.New[*kubeovnv1.IptablesEIP](indexer, kubeovnv1.Resource("iptableseip"))} } diff --git a/pkg/client/listers/kubeovn/v1/iptablesfiprule.go b/pkg/client/listers/kubeovn/v1/iptablesfiprule.go index d97baf245d3..8bc48f34508 100644 --- a/pkg/client/listers/kubeovn/v1/iptablesfiprule.go +++ b/pkg/client/listers/kubeovn/v1/iptablesfiprule.go @@ -19,10 +19,10 @@ limitations under the License. package v1 import ( - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // IptablesFIPRuleLister helps list IptablesFIPRules. @@ -30,19 +30,19 @@ import ( type IptablesFIPRuleLister interface { // List lists all IptablesFIPRules in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.IptablesFIPRule, err error) + List(selector labels.Selector) (ret []*kubeovnv1.IptablesFIPRule, err error) // Get retrieves the IptablesFIPRule from the index for a given name. // Objects returned here must be treated as read-only. - Get(name string) (*v1.IptablesFIPRule, error) + Get(name string) (*kubeovnv1.IptablesFIPRule, error) IptablesFIPRuleListerExpansion } // iptablesFIPRuleLister implements the IptablesFIPRuleLister interface. type iptablesFIPRuleLister struct { - listers.ResourceIndexer[*v1.IptablesFIPRule] + listers.ResourceIndexer[*kubeovnv1.IptablesFIPRule] } // NewIptablesFIPRuleLister returns a new IptablesFIPRuleLister. func NewIptablesFIPRuleLister(indexer cache.Indexer) IptablesFIPRuleLister { - return &iptablesFIPRuleLister{listers.New[*v1.IptablesFIPRule](indexer, v1.Resource("iptablesfiprule"))} + return &iptablesFIPRuleLister{listers.New[*kubeovnv1.IptablesFIPRule](indexer, kubeovnv1.Resource("iptablesfiprule"))} } diff --git a/pkg/client/listers/kubeovn/v1/iptablessnatrule.go b/pkg/client/listers/kubeovn/v1/iptablessnatrule.go index cc81db98247..9afebeabc5f 100644 --- a/pkg/client/listers/kubeovn/v1/iptablessnatrule.go +++ b/pkg/client/listers/kubeovn/v1/iptablessnatrule.go @@ -19,10 +19,10 @@ limitations under the License. package v1 import ( - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // IptablesSnatRuleLister helps list IptablesSnatRules. @@ -30,19 +30,19 @@ import ( type IptablesSnatRuleLister interface { // List lists all IptablesSnatRules in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.IptablesSnatRule, err error) + List(selector labels.Selector) (ret []*kubeovnv1.IptablesSnatRule, err error) // Get retrieves the IptablesSnatRule from the index for a given name. // Objects returned here must be treated as read-only. - Get(name string) (*v1.IptablesSnatRule, error) + Get(name string) (*kubeovnv1.IptablesSnatRule, error) IptablesSnatRuleListerExpansion } // iptablesSnatRuleLister implements the IptablesSnatRuleLister interface. type iptablesSnatRuleLister struct { - listers.ResourceIndexer[*v1.IptablesSnatRule] + listers.ResourceIndexer[*kubeovnv1.IptablesSnatRule] } // NewIptablesSnatRuleLister returns a new IptablesSnatRuleLister. func NewIptablesSnatRuleLister(indexer cache.Indexer) IptablesSnatRuleLister { - return &iptablesSnatRuleLister{listers.New[*v1.IptablesSnatRule](indexer, v1.Resource("iptablessnatrule"))} + return &iptablesSnatRuleLister{listers.New[*kubeovnv1.IptablesSnatRule](indexer, kubeovnv1.Resource("iptablessnatrule"))} } diff --git a/pkg/client/listers/kubeovn/v1/ovndnatrule.go b/pkg/client/listers/kubeovn/v1/ovndnatrule.go index fd17243985f..22cbbaf5528 100644 --- a/pkg/client/listers/kubeovn/v1/ovndnatrule.go +++ b/pkg/client/listers/kubeovn/v1/ovndnatrule.go @@ -19,10 +19,10 @@ limitations under the License. package v1 import ( - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // OvnDnatRuleLister helps list OvnDnatRules. @@ -30,19 +30,19 @@ import ( type OvnDnatRuleLister interface { // List lists all OvnDnatRules in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.OvnDnatRule, err error) + List(selector labels.Selector) (ret []*kubeovnv1.OvnDnatRule, err error) // Get retrieves the OvnDnatRule from the index for a given name. // Objects returned here must be treated as read-only. - Get(name string) (*v1.OvnDnatRule, error) + Get(name string) (*kubeovnv1.OvnDnatRule, error) OvnDnatRuleListerExpansion } // ovnDnatRuleLister implements the OvnDnatRuleLister interface. type ovnDnatRuleLister struct { - listers.ResourceIndexer[*v1.OvnDnatRule] + listers.ResourceIndexer[*kubeovnv1.OvnDnatRule] } // NewOvnDnatRuleLister returns a new OvnDnatRuleLister. func NewOvnDnatRuleLister(indexer cache.Indexer) OvnDnatRuleLister { - return &ovnDnatRuleLister{listers.New[*v1.OvnDnatRule](indexer, v1.Resource("ovndnatrule"))} + return &ovnDnatRuleLister{listers.New[*kubeovnv1.OvnDnatRule](indexer, kubeovnv1.Resource("ovndnatrule"))} } diff --git a/pkg/client/listers/kubeovn/v1/ovneip.go b/pkg/client/listers/kubeovn/v1/ovneip.go index 1f5ac201242..6b0e5286525 100644 --- a/pkg/client/listers/kubeovn/v1/ovneip.go +++ b/pkg/client/listers/kubeovn/v1/ovneip.go @@ -19,10 +19,10 @@ limitations under the License. package v1 import ( - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // OvnEipLister helps list OvnEips. @@ -30,19 +30,19 @@ import ( type OvnEipLister interface { // List lists all OvnEips in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.OvnEip, err error) + List(selector labels.Selector) (ret []*kubeovnv1.OvnEip, err error) // Get retrieves the OvnEip from the index for a given name. // Objects returned here must be treated as read-only. - Get(name string) (*v1.OvnEip, error) + Get(name string) (*kubeovnv1.OvnEip, error) OvnEipListerExpansion } // ovnEipLister implements the OvnEipLister interface. type ovnEipLister struct { - listers.ResourceIndexer[*v1.OvnEip] + listers.ResourceIndexer[*kubeovnv1.OvnEip] } // NewOvnEipLister returns a new OvnEipLister. func NewOvnEipLister(indexer cache.Indexer) OvnEipLister { - return &ovnEipLister{listers.New[*v1.OvnEip](indexer, v1.Resource("ovneip"))} + return &ovnEipLister{listers.New[*kubeovnv1.OvnEip](indexer, kubeovnv1.Resource("ovneip"))} } diff --git a/pkg/client/listers/kubeovn/v1/ovnfip.go b/pkg/client/listers/kubeovn/v1/ovnfip.go index a7276b125ee..89f44f0badd 100644 --- a/pkg/client/listers/kubeovn/v1/ovnfip.go +++ b/pkg/client/listers/kubeovn/v1/ovnfip.go @@ -19,10 +19,10 @@ limitations under the License. package v1 import ( - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // OvnFipLister helps list OvnFips. @@ -30,19 +30,19 @@ import ( type OvnFipLister interface { // List lists all OvnFips in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.OvnFip, err error) + List(selector labels.Selector) (ret []*kubeovnv1.OvnFip, err error) // Get retrieves the OvnFip from the index for a given name. // Objects returned here must be treated as read-only. - Get(name string) (*v1.OvnFip, error) + Get(name string) (*kubeovnv1.OvnFip, error) OvnFipListerExpansion } // ovnFipLister implements the OvnFipLister interface. type ovnFipLister struct { - listers.ResourceIndexer[*v1.OvnFip] + listers.ResourceIndexer[*kubeovnv1.OvnFip] } // NewOvnFipLister returns a new OvnFipLister. func NewOvnFipLister(indexer cache.Indexer) OvnFipLister { - return &ovnFipLister{listers.New[*v1.OvnFip](indexer, v1.Resource("ovnfip"))} + return &ovnFipLister{listers.New[*kubeovnv1.OvnFip](indexer, kubeovnv1.Resource("ovnfip"))} } diff --git a/pkg/client/listers/kubeovn/v1/ovnsnatrule.go b/pkg/client/listers/kubeovn/v1/ovnsnatrule.go index 5944b06bd6f..bd7d79ebcbe 100644 --- a/pkg/client/listers/kubeovn/v1/ovnsnatrule.go +++ b/pkg/client/listers/kubeovn/v1/ovnsnatrule.go @@ -19,10 +19,10 @@ limitations under the License. package v1 import ( - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // OvnSnatRuleLister helps list OvnSnatRules. @@ -30,19 +30,19 @@ import ( type OvnSnatRuleLister interface { // List lists all OvnSnatRules in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.OvnSnatRule, err error) + List(selector labels.Selector) (ret []*kubeovnv1.OvnSnatRule, err error) // Get retrieves the OvnSnatRule from the index for a given name. // Objects returned here must be treated as read-only. - Get(name string) (*v1.OvnSnatRule, error) + Get(name string) (*kubeovnv1.OvnSnatRule, error) OvnSnatRuleListerExpansion } // ovnSnatRuleLister implements the OvnSnatRuleLister interface. type ovnSnatRuleLister struct { - listers.ResourceIndexer[*v1.OvnSnatRule] + listers.ResourceIndexer[*kubeovnv1.OvnSnatRule] } // NewOvnSnatRuleLister returns a new OvnSnatRuleLister. func NewOvnSnatRuleLister(indexer cache.Indexer) OvnSnatRuleLister { - return &ovnSnatRuleLister{listers.New[*v1.OvnSnatRule](indexer, v1.Resource("ovnsnatrule"))} + return &ovnSnatRuleLister{listers.New[*kubeovnv1.OvnSnatRule](indexer, kubeovnv1.Resource("ovnsnatrule"))} } diff --git a/pkg/client/listers/kubeovn/v1/providernetwork.go b/pkg/client/listers/kubeovn/v1/providernetwork.go index 4345af44697..5b010718c11 100644 --- a/pkg/client/listers/kubeovn/v1/providernetwork.go +++ b/pkg/client/listers/kubeovn/v1/providernetwork.go @@ -19,10 +19,10 @@ limitations under the License. package v1 import ( - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // ProviderNetworkLister helps list ProviderNetworks. @@ -30,19 +30,19 @@ import ( type ProviderNetworkLister interface { // List lists all ProviderNetworks in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.ProviderNetwork, err error) + List(selector labels.Selector) (ret []*kubeovnv1.ProviderNetwork, err error) // Get retrieves the ProviderNetwork from the index for a given name. // Objects returned here must be treated as read-only. - Get(name string) (*v1.ProviderNetwork, error) + Get(name string) (*kubeovnv1.ProviderNetwork, error) ProviderNetworkListerExpansion } // providerNetworkLister implements the ProviderNetworkLister interface. type providerNetworkLister struct { - listers.ResourceIndexer[*v1.ProviderNetwork] + listers.ResourceIndexer[*kubeovnv1.ProviderNetwork] } // NewProviderNetworkLister returns a new ProviderNetworkLister. func NewProviderNetworkLister(indexer cache.Indexer) ProviderNetworkLister { - return &providerNetworkLister{listers.New[*v1.ProviderNetwork](indexer, v1.Resource("providernetwork"))} + return &providerNetworkLister{listers.New[*kubeovnv1.ProviderNetwork](indexer, kubeovnv1.Resource("providernetwork"))} } diff --git a/pkg/client/listers/kubeovn/v1/qospolicy.go b/pkg/client/listers/kubeovn/v1/qospolicy.go index 2994089bb47..3ad653c3dbe 100644 --- a/pkg/client/listers/kubeovn/v1/qospolicy.go +++ b/pkg/client/listers/kubeovn/v1/qospolicy.go @@ -19,10 +19,10 @@ limitations under the License. package v1 import ( - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // QoSPolicyLister helps list QoSPolicies. @@ -30,19 +30,19 @@ import ( type QoSPolicyLister interface { // List lists all QoSPolicies in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.QoSPolicy, err error) + List(selector labels.Selector) (ret []*kubeovnv1.QoSPolicy, err error) // Get retrieves the QoSPolicy from the index for a given name. // Objects returned here must be treated as read-only. - Get(name string) (*v1.QoSPolicy, error) + Get(name string) (*kubeovnv1.QoSPolicy, error) QoSPolicyListerExpansion } // qoSPolicyLister implements the QoSPolicyLister interface. type qoSPolicyLister struct { - listers.ResourceIndexer[*v1.QoSPolicy] + listers.ResourceIndexer[*kubeovnv1.QoSPolicy] } // NewQoSPolicyLister returns a new QoSPolicyLister. func NewQoSPolicyLister(indexer cache.Indexer) QoSPolicyLister { - return &qoSPolicyLister{listers.New[*v1.QoSPolicy](indexer, v1.Resource("qospolicy"))} + return &qoSPolicyLister{listers.New[*kubeovnv1.QoSPolicy](indexer, kubeovnv1.Resource("qospolicy"))} } diff --git a/pkg/client/listers/kubeovn/v1/securitygroup.go b/pkg/client/listers/kubeovn/v1/securitygroup.go index 06c7a36688b..281a0dd510e 100644 --- a/pkg/client/listers/kubeovn/v1/securitygroup.go +++ b/pkg/client/listers/kubeovn/v1/securitygroup.go @@ -19,10 +19,10 @@ limitations under the License. package v1 import ( - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // SecurityGroupLister helps list SecurityGroups. @@ -30,19 +30,19 @@ import ( type SecurityGroupLister interface { // List lists all SecurityGroups in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.SecurityGroup, err error) + List(selector labels.Selector) (ret []*kubeovnv1.SecurityGroup, err error) // Get retrieves the SecurityGroup from the index for a given name. // Objects returned here must be treated as read-only. - Get(name string) (*v1.SecurityGroup, error) + Get(name string) (*kubeovnv1.SecurityGroup, error) SecurityGroupListerExpansion } // securityGroupLister implements the SecurityGroupLister interface. type securityGroupLister struct { - listers.ResourceIndexer[*v1.SecurityGroup] + listers.ResourceIndexer[*kubeovnv1.SecurityGroup] } // NewSecurityGroupLister returns a new SecurityGroupLister. func NewSecurityGroupLister(indexer cache.Indexer) SecurityGroupLister { - return &securityGroupLister{listers.New[*v1.SecurityGroup](indexer, v1.Resource("securitygroup"))} + return &securityGroupLister{listers.New[*kubeovnv1.SecurityGroup](indexer, kubeovnv1.Resource("securitygroup"))} } diff --git a/pkg/client/listers/kubeovn/v1/subnet.go b/pkg/client/listers/kubeovn/v1/subnet.go index 25f92314f8c..a20cdabfb9f 100644 --- a/pkg/client/listers/kubeovn/v1/subnet.go +++ b/pkg/client/listers/kubeovn/v1/subnet.go @@ -19,10 +19,10 @@ limitations under the License. package v1 import ( - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // SubnetLister helps list Subnets. @@ -30,19 +30,19 @@ import ( type SubnetLister interface { // List lists all Subnets in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.Subnet, err error) + List(selector labels.Selector) (ret []*kubeovnv1.Subnet, err error) // Get retrieves the Subnet from the index for a given name. // Objects returned here must be treated as read-only. - Get(name string) (*v1.Subnet, error) + Get(name string) (*kubeovnv1.Subnet, error) SubnetListerExpansion } // subnetLister implements the SubnetLister interface. type subnetLister struct { - listers.ResourceIndexer[*v1.Subnet] + listers.ResourceIndexer[*kubeovnv1.Subnet] } // NewSubnetLister returns a new SubnetLister. func NewSubnetLister(indexer cache.Indexer) SubnetLister { - return &subnetLister{listers.New[*v1.Subnet](indexer, v1.Resource("subnet"))} + return &subnetLister{listers.New[*kubeovnv1.Subnet](indexer, kubeovnv1.Resource("subnet"))} } diff --git a/pkg/client/listers/kubeovn/v1/switchlbrule.go b/pkg/client/listers/kubeovn/v1/switchlbrule.go index 37d97f1b841..21ba2474fd6 100644 --- a/pkg/client/listers/kubeovn/v1/switchlbrule.go +++ b/pkg/client/listers/kubeovn/v1/switchlbrule.go @@ -19,10 +19,10 @@ limitations under the License. package v1 import ( - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // SwitchLBRuleLister helps list SwitchLBRules. @@ -30,19 +30,19 @@ import ( type SwitchLBRuleLister interface { // List lists all SwitchLBRules in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.SwitchLBRule, err error) + List(selector labels.Selector) (ret []*kubeovnv1.SwitchLBRule, err error) // Get retrieves the SwitchLBRule from the index for a given name. // Objects returned here must be treated as read-only. - Get(name string) (*v1.SwitchLBRule, error) + Get(name string) (*kubeovnv1.SwitchLBRule, error) SwitchLBRuleListerExpansion } // switchLBRuleLister implements the SwitchLBRuleLister interface. type switchLBRuleLister struct { - listers.ResourceIndexer[*v1.SwitchLBRule] + listers.ResourceIndexer[*kubeovnv1.SwitchLBRule] } // NewSwitchLBRuleLister returns a new SwitchLBRuleLister. func NewSwitchLBRuleLister(indexer cache.Indexer) SwitchLBRuleLister { - return &switchLBRuleLister{listers.New[*v1.SwitchLBRule](indexer, v1.Resource("switchlbrule"))} + return &switchLBRuleLister{listers.New[*kubeovnv1.SwitchLBRule](indexer, kubeovnv1.Resource("switchlbrule"))} } diff --git a/pkg/client/listers/kubeovn/v1/vip.go b/pkg/client/listers/kubeovn/v1/vip.go index 87736f3c7f1..dfcc9d83b62 100644 --- a/pkg/client/listers/kubeovn/v1/vip.go +++ b/pkg/client/listers/kubeovn/v1/vip.go @@ -19,10 +19,10 @@ limitations under the License. package v1 import ( - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // VipLister helps list Vips. @@ -30,19 +30,19 @@ import ( type VipLister interface { // List lists all Vips in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.Vip, err error) + List(selector labels.Selector) (ret []*kubeovnv1.Vip, err error) // Get retrieves the Vip from the index for a given name. // Objects returned here must be treated as read-only. - Get(name string) (*v1.Vip, error) + Get(name string) (*kubeovnv1.Vip, error) VipListerExpansion } // vipLister implements the VipLister interface. type vipLister struct { - listers.ResourceIndexer[*v1.Vip] + listers.ResourceIndexer[*kubeovnv1.Vip] } // NewVipLister returns a new VipLister. func NewVipLister(indexer cache.Indexer) VipLister { - return &vipLister{listers.New[*v1.Vip](indexer, v1.Resource("vip"))} + return &vipLister{listers.New[*kubeovnv1.Vip](indexer, kubeovnv1.Resource("vip"))} } diff --git a/pkg/client/listers/kubeovn/v1/vlan.go b/pkg/client/listers/kubeovn/v1/vlan.go index d0d5bfa595d..3fce5df845b 100644 --- a/pkg/client/listers/kubeovn/v1/vlan.go +++ b/pkg/client/listers/kubeovn/v1/vlan.go @@ -19,10 +19,10 @@ limitations under the License. package v1 import ( - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // VlanLister helps list Vlans. @@ -30,19 +30,19 @@ import ( type VlanLister interface { // List lists all Vlans in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.Vlan, err error) + List(selector labels.Selector) (ret []*kubeovnv1.Vlan, err error) // Get retrieves the Vlan from the index for a given name. // Objects returned here must be treated as read-only. - Get(name string) (*v1.Vlan, error) + Get(name string) (*kubeovnv1.Vlan, error) VlanListerExpansion } // vlanLister implements the VlanLister interface. type vlanLister struct { - listers.ResourceIndexer[*v1.Vlan] + listers.ResourceIndexer[*kubeovnv1.Vlan] } // NewVlanLister returns a new VlanLister. func NewVlanLister(indexer cache.Indexer) VlanLister { - return &vlanLister{listers.New[*v1.Vlan](indexer, v1.Resource("vlan"))} + return &vlanLister{listers.New[*kubeovnv1.Vlan](indexer, kubeovnv1.Resource("vlan"))} } diff --git a/pkg/client/listers/kubeovn/v1/vpc.go b/pkg/client/listers/kubeovn/v1/vpc.go index fcaac837cb4..c0a07dbe9de 100644 --- a/pkg/client/listers/kubeovn/v1/vpc.go +++ b/pkg/client/listers/kubeovn/v1/vpc.go @@ -19,10 +19,10 @@ limitations under the License. package v1 import ( - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // VpcLister helps list Vpcs. @@ -30,19 +30,19 @@ import ( type VpcLister interface { // List lists all Vpcs in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.Vpc, err error) + List(selector labels.Selector) (ret []*kubeovnv1.Vpc, err error) // Get retrieves the Vpc from the index for a given name. // Objects returned here must be treated as read-only. - Get(name string) (*v1.Vpc, error) + Get(name string) (*kubeovnv1.Vpc, error) VpcListerExpansion } // vpcLister implements the VpcLister interface. type vpcLister struct { - listers.ResourceIndexer[*v1.Vpc] + listers.ResourceIndexer[*kubeovnv1.Vpc] } // NewVpcLister returns a new VpcLister. func NewVpcLister(indexer cache.Indexer) VpcLister { - return &vpcLister{listers.New[*v1.Vpc](indexer, v1.Resource("vpc"))} + return &vpcLister{listers.New[*kubeovnv1.Vpc](indexer, kubeovnv1.Resource("vpc"))} } diff --git a/pkg/client/listers/kubeovn/v1/vpcdns.go b/pkg/client/listers/kubeovn/v1/vpcdns.go index d3649c528b1..21e273961ce 100644 --- a/pkg/client/listers/kubeovn/v1/vpcdns.go +++ b/pkg/client/listers/kubeovn/v1/vpcdns.go @@ -19,10 +19,10 @@ limitations under the License. package v1 import ( - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // VpcDnsLister helps list VpcDnses. @@ -30,19 +30,19 @@ import ( type VpcDnsLister interface { // List lists all VpcDnses in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.VpcDns, err error) + List(selector labels.Selector) (ret []*kubeovnv1.VpcDns, err error) // Get retrieves the VpcDns from the index for a given name. // Objects returned here must be treated as read-only. - Get(name string) (*v1.VpcDns, error) + Get(name string) (*kubeovnv1.VpcDns, error) VpcDnsListerExpansion } // vpcDnsLister implements the VpcDnsLister interface. type vpcDnsLister struct { - listers.ResourceIndexer[*v1.VpcDns] + listers.ResourceIndexer[*kubeovnv1.VpcDns] } // NewVpcDnsLister returns a new VpcDnsLister. func NewVpcDnsLister(indexer cache.Indexer) VpcDnsLister { - return &vpcDnsLister{listers.New[*v1.VpcDns](indexer, v1.Resource("vpcdns"))} + return &vpcDnsLister{listers.New[*kubeovnv1.VpcDns](indexer, kubeovnv1.Resource("vpcdns"))} } diff --git a/pkg/client/listers/kubeovn/v1/vpcegressgateway.go b/pkg/client/listers/kubeovn/v1/vpcegressgateway.go index db9295e3149..38294c1993b 100644 --- a/pkg/client/listers/kubeovn/v1/vpcegressgateway.go +++ b/pkg/client/listers/kubeovn/v1/vpcegressgateway.go @@ -19,10 +19,10 @@ limitations under the License. package v1 import ( - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // VpcEgressGatewayLister helps list VpcEgressGateways. @@ -30,7 +30,7 @@ import ( type VpcEgressGatewayLister interface { // List lists all VpcEgressGateways in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.VpcEgressGateway, err error) + List(selector labels.Selector) (ret []*kubeovnv1.VpcEgressGateway, err error) // VpcEgressGateways returns an object that can list and get VpcEgressGateways. VpcEgressGateways(namespace string) VpcEgressGatewayNamespaceLister VpcEgressGatewayListerExpansion @@ -38,17 +38,17 @@ type VpcEgressGatewayLister interface { // vpcEgressGatewayLister implements the VpcEgressGatewayLister interface. type vpcEgressGatewayLister struct { - listers.ResourceIndexer[*v1.VpcEgressGateway] + listers.ResourceIndexer[*kubeovnv1.VpcEgressGateway] } // NewVpcEgressGatewayLister returns a new VpcEgressGatewayLister. func NewVpcEgressGatewayLister(indexer cache.Indexer) VpcEgressGatewayLister { - return &vpcEgressGatewayLister{listers.New[*v1.VpcEgressGateway](indexer, v1.Resource("vpcegressgateway"))} + return &vpcEgressGatewayLister{listers.New[*kubeovnv1.VpcEgressGateway](indexer, kubeovnv1.Resource("vpcegressgateway"))} } // VpcEgressGateways returns an object that can list and get VpcEgressGateways. func (s *vpcEgressGatewayLister) VpcEgressGateways(namespace string) VpcEgressGatewayNamespaceLister { - return vpcEgressGatewayNamespaceLister{listers.NewNamespaced[*v1.VpcEgressGateway](s.ResourceIndexer, namespace)} + return vpcEgressGatewayNamespaceLister{listers.NewNamespaced[*kubeovnv1.VpcEgressGateway](s.ResourceIndexer, namespace)} } // VpcEgressGatewayNamespaceLister helps list and get VpcEgressGateways. @@ -56,15 +56,15 @@ func (s *vpcEgressGatewayLister) VpcEgressGateways(namespace string) VpcEgressGa type VpcEgressGatewayNamespaceLister interface { // List lists all VpcEgressGateways in the indexer for a given namespace. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.VpcEgressGateway, err error) + List(selector labels.Selector) (ret []*kubeovnv1.VpcEgressGateway, err error) // Get retrieves the VpcEgressGateway from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. - Get(name string) (*v1.VpcEgressGateway, error) + Get(name string) (*kubeovnv1.VpcEgressGateway, error) VpcEgressGatewayNamespaceListerExpansion } // vpcEgressGatewayNamespaceLister implements the VpcEgressGatewayNamespaceLister // interface. type vpcEgressGatewayNamespaceLister struct { - listers.ResourceIndexer[*v1.VpcEgressGateway] + listers.ResourceIndexer[*kubeovnv1.VpcEgressGateway] } diff --git a/pkg/client/listers/kubeovn/v1/vpcnatgateway.go b/pkg/client/listers/kubeovn/v1/vpcnatgateway.go index 845fe60ec35..4c422d6bbfe 100644 --- a/pkg/client/listers/kubeovn/v1/vpcnatgateway.go +++ b/pkg/client/listers/kubeovn/v1/vpcnatgateway.go @@ -19,10 +19,10 @@ limitations under the License. package v1 import ( - v1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // VpcNatGatewayLister helps list VpcNatGateways. @@ -30,19 +30,19 @@ import ( type VpcNatGatewayLister interface { // List lists all VpcNatGateways in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.VpcNatGateway, err error) + List(selector labels.Selector) (ret []*kubeovnv1.VpcNatGateway, err error) // Get retrieves the VpcNatGateway from the index for a given name. // Objects returned here must be treated as read-only. - Get(name string) (*v1.VpcNatGateway, error) + Get(name string) (*kubeovnv1.VpcNatGateway, error) VpcNatGatewayListerExpansion } // vpcNatGatewayLister implements the VpcNatGatewayLister interface. type vpcNatGatewayLister struct { - listers.ResourceIndexer[*v1.VpcNatGateway] + listers.ResourceIndexer[*kubeovnv1.VpcNatGateway] } // NewVpcNatGatewayLister returns a new VpcNatGatewayLister. func NewVpcNatGatewayLister(indexer cache.Indexer) VpcNatGatewayLister { - return &vpcNatGatewayLister{listers.New[*v1.VpcNatGateway](indexer, v1.Resource("vpcnatgateway"))} + return &vpcNatGatewayLister{listers.New[*kubeovnv1.VpcNatGateway](indexer, kubeovnv1.Resource("vpcnatgateway"))} } diff --git a/pkg/controller/vpc_egress_gateway.go b/pkg/controller/vpc_egress_gateway.go index a6538d27856..e7c1a326248 100644 --- a/pkg/controller/vpc_egress_gateway.go +++ b/pkg/controller/vpc_egress_gateway.go @@ -14,6 +14,7 @@ import ( corev1 "k8s.io/api/core/v1" k8serrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/util/intstr" utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/client-go/tools/cache" @@ -58,6 +59,10 @@ func (c *Controller) enqueueDeleteVpcEgressGateway(obj interface{}) { c.delVpcEgressGatewayQueue.Add(key) } +func vegWorkloadLabels(vegName string) map[string]string { + return map[string]string{"app": "vpc-egress-gateway", util.VpcEgressGatewayLabel: vegName} +} + func (c *Controller) handleAddOrUpdateVpcEgressGateway(key string) error { ns, name, err := cache.SplitMetaNamespaceKey(key) if err != nil { @@ -124,8 +129,11 @@ func (c *Controller) handleAddOrUpdateVpcEgressGateway(key string) error { // reconcile the vpc egress gateway workload and get the route sources for later OVN resources reconciliation attachmentNetworkName, ipv4Src, ipv6Src, deploy, err := c.reconcileVpcEgressGatewayWorkload(gw, vpc, bfdIP, bfdIPv4, bfdIPv6) + gw.Status.Replicas = gw.Spec.Replicas + gw.Status.LabelSelector = labels.FormatLabels(vegWorkloadLabels(gw.Name)) if err != nil { klog.Error(err) + gw.Status.Replicas = 0 gw.Status.Conditions.SetCondition(kubeovnv1.Ready, corev1.ConditionFalse, "ReconcileWorkloadFailed", err.Error(), gw.Generation) _, _ = c.updateVpcEgressGatewayStatus(gw) return err @@ -376,7 +384,7 @@ func (c *Controller) reconcileVpcEgressGatewayWorkload(gw *kubeovnv1.VpcEgressGa initEnv = append(initEnv, ipv6Env...) // generate workload - labels := map[string]string{util.VpcEgressGatewayLabel: gw.Name} + labels := vegWorkloadLabels(gw.Name) deploy := &appsv1.Deployment{ ObjectMeta: metav1.ObjectMeta{ Name: gw.Spec.Prefix + gw.Name,