From 72870c01c247229f7880b33fd6407aa2d3a701a6 Mon Sep 17 00:00:00 2001 From: yaocw2020 Date: Fri, 11 Jun 2021 16:40:43 +0800 Subject: [PATCH] Update generated code --- .../v1alpha1/doc.go | 2 +- .../v1alpha1/zz_generated_deepcopy.go | 40 +- .../v1alpha1/zz_generated_list_types.go | 2 +- .../v1alpha1/zz_generated_register.go | 6 +- .../zz_generated_register.go | 4 +- .../clientset/versioned/clientset.go | 32 +- .../versioned/fake/clientset_generated.go | 19 +- .../clientset/versioned/fake/register.go | 8 +- .../clientset/versioned/scheme/register.go | 6 +- .../v1beta1/discovery.k8s.io_client.go | 89 +++++ .../typed/discovery.k8s.io/v1beta1/doc.go | 20 + .../discovery.k8s.io/v1beta1/endpointslice.go | 178 +++++++++ .../v1beta1}/fake/doc.go | 0 .../fake/fake_discovery.k8s.io_client.go | 40 ++ .../v1beta1/fake/fake_endpointslice.go | 130 ++++++ .../v1beta1/generated_expansion.go | 21 + .../v1alpha1/doc.go | 0 .../v1alpha1/fake/doc.go | 20 + .../v1alpha1/fake/fake_loadbalancer.go | 8 +- ...ke_loadbalancer.harvesterhci.io_client.go} | 8 +- .../v1alpha1/generated_expansion.go | 0 .../v1alpha1/loadbalancer.go | 6 +- .../loadbalancer.harvesterhci.io_client.go} | 30 +- .../controllers/core/v1/interface.go | 48 --- pkg/generated/controllers/core/v1/service.go | 372 ------------------ .../factory.go | 4 +- .../{core => discovery.k8s.io}/interface.go | 10 +- .../v1beta1/endpointslice.go | 0 .../v1beta1/interface.go | 2 +- .../factory.go | 4 +- .../interface.go | 4 +- .../v1alpha1/interface.go | 4 +- .../v1alpha1/loadbalancer.go | 2 +- 33 files changed, 604 insertions(+), 515 deletions(-) rename pkg/apis/{network.harvesterhci.io => loadbalancer.harvesterhci.io}/v1alpha1/doc.go (93%) rename pkg/apis/{network.harvesterhci.io => loadbalancer.harvesterhci.io}/v1alpha1/zz_generated_deepcopy.go (89%) rename pkg/apis/{network.harvesterhci.io => loadbalancer.harvesterhci.io}/v1alpha1/zz_generated_list_types.go (96%) rename pkg/apis/{network.harvesterhci.io => loadbalancer.harvesterhci.io}/v1alpha1/zz_generated_register.go (87%) rename pkg/apis/{network.harvesterhci.io => loadbalancer.harvesterhci.io}/zz_generated_register.go (91%) create mode 100644 pkg/generated/clientset/versioned/typed/discovery.k8s.io/v1beta1/discovery.k8s.io_client.go create mode 100644 pkg/generated/clientset/versioned/typed/discovery.k8s.io/v1beta1/doc.go create mode 100644 pkg/generated/clientset/versioned/typed/discovery.k8s.io/v1beta1/endpointslice.go rename pkg/generated/clientset/versioned/typed/{network.harvesterhci.io/v1alpha1 => discovery.k8s.io/v1beta1}/fake/doc.go (100%) create mode 100644 pkg/generated/clientset/versioned/typed/discovery.k8s.io/v1beta1/fake/fake_discovery.k8s.io_client.go create mode 100644 pkg/generated/clientset/versioned/typed/discovery.k8s.io/v1beta1/fake/fake_endpointslice.go create mode 100644 pkg/generated/clientset/versioned/typed/discovery.k8s.io/v1beta1/generated_expansion.go rename pkg/generated/clientset/versioned/typed/{network.harvesterhci.io => loadbalancer.harvesterhci.io}/v1alpha1/doc.go (100%) create mode 100644 pkg/generated/clientset/versioned/typed/loadbalancer.harvesterhci.io/v1alpha1/fake/doc.go rename pkg/generated/clientset/versioned/typed/{network.harvesterhci.io => loadbalancer.harvesterhci.io}/v1alpha1/fake/fake_loadbalancer.go (93%) rename pkg/generated/clientset/versioned/typed/{network.harvesterhci.io/v1alpha1/fake/fake_network.harvesterhci.io_client.go => loadbalancer.harvesterhci.io/v1alpha1/fake/fake_loadbalancer.harvesterhci.io_client.go} (73%) rename pkg/generated/clientset/versioned/typed/{network.harvesterhci.io => loadbalancer.harvesterhci.io}/v1alpha1/generated_expansion.go (100%) rename pkg/generated/clientset/versioned/typed/{network.harvesterhci.io => loadbalancer.harvesterhci.io}/v1alpha1/loadbalancer.go (95%) rename pkg/generated/clientset/versioned/typed/{network.harvesterhci.io/v1alpha1/network.harvesterhci.io_client.go => loadbalancer.harvesterhci.io/v1alpha1/loadbalancer.harvesterhci.io_client.go} (59%) delete mode 100644 pkg/generated/controllers/core/v1/interface.go delete mode 100644 pkg/generated/controllers/core/v1/service.go rename pkg/generated/controllers/{network.harvesterhci.io => discovery.k8s.io}/factory.go (96%) rename pkg/generated/controllers/{core => discovery.k8s.io}/interface.go (79%) rename pkg/generated/controllers/{core => discovery.k8s.io}/v1beta1/endpointslice.go (100%) rename pkg/generated/controllers/{core => discovery.k8s.io}/v1beta1/interface.go (92%) rename pkg/generated/controllers/{core => loadbalancer.harvesterhci.io}/factory.go (96%) rename pkg/generated/controllers/{network.harvesterhci.io => loadbalancer.harvesterhci.io}/interface.go (88%) rename pkg/generated/controllers/{network.harvesterhci.io => loadbalancer.harvesterhci.io}/v1alpha1/interface.go (84%) rename pkg/generated/controllers/{network.harvesterhci.io => loadbalancer.harvesterhci.io}/v1alpha1/loadbalancer.go (99%) diff --git a/pkg/apis/network.harvesterhci.io/v1alpha1/doc.go b/pkg/apis/loadbalancer.harvesterhci.io/v1alpha1/doc.go similarity index 93% rename from pkg/apis/network.harvesterhci.io/v1alpha1/doc.go rename to pkg/apis/loadbalancer.harvesterhci.io/v1alpha1/doc.go index ba8a2885..0a4c96f8 100644 --- a/pkg/apis/network.harvesterhci.io/v1alpha1/doc.go +++ b/pkg/apis/loadbalancer.harvesterhci.io/v1alpha1/doc.go @@ -17,5 +17,5 @@ limitations under the License. // Code generated by main. DO NOT EDIT. // +k8s:deepcopy-gen=package -// +groupName=network.harvesterhci.io +// +groupName=loadbalancer.harvesterhci.io package v1alpha1 diff --git a/pkg/apis/network.harvesterhci.io/v1alpha1/zz_generated_deepcopy.go b/pkg/apis/loadbalancer.harvesterhci.io/v1alpha1/zz_generated_deepcopy.go similarity index 89% rename from pkg/apis/network.harvesterhci.io/v1alpha1/zz_generated_deepcopy.go rename to pkg/apis/loadbalancer.harvesterhci.io/v1alpha1/zz_generated_deepcopy.go index cc9bbe41..e48ec929 100644 --- a/pkg/apis/network.harvesterhci.io/v1alpha1/zz_generated_deepcopy.go +++ b/pkg/apis/loadbalancer.harvesterhci.io/v1alpha1/zz_generated_deepcopy.go @@ -24,22 +24,6 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" ) -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BackendServer) DeepCopyInto(out *BackendServer) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackendServer. -func (in *BackendServer) DeepCopy() *BackendServer { - if in == nil { - return nil - } - out := new(BackendServer) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Condition) DeepCopyInto(out *Condition) { *out = *in @@ -75,12 +59,6 @@ func (in *HeathCheck) DeepCopy() *HeathCheck { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Listener) DeepCopyInto(out *Listener) { *out = *in - if in.BackendServers != nil { - in, out := &in.BackendServers, &out.BackendServers - *out = make([]BackendServer, len(*in)) - copy(*out, *in) - } - out.HeathCheck = in.HeathCheck return } @@ -160,11 +138,25 @@ func (in *LoadBalancerSpec) DeepCopyInto(out *LoadBalancerSpec) { *out = *in if in.Listeners != nil { in, out := &in.Listeners, &out.Listeners - *out = make([]Listener, len(*in)) + *out = make([]*Listener, len(*in)) for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(Listener) + **out = **in + } } } + if in.BackendServers != nil { + in, out := &in.BackendServers, &out.BackendServers + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.HeathCheck != nil { + in, out := &in.HeathCheck, &out.HeathCheck + *out = new(HeathCheck) + **out = **in + } return } diff --git a/pkg/apis/network.harvesterhci.io/v1alpha1/zz_generated_list_types.go b/pkg/apis/loadbalancer.harvesterhci.io/v1alpha1/zz_generated_list_types.go similarity index 96% rename from pkg/apis/network.harvesterhci.io/v1alpha1/zz_generated_list_types.go rename to pkg/apis/loadbalancer.harvesterhci.io/v1alpha1/zz_generated_list_types.go index 3b3d3b29..aeac3b43 100644 --- a/pkg/apis/network.harvesterhci.io/v1alpha1/zz_generated_list_types.go +++ b/pkg/apis/loadbalancer.harvesterhci.io/v1alpha1/zz_generated_list_types.go @@ -17,7 +17,7 @@ limitations under the License. // Code generated by main. DO NOT EDIT. // +k8s:deepcopy-gen=package -// +groupName=network.harvesterhci.io +// +groupName=loadbalancer.harvesterhci.io package v1alpha1 import ( diff --git a/pkg/apis/network.harvesterhci.io/v1alpha1/zz_generated_register.go b/pkg/apis/loadbalancer.harvesterhci.io/v1alpha1/zz_generated_register.go similarity index 87% rename from pkg/apis/network.harvesterhci.io/v1alpha1/zz_generated_register.go rename to pkg/apis/loadbalancer.harvesterhci.io/v1alpha1/zz_generated_register.go index be8e0e69..16dbba98 100644 --- a/pkg/apis/network.harvesterhci.io/v1alpha1/zz_generated_register.go +++ b/pkg/apis/loadbalancer.harvesterhci.io/v1alpha1/zz_generated_register.go @@ -17,11 +17,11 @@ limitations under the License. // Code generated by main. DO NOT EDIT. // +k8s:deepcopy-gen=package -// +groupName=network.harvesterhci.io +// +groupName=loadbalancer.harvesterhci.io package v1alpha1 import ( - network "github.com/harvester/harvester-conveyor/pkg/apis/network.harvesterhci.io" + loadbalancer "github.com/harvester/harvester-load-balancer/pkg/apis/loadbalancer.harvesterhci.io" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" @@ -32,7 +32,7 @@ var ( ) // SchemeGroupVersion is group version used to register these objects -var SchemeGroupVersion = schema.GroupVersion{Group: network.GroupName, Version: "v1alpha1"} +var SchemeGroupVersion = schema.GroupVersion{Group: loadbalancer.GroupName, Version: "v1alpha1"} // Kind takes an unqualified kind and returns back a Group qualified GroupKind func Kind(kind string) schema.GroupKind { diff --git a/pkg/apis/network.harvesterhci.io/zz_generated_register.go b/pkg/apis/loadbalancer.harvesterhci.io/zz_generated_register.go similarity index 91% rename from pkg/apis/network.harvesterhci.io/zz_generated_register.go rename to pkg/apis/loadbalancer.harvesterhci.io/zz_generated_register.go index 01742bd7..3012f478 100644 --- a/pkg/apis/network.harvesterhci.io/zz_generated_register.go +++ b/pkg/apis/loadbalancer.harvesterhci.io/zz_generated_register.go @@ -16,9 +16,9 @@ limitations under the License. // Code generated by main. DO NOT EDIT. -package network +package loadbalancer const ( // Package-wide consts from generator "zz_generated_register". - GroupName = "network.harvesterhci.io" + GroupName = "loadbalancer.harvesterhci.io" ) diff --git a/pkg/generated/clientset/versioned/clientset.go b/pkg/generated/clientset/versioned/clientset.go index 1fbe9145..1e085982 100644 --- a/pkg/generated/clientset/versioned/clientset.go +++ b/pkg/generated/clientset/versioned/clientset.go @@ -21,7 +21,8 @@ package versioned import ( "fmt" - networkv1alpha1 "github.com/harvester/harvester-conveyor/pkg/generated/clientset/versioned/typed/network.harvesterhci.io/v1alpha1" + discoveryv1beta1 "github.com/harvester/harvester-load-balancer/pkg/generated/clientset/versioned/typed/discovery.k8s.io/v1beta1" + loadbalancerv1alpha1 "github.com/harvester/harvester-load-balancer/pkg/generated/clientset/versioned/typed/loadbalancer.harvesterhci.io/v1alpha1" discovery "k8s.io/client-go/discovery" rest "k8s.io/client-go/rest" flowcontrol "k8s.io/client-go/util/flowcontrol" @@ -29,19 +30,26 @@ import ( type Interface interface { Discovery() discovery.DiscoveryInterface - NetworkV1alpha1() networkv1alpha1.NetworkV1alpha1Interface + DiscoveryV1beta1() discoveryv1beta1.DiscoveryV1beta1Interface + LoadbalancerV1alpha1() loadbalancerv1alpha1.LoadbalancerV1alpha1Interface } // Clientset contains the clients for groups. Each group has exactly one // version included in a Clientset. type Clientset struct { *discovery.DiscoveryClient - networkV1alpha1 *networkv1alpha1.NetworkV1alpha1Client + discoveryV1beta1 *discoveryv1beta1.DiscoveryV1beta1Client + loadbalancerV1alpha1 *loadbalancerv1alpha1.LoadbalancerV1alpha1Client } -// NetworkV1alpha1 retrieves the NetworkV1alpha1Client -func (c *Clientset) NetworkV1alpha1() networkv1alpha1.NetworkV1alpha1Interface { - return c.networkV1alpha1 +// DiscoveryV1beta1 retrieves the DiscoveryV1beta1Client +func (c *Clientset) DiscoveryV1beta1() discoveryv1beta1.DiscoveryV1beta1Interface { + return c.discoveryV1beta1 +} + +// LoadbalancerV1alpha1 retrieves the LoadbalancerV1alpha1Client +func (c *Clientset) LoadbalancerV1alpha1() loadbalancerv1alpha1.LoadbalancerV1alpha1Interface { + return c.loadbalancerV1alpha1 } // Discovery retrieves the DiscoveryClient @@ -65,7 +73,11 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { } var cs Clientset var err error - cs.networkV1alpha1, err = networkv1alpha1.NewForConfig(&configShallowCopy) + cs.discoveryV1beta1, err = discoveryv1beta1.NewForConfig(&configShallowCopy) + if err != nil { + return nil, err + } + cs.loadbalancerV1alpha1, err = loadbalancerv1alpha1.NewForConfig(&configShallowCopy) if err != nil { return nil, err } @@ -81,7 +93,8 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *Clientset { var cs Clientset - cs.networkV1alpha1 = networkv1alpha1.NewForConfigOrDie(c) + cs.discoveryV1beta1 = discoveryv1beta1.NewForConfigOrDie(c) + cs.loadbalancerV1alpha1 = loadbalancerv1alpha1.NewForConfigOrDie(c) cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) return &cs @@ -90,7 +103,8 @@ func NewForConfigOrDie(c *rest.Config) *Clientset { // New creates a new Clientset for the given RESTClient. func New(c rest.Interface) *Clientset { var cs Clientset - cs.networkV1alpha1 = networkv1alpha1.New(c) + cs.discoveryV1beta1 = discoveryv1beta1.New(c) + cs.loadbalancerV1alpha1 = loadbalancerv1alpha1.New(c) cs.DiscoveryClient = discovery.NewDiscoveryClient(c) return &cs diff --git a/pkg/generated/clientset/versioned/fake/clientset_generated.go b/pkg/generated/clientset/versioned/fake/clientset_generated.go index 163669f1..d970f379 100644 --- a/pkg/generated/clientset/versioned/fake/clientset_generated.go +++ b/pkg/generated/clientset/versioned/fake/clientset_generated.go @@ -19,9 +19,11 @@ limitations under the License. package fake import ( - clientset "github.com/harvester/harvester-conveyor/pkg/generated/clientset/versioned" - networkv1alpha1 "github.com/harvester/harvester-conveyor/pkg/generated/clientset/versioned/typed/network.harvesterhci.io/v1alpha1" - fakenetworkv1alpha1 "github.com/harvester/harvester-conveyor/pkg/generated/clientset/versioned/typed/network.harvesterhci.io/v1alpha1/fake" + clientset "github.com/harvester/harvester-load-balancer/pkg/generated/clientset/versioned" + discoveryv1beta1 "github.com/harvester/harvester-load-balancer/pkg/generated/clientset/versioned/typed/discovery.k8s.io/v1beta1" + fakediscoveryv1beta1 "github.com/harvester/harvester-load-balancer/pkg/generated/clientset/versioned/typed/discovery.k8s.io/v1beta1/fake" + loadbalancerv1alpha1 "github.com/harvester/harvester-load-balancer/pkg/generated/clientset/versioned/typed/loadbalancer.harvesterhci.io/v1alpha1" + fakeloadbalancerv1alpha1 "github.com/harvester/harvester-load-balancer/pkg/generated/clientset/versioned/typed/loadbalancer.harvesterhci.io/v1alpha1/fake" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/discovery" @@ -76,7 +78,12 @@ func (c *Clientset) Tracker() testing.ObjectTracker { var _ clientset.Interface = &Clientset{} -// NetworkV1alpha1 retrieves the NetworkV1alpha1Client -func (c *Clientset) NetworkV1alpha1() networkv1alpha1.NetworkV1alpha1Interface { - return &fakenetworkv1alpha1.FakeNetworkV1alpha1{Fake: &c.Fake} +// DiscoveryV1beta1 retrieves the DiscoveryV1beta1Client +func (c *Clientset) DiscoveryV1beta1() discoveryv1beta1.DiscoveryV1beta1Interface { + return &fakediscoveryv1beta1.FakeDiscoveryV1beta1{Fake: &c.Fake} +} + +// LoadbalancerV1alpha1 retrieves the LoadbalancerV1alpha1Client +func (c *Clientset) LoadbalancerV1alpha1() loadbalancerv1alpha1.LoadbalancerV1alpha1Interface { + return &fakeloadbalancerv1alpha1.FakeLoadbalancerV1alpha1{Fake: &c.Fake} } diff --git a/pkg/generated/clientset/versioned/fake/register.go b/pkg/generated/clientset/versioned/fake/register.go index 9009759c..2ecf4557 100644 --- a/pkg/generated/clientset/versioned/fake/register.go +++ b/pkg/generated/clientset/versioned/fake/register.go @@ -19,7 +19,8 @@ limitations under the License. package fake import ( - networkv1alpha1 "github.com/harvester/harvester-conveyor/pkg/apis/network.harvesterhci.io/v1alpha1" + loadbalancerv1alpha1 "github.com/harvester/harvester-load-balancer/pkg/apis/loadbalancer.harvesterhci.io/v1alpha1" + discoveryv1beta1 "k8s.io/api/discovery/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -29,9 +30,10 @@ import ( var scheme = runtime.NewScheme() var codecs = serializer.NewCodecFactory(scheme) -var parameterCodec = runtime.NewParameterCodec(scheme) + var localSchemeBuilder = runtime.SchemeBuilder{ - networkv1alpha1.AddToScheme, + discoveryv1beta1.AddToScheme, + loadbalancerv1alpha1.AddToScheme, } // AddToScheme adds all types of this clientset into the given scheme. This allows composition diff --git a/pkg/generated/clientset/versioned/scheme/register.go b/pkg/generated/clientset/versioned/scheme/register.go index ea67c018..c3e6df44 100644 --- a/pkg/generated/clientset/versioned/scheme/register.go +++ b/pkg/generated/clientset/versioned/scheme/register.go @@ -19,7 +19,8 @@ limitations under the License. package scheme import ( - networkv1alpha1 "github.com/harvester/harvester-conveyor/pkg/apis/network.harvesterhci.io/v1alpha1" + loadbalancerv1alpha1 "github.com/harvester/harvester-load-balancer/pkg/apis/loadbalancer.harvesterhci.io/v1alpha1" + discoveryv1beta1 "k8s.io/api/discovery/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -31,7 +32,8 @@ var Scheme = runtime.NewScheme() var Codecs = serializer.NewCodecFactory(Scheme) var ParameterCodec = runtime.NewParameterCodec(Scheme) var localSchemeBuilder = runtime.SchemeBuilder{ - networkv1alpha1.AddToScheme, + discoveryv1beta1.AddToScheme, + loadbalancerv1alpha1.AddToScheme, } // AddToScheme adds all types of this clientset into the given scheme. This allows composition diff --git a/pkg/generated/clientset/versioned/typed/discovery.k8s.io/v1beta1/discovery.k8s.io_client.go b/pkg/generated/clientset/versioned/typed/discovery.k8s.io/v1beta1/discovery.k8s.io_client.go new file mode 100644 index 00000000..8a39ea35 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/discovery.k8s.io/v1beta1/discovery.k8s.io_client.go @@ -0,0 +1,89 @@ +/* +Copyright 2019 Wrangler Sample Controller Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1beta1 + +import ( + "github.com/harvester/harvester-load-balancer/pkg/generated/clientset/versioned/scheme" + v1beta1 "k8s.io/api/discovery/v1beta1" + rest "k8s.io/client-go/rest" +) + +type DiscoveryV1beta1Interface interface { + RESTClient() rest.Interface + EndpointSlicesGetter +} + +// DiscoveryV1beta1Client is used to interact with features provided by the discovery.k8s.io group. +type DiscoveryV1beta1Client struct { + restClient rest.Interface +} + +func (c *DiscoveryV1beta1Client) EndpointSlices(namespace string) EndpointSliceInterface { + return newEndpointSlices(c, namespace) +} + +// NewForConfig creates a new DiscoveryV1beta1Client for the given config. +func NewForConfig(c *rest.Config) (*DiscoveryV1beta1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientFor(&config) + if err != nil { + return nil, err + } + return &DiscoveryV1beta1Client{client}, nil +} + +// NewForConfigOrDie creates a new DiscoveryV1beta1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *DiscoveryV1beta1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new DiscoveryV1beta1Client for the given RESTClient. +func New(c rest.Interface) *DiscoveryV1beta1Client { + return &DiscoveryV1beta1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1beta1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *DiscoveryV1beta1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/pkg/generated/clientset/versioned/typed/discovery.k8s.io/v1beta1/doc.go b/pkg/generated/clientset/versioned/typed/discovery.k8s.io/v1beta1/doc.go new file mode 100644 index 00000000..8ea80aa5 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/discovery.k8s.io/v1beta1/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2019 Wrangler Sample Controller Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by main. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1beta1 diff --git a/pkg/generated/clientset/versioned/typed/discovery.k8s.io/v1beta1/endpointslice.go b/pkg/generated/clientset/versioned/typed/discovery.k8s.io/v1beta1/endpointslice.go new file mode 100644 index 00000000..54ebdde4 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/discovery.k8s.io/v1beta1/endpointslice.go @@ -0,0 +1,178 @@ +/* +Copyright 2019 Wrangler Sample Controller Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester-load-balancer/pkg/generated/clientset/versioned/scheme" + v1beta1 "k8s.io/api/discovery/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// EndpointSlicesGetter has a method to return a EndpointSliceInterface. +// A group's client should implement this interface. +type EndpointSlicesGetter interface { + EndpointSlices(namespace string) EndpointSliceInterface +} + +// EndpointSliceInterface has methods to work with EndpointSlice resources. +type EndpointSliceInterface interface { + Create(ctx context.Context, endpointSlice *v1beta1.EndpointSlice, opts v1.CreateOptions) (*v1beta1.EndpointSlice, error) + Update(ctx context.Context, endpointSlice *v1beta1.EndpointSlice, opts v1.UpdateOptions) (*v1beta1.EndpointSlice, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.EndpointSlice, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.EndpointSliceList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.EndpointSlice, err error) + EndpointSliceExpansion +} + +// endpointSlices implements EndpointSliceInterface +type endpointSlices struct { + client rest.Interface + ns string +} + +// newEndpointSlices returns a EndpointSlices +func newEndpointSlices(c *DiscoveryV1beta1Client, namespace string) *endpointSlices { + return &endpointSlices{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the endpointSlice, and returns the corresponding endpointSlice object, and an error if there is any. +func (c *endpointSlices) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.EndpointSlice, err error) { + result = &v1beta1.EndpointSlice{} + err = c.client.Get(). + Namespace(c.ns). + Resource("endpointslices"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of EndpointSlices that match those selectors. +func (c *endpointSlices) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.EndpointSliceList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.EndpointSliceList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("endpointslices"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested endpointSlices. +func (c *endpointSlices) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("endpointslices"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a endpointSlice and creates it. Returns the server's representation of the endpointSlice, and an error, if there is any. +func (c *endpointSlices) Create(ctx context.Context, endpointSlice *v1beta1.EndpointSlice, opts v1.CreateOptions) (result *v1beta1.EndpointSlice, err error) { + result = &v1beta1.EndpointSlice{} + err = c.client.Post(). + Namespace(c.ns). + Resource("endpointslices"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(endpointSlice). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a endpointSlice and updates it. Returns the server's representation of the endpointSlice, and an error, if there is any. +func (c *endpointSlices) Update(ctx context.Context, endpointSlice *v1beta1.EndpointSlice, opts v1.UpdateOptions) (result *v1beta1.EndpointSlice, err error) { + result = &v1beta1.EndpointSlice{} + err = c.client.Put(). + Namespace(c.ns). + Resource("endpointslices"). + Name(endpointSlice.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(endpointSlice). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the endpointSlice and deletes it. Returns an error if one occurs. +func (c *endpointSlices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("endpointslices"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *endpointSlices) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("endpointslices"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched endpointSlice. +func (c *endpointSlices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.EndpointSlice, err error) { + result = &v1beta1.EndpointSlice{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("endpointslices"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/generated/clientset/versioned/typed/network.harvesterhci.io/v1alpha1/fake/doc.go b/pkg/generated/clientset/versioned/typed/discovery.k8s.io/v1beta1/fake/doc.go similarity index 100% rename from pkg/generated/clientset/versioned/typed/network.harvesterhci.io/v1alpha1/fake/doc.go rename to pkg/generated/clientset/versioned/typed/discovery.k8s.io/v1beta1/fake/doc.go diff --git a/pkg/generated/clientset/versioned/typed/discovery.k8s.io/v1beta1/fake/fake_discovery.k8s.io_client.go b/pkg/generated/clientset/versioned/typed/discovery.k8s.io/v1beta1/fake/fake_discovery.k8s.io_client.go new file mode 100644 index 00000000..4cdd9d93 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/discovery.k8s.io/v1beta1/fake/fake_discovery.k8s.io_client.go @@ -0,0 +1,40 @@ +/* +Copyright 2019 Wrangler Sample Controller Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + v1beta1 "github.com/harvester/harvester-load-balancer/pkg/generated/clientset/versioned/typed/discovery.k8s.io/v1beta1" + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" +) + +type FakeDiscoveryV1beta1 struct { + *testing.Fake +} + +func (c *FakeDiscoveryV1beta1) EndpointSlices(namespace string) v1beta1.EndpointSliceInterface { + return &FakeEndpointSlices{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeDiscoveryV1beta1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/pkg/generated/clientset/versioned/typed/discovery.k8s.io/v1beta1/fake/fake_endpointslice.go b/pkg/generated/clientset/versioned/typed/discovery.k8s.io/v1beta1/fake/fake_endpointslice.go new file mode 100644 index 00000000..06ae1ef9 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/discovery.k8s.io/v1beta1/fake/fake_endpointslice.go @@ -0,0 +1,130 @@ +/* +Copyright 2019 Wrangler Sample Controller Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v1beta1 "k8s.io/api/discovery/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeEndpointSlices implements EndpointSliceInterface +type FakeEndpointSlices struct { + Fake *FakeDiscoveryV1beta1 + ns string +} + +var endpointslicesResource = schema.GroupVersionResource{Group: "discovery.k8s.io", Version: "v1beta1", Resource: "endpointslices"} + +var endpointslicesKind = schema.GroupVersionKind{Group: "discovery.k8s.io", Version: "v1beta1", Kind: "EndpointSlice"} + +// Get takes name of the endpointSlice, and returns the corresponding endpointSlice object, and an error if there is any. +func (c *FakeEndpointSlices) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.EndpointSlice, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(endpointslicesResource, c.ns, name), &v1beta1.EndpointSlice{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.EndpointSlice), err +} + +// List takes label and field selectors, and returns the list of EndpointSlices that match those selectors. +func (c *FakeEndpointSlices) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.EndpointSliceList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(endpointslicesResource, endpointslicesKind, c.ns, opts), &v1beta1.EndpointSliceList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.EndpointSliceList{ListMeta: obj.(*v1beta1.EndpointSliceList).ListMeta} + for _, item := range obj.(*v1beta1.EndpointSliceList).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 endpointSlices. +func (c *FakeEndpointSlices) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(endpointslicesResource, c.ns, opts)) + +} + +// Create takes the representation of a endpointSlice and creates it. Returns the server's representation of the endpointSlice, and an error, if there is any. +func (c *FakeEndpointSlices) Create(ctx context.Context, endpointSlice *v1beta1.EndpointSlice, opts v1.CreateOptions) (result *v1beta1.EndpointSlice, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(endpointslicesResource, c.ns, endpointSlice), &v1beta1.EndpointSlice{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.EndpointSlice), err +} + +// Update takes the representation of a endpointSlice and updates it. Returns the server's representation of the endpointSlice, and an error, if there is any. +func (c *FakeEndpointSlices) Update(ctx context.Context, endpointSlice *v1beta1.EndpointSlice, opts v1.UpdateOptions) (result *v1beta1.EndpointSlice, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(endpointslicesResource, c.ns, endpointSlice), &v1beta1.EndpointSlice{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.EndpointSlice), err +} + +// Delete takes name of the endpointSlice and deletes it. Returns an error if one occurs. +func (c *FakeEndpointSlices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(endpointslicesResource, c.ns, name), &v1beta1.EndpointSlice{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeEndpointSlices) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(endpointslicesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.EndpointSliceList{}) + return err +} + +// Patch applies the patch and returns the patched endpointSlice. +func (c *FakeEndpointSlices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.EndpointSlice, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(endpointslicesResource, c.ns, name, pt, data, subresources...), &v1beta1.EndpointSlice{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.EndpointSlice), err +} diff --git a/pkg/generated/clientset/versioned/typed/discovery.k8s.io/v1beta1/generated_expansion.go b/pkg/generated/clientset/versioned/typed/discovery.k8s.io/v1beta1/generated_expansion.go new file mode 100644 index 00000000..0b1b98a3 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/discovery.k8s.io/v1beta1/generated_expansion.go @@ -0,0 +1,21 @@ +/* +Copyright 2019 Wrangler Sample Controller Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1beta1 + +type EndpointSliceExpansion interface{} diff --git a/pkg/generated/clientset/versioned/typed/network.harvesterhci.io/v1alpha1/doc.go b/pkg/generated/clientset/versioned/typed/loadbalancer.harvesterhci.io/v1alpha1/doc.go similarity index 100% rename from pkg/generated/clientset/versioned/typed/network.harvesterhci.io/v1alpha1/doc.go rename to pkg/generated/clientset/versioned/typed/loadbalancer.harvesterhci.io/v1alpha1/doc.go diff --git a/pkg/generated/clientset/versioned/typed/loadbalancer.harvesterhci.io/v1alpha1/fake/doc.go b/pkg/generated/clientset/versioned/typed/loadbalancer.harvesterhci.io/v1alpha1/fake/doc.go new file mode 100644 index 00000000..8869b035 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/loadbalancer.harvesterhci.io/v1alpha1/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2019 Wrangler Sample Controller Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by main. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/pkg/generated/clientset/versioned/typed/network.harvesterhci.io/v1alpha1/fake/fake_loadbalancer.go b/pkg/generated/clientset/versioned/typed/loadbalancer.harvesterhci.io/v1alpha1/fake/fake_loadbalancer.go similarity index 93% rename from pkg/generated/clientset/versioned/typed/network.harvesterhci.io/v1alpha1/fake/fake_loadbalancer.go rename to pkg/generated/clientset/versioned/typed/loadbalancer.harvesterhci.io/v1alpha1/fake/fake_loadbalancer.go index a56a36fc..eada9289 100644 --- a/pkg/generated/clientset/versioned/typed/network.harvesterhci.io/v1alpha1/fake/fake_loadbalancer.go +++ b/pkg/generated/clientset/versioned/typed/loadbalancer.harvesterhci.io/v1alpha1/fake/fake_loadbalancer.go @@ -21,7 +21,7 @@ package fake import ( "context" - v1alpha1 "github.com/harvester/harvester-conveyor/pkg/apis/network.harvesterhci.io/v1alpha1" + v1alpha1 "github.com/harvester/harvester-load-balancer/pkg/apis/loadbalancer.harvesterhci.io/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -32,13 +32,13 @@ import ( // FakeLoadBalancers implements LoadBalancerInterface type FakeLoadBalancers struct { - Fake *FakeNetworkV1alpha1 + Fake *FakeLoadbalancerV1alpha1 ns string } -var loadbalancersResource = schema.GroupVersionResource{Group: "network.harvesterhci.io", Version: "v1alpha1", Resource: "loadbalancers"} +var loadbalancersResource = schema.GroupVersionResource{Group: "loadbalancer.harvesterhci.io", Version: "v1alpha1", Resource: "loadbalancers"} -var loadbalancersKind = schema.GroupVersionKind{Group: "network.harvesterhci.io", Version: "v1alpha1", Kind: "LoadBalancer"} +var loadbalancersKind = schema.GroupVersionKind{Group: "loadbalancer.harvesterhci.io", Version: "v1alpha1", Kind: "LoadBalancer"} // Get takes name of the loadBalancer, and returns the corresponding loadBalancer object, and an error if there is any. func (c *FakeLoadBalancers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.LoadBalancer, err error) { diff --git a/pkg/generated/clientset/versioned/typed/network.harvesterhci.io/v1alpha1/fake/fake_network.harvesterhci.io_client.go b/pkg/generated/clientset/versioned/typed/loadbalancer.harvesterhci.io/v1alpha1/fake/fake_loadbalancer.harvesterhci.io_client.go similarity index 73% rename from pkg/generated/clientset/versioned/typed/network.harvesterhci.io/v1alpha1/fake/fake_network.harvesterhci.io_client.go rename to pkg/generated/clientset/versioned/typed/loadbalancer.harvesterhci.io/v1alpha1/fake/fake_loadbalancer.harvesterhci.io_client.go index ed46d7a9..c7e5d269 100644 --- a/pkg/generated/clientset/versioned/typed/network.harvesterhci.io/v1alpha1/fake/fake_network.harvesterhci.io_client.go +++ b/pkg/generated/clientset/versioned/typed/loadbalancer.harvesterhci.io/v1alpha1/fake/fake_loadbalancer.harvesterhci.io_client.go @@ -19,22 +19,22 @@ limitations under the License. package fake import ( - v1alpha1 "github.com/harvester/harvester-conveyor/pkg/generated/clientset/versioned/typed/network.harvesterhci.io/v1alpha1" + v1alpha1 "github.com/harvester/harvester-load-balancer/pkg/generated/clientset/versioned/typed/loadbalancer.harvesterhci.io/v1alpha1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) -type FakeNetworkV1alpha1 struct { +type FakeLoadbalancerV1alpha1 struct { *testing.Fake } -func (c *FakeNetworkV1alpha1) LoadBalancers(namespace string) v1alpha1.LoadBalancerInterface { +func (c *FakeLoadbalancerV1alpha1) LoadBalancers(namespace string) v1alpha1.LoadBalancerInterface { return &FakeLoadBalancers{c, namespace} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *FakeNetworkV1alpha1) RESTClient() rest.Interface { +func (c *FakeLoadbalancerV1alpha1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } diff --git a/pkg/generated/clientset/versioned/typed/network.harvesterhci.io/v1alpha1/generated_expansion.go b/pkg/generated/clientset/versioned/typed/loadbalancer.harvesterhci.io/v1alpha1/generated_expansion.go similarity index 100% rename from pkg/generated/clientset/versioned/typed/network.harvesterhci.io/v1alpha1/generated_expansion.go rename to pkg/generated/clientset/versioned/typed/loadbalancer.harvesterhci.io/v1alpha1/generated_expansion.go diff --git a/pkg/generated/clientset/versioned/typed/network.harvesterhci.io/v1alpha1/loadbalancer.go b/pkg/generated/clientset/versioned/typed/loadbalancer.harvesterhci.io/v1alpha1/loadbalancer.go similarity index 95% rename from pkg/generated/clientset/versioned/typed/network.harvesterhci.io/v1alpha1/loadbalancer.go rename to pkg/generated/clientset/versioned/typed/loadbalancer.harvesterhci.io/v1alpha1/loadbalancer.go index dd5e4807..28bd3944 100644 --- a/pkg/generated/clientset/versioned/typed/network.harvesterhci.io/v1alpha1/loadbalancer.go +++ b/pkg/generated/clientset/versioned/typed/loadbalancer.harvesterhci.io/v1alpha1/loadbalancer.go @@ -22,8 +22,8 @@ import ( "context" "time" - v1alpha1 "github.com/harvester/harvester-conveyor/pkg/apis/network.harvesterhci.io/v1alpha1" - scheme "github.com/harvester/harvester-conveyor/pkg/generated/clientset/versioned/scheme" + v1alpha1 "github.com/harvester/harvester-load-balancer/pkg/apis/loadbalancer.harvesterhci.io/v1alpha1" + scheme "github.com/harvester/harvester-load-balancer/pkg/generated/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" @@ -57,7 +57,7 @@ type loadBalancers struct { } // newLoadBalancers returns a LoadBalancers -func newLoadBalancers(c *NetworkV1alpha1Client, namespace string) *loadBalancers { +func newLoadBalancers(c *LoadbalancerV1alpha1Client, namespace string) *loadBalancers { return &loadBalancers{ client: c.RESTClient(), ns: namespace, diff --git a/pkg/generated/clientset/versioned/typed/network.harvesterhci.io/v1alpha1/network.harvesterhci.io_client.go b/pkg/generated/clientset/versioned/typed/loadbalancer.harvesterhci.io/v1alpha1/loadbalancer.harvesterhci.io_client.go similarity index 59% rename from pkg/generated/clientset/versioned/typed/network.harvesterhci.io/v1alpha1/network.harvesterhci.io_client.go rename to pkg/generated/clientset/versioned/typed/loadbalancer.harvesterhci.io/v1alpha1/loadbalancer.harvesterhci.io_client.go index 1f99cdbe..f16273aa 100644 --- a/pkg/generated/clientset/versioned/typed/network.harvesterhci.io/v1alpha1/network.harvesterhci.io_client.go +++ b/pkg/generated/clientset/versioned/typed/loadbalancer.harvesterhci.io/v1alpha1/loadbalancer.harvesterhci.io_client.go @@ -19,27 +19,27 @@ limitations under the License. package v1alpha1 import ( - v1alpha1 "github.com/harvester/harvester-conveyor/pkg/apis/network.harvesterhci.io/v1alpha1" - "github.com/harvester/harvester-conveyor/pkg/generated/clientset/versioned/scheme" + v1alpha1 "github.com/harvester/harvester-load-balancer/pkg/apis/loadbalancer.harvesterhci.io/v1alpha1" + "github.com/harvester/harvester-load-balancer/pkg/generated/clientset/versioned/scheme" rest "k8s.io/client-go/rest" ) -type NetworkV1alpha1Interface interface { +type LoadbalancerV1alpha1Interface interface { RESTClient() rest.Interface LoadBalancersGetter } -// NetworkV1alpha1Client is used to interact with features provided by the network.harvesterhci.io group. -type NetworkV1alpha1Client struct { +// LoadbalancerV1alpha1Client is used to interact with features provided by the loadbalancer.harvesterhci.io group. +type LoadbalancerV1alpha1Client struct { restClient rest.Interface } -func (c *NetworkV1alpha1Client) LoadBalancers(namespace string) LoadBalancerInterface { +func (c *LoadbalancerV1alpha1Client) LoadBalancers(namespace string) LoadBalancerInterface { return newLoadBalancers(c, namespace) } -// NewForConfig creates a new NetworkV1alpha1Client for the given config. -func NewForConfig(c *rest.Config) (*NetworkV1alpha1Client, error) { +// NewForConfig creates a new LoadbalancerV1alpha1Client for the given config. +func NewForConfig(c *rest.Config) (*LoadbalancerV1alpha1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err @@ -48,12 +48,12 @@ func NewForConfig(c *rest.Config) (*NetworkV1alpha1Client, error) { if err != nil { return nil, err } - return &NetworkV1alpha1Client{client}, nil + return &LoadbalancerV1alpha1Client{client}, nil } -// NewForConfigOrDie creates a new NetworkV1alpha1Client for the given config and +// NewForConfigOrDie creates a new LoadbalancerV1alpha1Client for the given config and // panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *NetworkV1alpha1Client { +func NewForConfigOrDie(c *rest.Config) *LoadbalancerV1alpha1Client { client, err := NewForConfig(c) if err != nil { panic(err) @@ -61,9 +61,9 @@ func NewForConfigOrDie(c *rest.Config) *NetworkV1alpha1Client { return client } -// New creates a new NetworkV1alpha1Client for the given RESTClient. -func New(c rest.Interface) *NetworkV1alpha1Client { - return &NetworkV1alpha1Client{c} +// New creates a new LoadbalancerV1alpha1Client for the given RESTClient. +func New(c rest.Interface) *LoadbalancerV1alpha1Client { + return &LoadbalancerV1alpha1Client{c} } func setConfigDefaults(config *rest.Config) error { @@ -81,7 +81,7 @@ func setConfigDefaults(config *rest.Config) error { // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *NetworkV1alpha1Client) RESTClient() rest.Interface { +func (c *LoadbalancerV1alpha1Client) RESTClient() rest.Interface { if c == nil { return nil } diff --git a/pkg/generated/controllers/core/v1/interface.go b/pkg/generated/controllers/core/v1/interface.go deleted file mode 100644 index e0f56802..00000000 --- a/pkg/generated/controllers/core/v1/interface.go +++ /dev/null @@ -1,48 +0,0 @@ -/* -Copyright 2019 Wrangler Sample Controller Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by main. DO NOT EDIT. - -package v1 - -import ( - "github.com/rancher/lasso/pkg/controller" - "github.com/rancher/wrangler/pkg/schemes" - v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -func init() { - schemes.Register(v1.AddToScheme) -} - -type Interface interface { - Service() ServiceController -} - -func New(controllerFactory controller.SharedControllerFactory) Interface { - return &version{ - controllerFactory: controllerFactory, - } -} - -type version struct { - controllerFactory controller.SharedControllerFactory -} - -func (c *version) Service() ServiceController { - return NewServiceController(schema.GroupVersionKind{Group: "", Version: "v1", Kind: "Service"}, "services", true, c.controllerFactory) -} diff --git a/pkg/generated/controllers/core/v1/service.go b/pkg/generated/controllers/core/v1/service.go deleted file mode 100644 index 91b48edd..00000000 --- a/pkg/generated/controllers/core/v1/service.go +++ /dev/null @@ -1,372 +0,0 @@ -/* -Copyright 2019 Wrangler Sample Controller Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by main. DO NOT EDIT. - -package v1 - -import ( - "context" - "time" - - "github.com/rancher/lasso/pkg/client" - "github.com/rancher/lasso/pkg/controller" - "github.com/rancher/wrangler/pkg/apply" - "github.com/rancher/wrangler/pkg/condition" - "github.com/rancher/wrangler/pkg/generic" - "github.com/rancher/wrangler/pkg/kv" - v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/equality" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -type ServiceHandler func(string, *v1.Service) (*v1.Service, error) - -type ServiceController interface { - generic.ControllerMeta - ServiceClient - - OnChange(ctx context.Context, name string, sync ServiceHandler) - OnRemove(ctx context.Context, name string, sync ServiceHandler) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, duration time.Duration) - - Cache() ServiceCache -} - -type ServiceClient interface { - Create(*v1.Service) (*v1.Service, error) - Update(*v1.Service) (*v1.Service, error) - UpdateStatus(*v1.Service) (*v1.Service, error) - Delete(namespace, name string, options *metav1.DeleteOptions) error - Get(namespace, name string, options metav1.GetOptions) (*v1.Service, error) - List(namespace string, opts metav1.ListOptions) (*v1.ServiceList, error) - Watch(namespace string, opts metav1.ListOptions) (watch.Interface, error) - Patch(namespace, name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Service, err error) -} - -type ServiceCache interface { - Get(namespace, name string) (*v1.Service, error) - List(namespace string, selector labels.Selector) ([]*v1.Service, error) - - AddIndexer(indexName string, indexer ServiceIndexer) - GetByIndex(indexName, key string) ([]*v1.Service, error) -} - -type ServiceIndexer func(obj *v1.Service) ([]string, error) - -type serviceController struct { - controller controller.SharedController - client *client.Client - gvk schema.GroupVersionKind - groupResource schema.GroupResource -} - -func NewServiceController(gvk schema.GroupVersionKind, resource string, namespaced bool, controller controller.SharedControllerFactory) ServiceController { - c := controller.ForResourceKind(gvk.GroupVersion().WithResource(resource), gvk.Kind, namespaced) - return &serviceController{ - controller: c, - client: c.Client(), - gvk: gvk, - groupResource: schema.GroupResource{ - Group: gvk.Group, - Resource: resource, - }, - } -} - -func FromServiceHandlerToHandler(sync ServiceHandler) generic.Handler { - return func(key string, obj runtime.Object) (ret runtime.Object, err error) { - var v *v1.Service - if obj == nil { - v, err = sync(key, nil) - } else { - v, err = sync(key, obj.(*v1.Service)) - } - if v == nil { - return nil, err - } - return v, err - } -} - -func (c *serviceController) Updater() generic.Updater { - return func(obj runtime.Object) (runtime.Object, error) { - newObj, err := c.Update(obj.(*v1.Service)) - if newObj == nil { - return nil, err - } - return newObj, err - } -} - -func UpdateServiceDeepCopyOnChange(client ServiceClient, obj *v1.Service, handler func(obj *v1.Service) (*v1.Service, error)) (*v1.Service, error) { - if obj == nil { - return obj, nil - } - - copyObj := obj.DeepCopy() - newObj, err := handler(copyObj) - if newObj != nil { - copyObj = newObj - } - if obj.ResourceVersion == copyObj.ResourceVersion && !equality.Semantic.DeepEqual(obj, copyObj) { - return client.Update(copyObj) - } - - return copyObj, err -} - -func (c *serviceController) AddGenericHandler(ctx context.Context, name string, handler generic.Handler) { - c.controller.RegisterHandler(ctx, name, controller.SharedControllerHandlerFunc(handler)) -} - -func (c *serviceController) AddGenericRemoveHandler(ctx context.Context, name string, handler generic.Handler) { - c.AddGenericHandler(ctx, name, generic.NewRemoveHandler(name, c.Updater(), handler)) -} - -func (c *serviceController) OnChange(ctx context.Context, name string, sync ServiceHandler) { - c.AddGenericHandler(ctx, name, FromServiceHandlerToHandler(sync)) -} - -func (c *serviceController) OnRemove(ctx context.Context, name string, sync ServiceHandler) { - c.AddGenericHandler(ctx, name, generic.NewRemoveHandler(name, c.Updater(), FromServiceHandlerToHandler(sync))) -} - -func (c *serviceController) Enqueue(namespace, name string) { - c.controller.Enqueue(namespace, name) -} - -func (c *serviceController) EnqueueAfter(namespace, name string, duration time.Duration) { - c.controller.EnqueueAfter(namespace, name, duration) -} - -func (c *serviceController) Informer() cache.SharedIndexInformer { - return c.controller.Informer() -} - -func (c *serviceController) GroupVersionKind() schema.GroupVersionKind { - return c.gvk -} - -func (c *serviceController) Cache() ServiceCache { - return &serviceCache{ - indexer: c.Informer().GetIndexer(), - resource: c.groupResource, - } -} - -func (c *serviceController) Create(obj *v1.Service) (*v1.Service, error) { - result := &v1.Service{} - return result, c.client.Create(context.TODO(), obj.Namespace, obj, result, metav1.CreateOptions{}) -} - -func (c *serviceController) Update(obj *v1.Service) (*v1.Service, error) { - result := &v1.Service{} - return result, c.client.Update(context.TODO(), obj.Namespace, obj, result, metav1.UpdateOptions{}) -} - -func (c *serviceController) UpdateStatus(obj *v1.Service) (*v1.Service, error) { - result := &v1.Service{} - return result, c.client.UpdateStatus(context.TODO(), obj.Namespace, obj, result, metav1.UpdateOptions{}) -} - -func (c *serviceController) Delete(namespace, name string, options *metav1.DeleteOptions) error { - if options == nil { - options = &metav1.DeleteOptions{} - } - return c.client.Delete(context.TODO(), namespace, name, *options) -} - -func (c *serviceController) Get(namespace, name string, options metav1.GetOptions) (*v1.Service, error) { - result := &v1.Service{} - return result, c.client.Get(context.TODO(), namespace, name, result, options) -} - -func (c *serviceController) List(namespace string, opts metav1.ListOptions) (*v1.ServiceList, error) { - result := &v1.ServiceList{} - return result, c.client.List(context.TODO(), namespace, result, opts) -} - -func (c *serviceController) Watch(namespace string, opts metav1.ListOptions) (watch.Interface, error) { - return c.client.Watch(context.TODO(), namespace, opts) -} - -func (c *serviceController) Patch(namespace, name string, pt types.PatchType, data []byte, subresources ...string) (*v1.Service, error) { - result := &v1.Service{} - return result, c.client.Patch(context.TODO(), namespace, name, pt, data, result, metav1.PatchOptions{}, subresources...) -} - -type serviceCache struct { - indexer cache.Indexer - resource schema.GroupResource -} - -func (c *serviceCache) Get(namespace, name string) (*v1.Service, error) { - obj, exists, err := c.indexer.GetByKey(namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(c.resource, name) - } - return obj.(*v1.Service), nil -} - -func (c *serviceCache) List(namespace string, selector labels.Selector) (ret []*v1.Service, err error) { - - err = cache.ListAllByNamespace(c.indexer, namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Service)) - }) - - return ret, err -} - -func (c *serviceCache) AddIndexer(indexName string, indexer ServiceIndexer) { - utilruntime.Must(c.indexer.AddIndexers(map[string]cache.IndexFunc{ - indexName: func(obj interface{}) (strings []string, e error) { - return indexer(obj.(*v1.Service)) - }, - })) -} - -func (c *serviceCache) GetByIndex(indexName, key string) (result []*v1.Service, err error) { - objs, err := c.indexer.ByIndex(indexName, key) - if err != nil { - return nil, err - } - result = make([]*v1.Service, 0, len(objs)) - for _, obj := range objs { - result = append(result, obj.(*v1.Service)) - } - return result, nil -} - -type ServiceStatusHandler func(obj *v1.Service, status v1.ServiceStatus) (v1.ServiceStatus, error) - -type ServiceGeneratingHandler func(obj *v1.Service, status v1.ServiceStatus) ([]runtime.Object, v1.ServiceStatus, error) - -func RegisterServiceStatusHandler(ctx context.Context, controller ServiceController, condition condition.Cond, name string, handler ServiceStatusHandler) { - statusHandler := &serviceStatusHandler{ - client: controller, - condition: condition, - handler: handler, - } - controller.AddGenericHandler(ctx, name, FromServiceHandlerToHandler(statusHandler.sync)) -} - -func RegisterServiceGeneratingHandler(ctx context.Context, controller ServiceController, apply apply.Apply, - condition condition.Cond, name string, handler ServiceGeneratingHandler, opts *generic.GeneratingHandlerOptions) { - statusHandler := &serviceGeneratingHandler{ - ServiceGeneratingHandler: handler, - apply: apply, - name: name, - gvk: controller.GroupVersionKind(), - } - if opts != nil { - statusHandler.opts = *opts - } - controller.OnChange(ctx, name, statusHandler.Remove) - RegisterServiceStatusHandler(ctx, controller, condition, name, statusHandler.Handle) -} - -type serviceStatusHandler struct { - client ServiceClient - condition condition.Cond - handler ServiceStatusHandler -} - -func (a *serviceStatusHandler) sync(key string, obj *v1.Service) (*v1.Service, error) { - if obj == nil { - return obj, nil - } - - origStatus := obj.Status.DeepCopy() - obj = obj.DeepCopy() - newStatus, err := a.handler(obj, obj.Status) - if err != nil { - // Revert to old status on error - newStatus = *origStatus.DeepCopy() - } - - if a.condition != "" { - if errors.IsConflict(err) { - a.condition.SetError(&newStatus, "", nil) - } else { - a.condition.SetError(&newStatus, "", err) - } - } - if !equality.Semantic.DeepEqual(origStatus, &newStatus) { - if a.condition != "" { - // Since status has changed, update the lastUpdatedTime - a.condition.LastUpdated(&newStatus, time.Now().UTC().Format(time.RFC3339)) - } - - var newErr error - obj.Status = newStatus - newObj, newErr := a.client.UpdateStatus(obj) - if err == nil { - err = newErr - } - if newErr == nil { - obj = newObj - } - } - return obj, err -} - -type serviceGeneratingHandler struct { - ServiceGeneratingHandler - apply apply.Apply - opts generic.GeneratingHandlerOptions - gvk schema.GroupVersionKind - name string -} - -func (a *serviceGeneratingHandler) Remove(key string, obj *v1.Service) (*v1.Service, error) { - if obj != nil { - return obj, nil - } - - obj = &v1.Service{} - obj.Namespace, obj.Name = kv.RSplit(key, "/") - obj.SetGroupVersionKind(a.gvk) - - return nil, generic.ConfigureApplyForObject(a.apply, obj, &a.opts). - WithOwner(obj). - WithSetID(a.name). - ApplyObjects() -} - -func (a *serviceGeneratingHandler) Handle(obj *v1.Service, status v1.ServiceStatus) (v1.ServiceStatus, error) { - objs, newStatus, err := a.ServiceGeneratingHandler(obj, status) - if err != nil { - return newStatus, err - } - - return newStatus, generic.ConfigureApplyForObject(a.apply, obj, &a.opts). - WithOwner(obj). - WithSetID(a.name). - ApplyObjects(objs...) -} diff --git a/pkg/generated/controllers/network.harvesterhci.io/factory.go b/pkg/generated/controllers/discovery.k8s.io/factory.go similarity index 96% rename from pkg/generated/controllers/network.harvesterhci.io/factory.go rename to pkg/generated/controllers/discovery.k8s.io/factory.go index 36a76a1b..913e96c0 100644 --- a/pkg/generated/controllers/network.harvesterhci.io/factory.go +++ b/pkg/generated/controllers/discovery.k8s.io/factory.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by main. DO NOT EDIT. -package network +package discovery import ( "github.com/rancher/wrangler/pkg/generic" @@ -62,6 +62,6 @@ func NewFactoryFromConfigWithOptionsOrDie(config *rest.Config, opts *FactoryOpti return f } -func (c *Factory) Network() Interface { +func (c *Factory) Discovery() Interface { return New(c.ControllerFactory()) } diff --git a/pkg/generated/controllers/core/interface.go b/pkg/generated/controllers/discovery.k8s.io/interface.go similarity index 79% rename from pkg/generated/controllers/core/interface.go rename to pkg/generated/controllers/discovery.k8s.io/interface.go index 53b8134b..dc8ab6b1 100644 --- a/pkg/generated/controllers/core/interface.go +++ b/pkg/generated/controllers/discovery.k8s.io/interface.go @@ -16,16 +16,14 @@ limitations under the License. // Code generated by main. DO NOT EDIT. -package core +package discovery import ( - v1 "github.com/harvester/harvester-conveyor/pkg/generated/controllers/core/v1" - v1beta1 "github.com/harvester/harvester-conveyor/pkg/generated/controllers/core/v1beta1" + v1beta1 "github.com/harvester/harvester-load-balancer/pkg/generated/controllers/discovery.k8s.io/v1beta1" "github.com/rancher/lasso/pkg/controller" ) type Interface interface { - V1() v1.Interface V1beta1() v1beta1.Interface } @@ -40,10 +38,6 @@ func New(controllerFactory controller.SharedControllerFactory) Interface { } } -func (g *group) V1() v1.Interface { - return v1.New(g.controllerFactory) -} - func (g *group) V1beta1() v1beta1.Interface { return v1beta1.New(g.controllerFactory) } diff --git a/pkg/generated/controllers/core/v1beta1/endpointslice.go b/pkg/generated/controllers/discovery.k8s.io/v1beta1/endpointslice.go similarity index 100% rename from pkg/generated/controllers/core/v1beta1/endpointslice.go rename to pkg/generated/controllers/discovery.k8s.io/v1beta1/endpointslice.go diff --git a/pkg/generated/controllers/core/v1beta1/interface.go b/pkg/generated/controllers/discovery.k8s.io/v1beta1/interface.go similarity index 92% rename from pkg/generated/controllers/core/v1beta1/interface.go rename to pkg/generated/controllers/discovery.k8s.io/v1beta1/interface.go index 5b517302..9d3d2ff5 100644 --- a/pkg/generated/controllers/core/v1beta1/interface.go +++ b/pkg/generated/controllers/discovery.k8s.io/v1beta1/interface.go @@ -44,5 +44,5 @@ type version struct { } func (c *version) EndpointSlice() EndpointSliceController { - return NewEndpointSliceController(schema.GroupVersionKind{Group: "", Version: "v1beta1", Kind: "EndpointSlice"}, "endpointslices", true, c.controllerFactory) + return NewEndpointSliceController(schema.GroupVersionKind{Group: "discovery.k8s.io", Version: "v1beta1", Kind: "EndpointSlice"}, "endpointslices", true, c.controllerFactory) } diff --git a/pkg/generated/controllers/core/factory.go b/pkg/generated/controllers/loadbalancer.harvesterhci.io/factory.go similarity index 96% rename from pkg/generated/controllers/core/factory.go rename to pkg/generated/controllers/loadbalancer.harvesterhci.io/factory.go index 58c171e2..05136c08 100644 --- a/pkg/generated/controllers/core/factory.go +++ b/pkg/generated/controllers/loadbalancer.harvesterhci.io/factory.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by main. DO NOT EDIT. -package core +package loadbalancer import ( "github.com/rancher/wrangler/pkg/generic" @@ -62,6 +62,6 @@ func NewFactoryFromConfigWithOptionsOrDie(config *rest.Config, opts *FactoryOpti return f } -func (c *Factory) Core() Interface { +func (c *Factory) Loadbalancer() Interface { return New(c.ControllerFactory()) } diff --git a/pkg/generated/controllers/network.harvesterhci.io/interface.go b/pkg/generated/controllers/loadbalancer.harvesterhci.io/interface.go similarity index 88% rename from pkg/generated/controllers/network.harvesterhci.io/interface.go rename to pkg/generated/controllers/loadbalancer.harvesterhci.io/interface.go index d9ab59ad..1f95ff7d 100644 --- a/pkg/generated/controllers/network.harvesterhci.io/interface.go +++ b/pkg/generated/controllers/loadbalancer.harvesterhci.io/interface.go @@ -16,10 +16,10 @@ limitations under the License. // Code generated by main. DO NOT EDIT. -package network +package loadbalancer import ( - v1alpha1 "github.com/harvester/harvester-conveyor/pkg/generated/controllers/network.harvesterhci.io/v1alpha1" + v1alpha1 "github.com/harvester/harvester-load-balancer/pkg/generated/controllers/loadbalancer.harvesterhci.io/v1alpha1" "github.com/rancher/lasso/pkg/controller" ) diff --git a/pkg/generated/controllers/network.harvesterhci.io/v1alpha1/interface.go b/pkg/generated/controllers/loadbalancer.harvesterhci.io/v1alpha1/interface.go similarity index 84% rename from pkg/generated/controllers/network.harvesterhci.io/v1alpha1/interface.go rename to pkg/generated/controllers/loadbalancer.harvesterhci.io/v1alpha1/interface.go index bad64d49..17d9ac70 100644 --- a/pkg/generated/controllers/network.harvesterhci.io/v1alpha1/interface.go +++ b/pkg/generated/controllers/loadbalancer.harvesterhci.io/v1alpha1/interface.go @@ -19,7 +19,7 @@ limitations under the License. package v1alpha1 import ( - v1alpha1 "github.com/harvester/harvester-conveyor/pkg/apis/network.harvesterhci.io/v1alpha1" + v1alpha1 "github.com/harvester/harvester-load-balancer/pkg/apis/loadbalancer.harvesterhci.io/v1alpha1" "github.com/rancher/lasso/pkg/controller" "github.com/rancher/wrangler/pkg/schemes" "k8s.io/apimachinery/pkg/runtime/schema" @@ -44,5 +44,5 @@ type version struct { } func (c *version) LoadBalancer() LoadBalancerController { - return NewLoadBalancerController(schema.GroupVersionKind{Group: "network.harvesterhci.io", Version: "v1alpha1", Kind: "LoadBalancer"}, "loadbalancers", true, c.controllerFactory) + return NewLoadBalancerController(schema.GroupVersionKind{Group: "loadbalancer.harvesterhci.io", Version: "v1alpha1", Kind: "LoadBalancer"}, "loadbalancers", true, c.controllerFactory) } diff --git a/pkg/generated/controllers/network.harvesterhci.io/v1alpha1/loadbalancer.go b/pkg/generated/controllers/loadbalancer.harvesterhci.io/v1alpha1/loadbalancer.go similarity index 99% rename from pkg/generated/controllers/network.harvesterhci.io/v1alpha1/loadbalancer.go rename to pkg/generated/controllers/loadbalancer.harvesterhci.io/v1alpha1/loadbalancer.go index 4dac14b9..cf793242 100644 --- a/pkg/generated/controllers/network.harvesterhci.io/v1alpha1/loadbalancer.go +++ b/pkg/generated/controllers/loadbalancer.harvesterhci.io/v1alpha1/loadbalancer.go @@ -22,7 +22,7 @@ import ( "context" "time" - v1alpha1 "github.com/harvester/harvester-conveyor/pkg/apis/network.harvesterhci.io/v1alpha1" + v1alpha1 "github.com/harvester/harvester-load-balancer/pkg/apis/loadbalancer.harvesterhci.io/v1alpha1" "github.com/rancher/lasso/pkg/client" "github.com/rancher/lasso/pkg/controller" "github.com/rancher/wrangler/pkg/apply"