diff --git a/pkg/apis/migration.harvesterhci.io/v1beta1/doc.go b/pkg/apis/migration.harvesterhci.io/v1beta1/doc.go index 0c253e7..a8675f6 100644 --- a/pkg/apis/migration.harvesterhci.io/v1beta1/doc.go +++ b/pkg/apis/migration.harvesterhci.io/v1beta1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2022 Rancher Labs, Inc. +Copyright 2023 Rancher Labs, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/apis/migration.harvesterhci.io/v1beta1/zz_generated_deepcopy.go b/pkg/apis/migration.harvesterhci.io/v1beta1/zz_generated_deepcopy.go index 5a1fdb9..cc09453 100644 --- a/pkg/apis/migration.harvesterhci.io/v1beta1/zz_generated_deepcopy.go +++ b/pkg/apis/migration.harvesterhci.io/v1beta1/zz_generated_deepcopy.go @@ -2,7 +2,7 @@ // +build !ignore_autogenerated /* -Copyright 2022 Rancher Labs, Inc. +Copyright 2023 Rancher Labs, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/apis/migration.harvesterhci.io/v1beta1/zz_generated_list_types.go b/pkg/apis/migration.harvesterhci.io/v1beta1/zz_generated_list_types.go index c31bf6f..11353b8 100644 --- a/pkg/apis/migration.harvesterhci.io/v1beta1/zz_generated_list_types.go +++ b/pkg/apis/migration.harvesterhci.io/v1beta1/zz_generated_list_types.go @@ -1,5 +1,5 @@ /* -Copyright 2022 Rancher Labs, Inc. +Copyright 2023 Rancher Labs, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/apis/migration.harvesterhci.io/v1beta1/zz_generated_register.go b/pkg/apis/migration.harvesterhci.io/v1beta1/zz_generated_register.go index ea72021..31df6d6 100644 --- a/pkg/apis/migration.harvesterhci.io/v1beta1/zz_generated_register.go +++ b/pkg/apis/migration.harvesterhci.io/v1beta1/zz_generated_register.go @@ -1,5 +1,5 @@ /* -Copyright 2022 Rancher Labs, Inc. +Copyright 2023 Rancher Labs, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/apis/migration.harvesterhci.io/zz_generated_register.go b/pkg/apis/migration.harvesterhci.io/zz_generated_register.go index 0c61607..ac14e19 100644 --- a/pkg/apis/migration.harvesterhci.io/zz_generated_register.go +++ b/pkg/apis/migration.harvesterhci.io/zz_generated_register.go @@ -1,5 +1,5 @@ /* -Copyright 2022 Rancher Labs, Inc. +Copyright 2023 Rancher Labs, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/codegen/main.go b/pkg/codegen/main.go index 4af958c..b41dc80 100644 --- a/pkg/codegen/main.go +++ b/pkg/codegen/main.go @@ -20,7 +20,8 @@ func main() { Types: []interface{}{ "./pkg/apis/migration.harvesterhci.io/v1beta1", }, - GenerateTypes: true, + GenerateTypes: true, + GenerateClients: true, }, }, }) diff --git a/pkg/generated/clientset/versioned/clientset.go b/pkg/generated/clientset/versioned/clientset.go new file mode 100644 index 0000000..8b3ee6e --- /dev/null +++ b/pkg/generated/clientset/versioned/clientset.go @@ -0,0 +1,121 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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 versioned + +import ( + "fmt" + "net/http" + + migrationv1beta1 "github.com/harvester/vm-import-controller/pkg/generated/clientset/versioned/typed/migration.harvesterhci.io/v1beta1" + discovery "k8s.io/client-go/discovery" + rest "k8s.io/client-go/rest" + flowcontrol "k8s.io/client-go/util/flowcontrol" +) + +type Interface interface { + Discovery() discovery.DiscoveryInterface + MigrationV1beta1() migrationv1beta1.MigrationV1beta1Interface +} + +// Clientset contains the clients for groups. Each group has exactly one +// version included in a Clientset. +type Clientset struct { + *discovery.DiscoveryClient + migrationV1beta1 *migrationv1beta1.MigrationV1beta1Client +} + +// MigrationV1beta1 retrieves the MigrationV1beta1Client +func (c *Clientset) MigrationV1beta1() migrationv1beta1.MigrationV1beta1Interface { + return c.migrationV1beta1 +} + +// Discovery retrieves the DiscoveryClient +func (c *Clientset) Discovery() discovery.DiscoveryInterface { + if c == nil { + return nil + } + return c.DiscoveryClient +} + +// NewForConfig creates a new Clientset for the given config. +// If config's RateLimiter is not set and QPS and Burst are acceptable, +// NewForConfig will generate a rate-limiter in configShallowCopy. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*Clientset, error) { + configShallowCopy := *c + + if configShallowCopy.UserAgent == "" { + configShallowCopy.UserAgent = rest.DefaultKubernetesUserAgent() + } + + // share the transport between all clients + httpClient, err := rest.HTTPClientFor(&configShallowCopy) + if err != nil { + return nil, err + } + + return NewForConfigAndClient(&configShallowCopy, httpClient) +} + +// NewForConfigAndClient creates a new Clientset for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +// If config's RateLimiter is not set and QPS and Burst are acceptable, +// NewForConfigAndClient will generate a rate-limiter in configShallowCopy. +func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, error) { + configShallowCopy := *c + if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { + if configShallowCopy.Burst <= 0 { + return nil, fmt.Errorf("burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0") + } + configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) + } + + var cs Clientset + var err error + cs.migrationV1beta1, err = migrationv1beta1.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } + + cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } + return &cs, nil +} + +// NewForConfigOrDie creates a new Clientset for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *Clientset { + cs, err := NewForConfig(c) + if err != nil { + panic(err) + } + return cs +} + +// New creates a new Clientset for the given RESTClient. +func New(c rest.Interface) *Clientset { + var cs Clientset + cs.migrationV1beta1 = migrationv1beta1.New(c) + + cs.DiscoveryClient = discovery.NewDiscoveryClient(c) + return &cs +} diff --git a/pkg/generated/clientset/versioned/doc.go b/pkg/generated/clientset/versioned/doc.go new file mode 100644 index 0000000..4b0dfa8 --- /dev/null +++ b/pkg/generated/clientset/versioned/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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 clientset. +package versioned diff --git a/pkg/generated/clientset/versioned/fake/clientset_generated.go b/pkg/generated/clientset/versioned/fake/clientset_generated.go new file mode 100644 index 0000000..0392dbb --- /dev/null +++ b/pkg/generated/clientset/versioned/fake/clientset_generated.go @@ -0,0 +1,85 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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 ( + clientset "github.com/harvester/vm-import-controller/pkg/generated/clientset/versioned" + migrationv1beta1 "github.com/harvester/vm-import-controller/pkg/generated/clientset/versioned/typed/migration.harvesterhci.io/v1beta1" + fakemigrationv1beta1 "github.com/harvester/vm-import-controller/pkg/generated/clientset/versioned/typed/migration.harvesterhci.io/v1beta1/fake" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/discovery" + fakediscovery "k8s.io/client-go/discovery/fake" + "k8s.io/client-go/testing" +) + +// NewSimpleClientset returns a clientset that will respond with the provided objects. +// It's backed by a very simple object tracker that processes creates, updates and deletions as-is, +// without applying any validations and/or defaults. It shouldn't be considered a replacement +// for a real clientset and is mostly useful in simple unit tests. +func NewSimpleClientset(objects ...runtime.Object) *Clientset { + o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) + for _, obj := range objects { + if err := o.Add(obj); err != nil { + panic(err) + } + } + + cs := &Clientset{tracker: o} + cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} + cs.AddReactor("*", "*", testing.ObjectReaction(o)) + cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { + gvr := action.GetResource() + ns := action.GetNamespace() + watch, err := o.Watch(gvr, ns) + if err != nil { + return false, nil, err + } + return true, watch, nil + }) + + return cs +} + +// Clientset implements clientset.Interface. Meant to be embedded into a +// struct to get a default implementation. This makes faking out just the method +// you want to test easier. +type Clientset struct { + testing.Fake + discovery *fakediscovery.FakeDiscovery + tracker testing.ObjectTracker +} + +func (c *Clientset) Discovery() discovery.DiscoveryInterface { + return c.discovery +} + +func (c *Clientset) Tracker() testing.ObjectTracker { + return c.tracker +} + +var ( + _ clientset.Interface = &Clientset{} + _ testing.FakeClient = &Clientset{} +) + +// MigrationV1beta1 retrieves the MigrationV1beta1Client +func (c *Clientset) MigrationV1beta1() migrationv1beta1.MigrationV1beta1Interface { + return &fakemigrationv1beta1.FakeMigrationV1beta1{Fake: &c.Fake} +} diff --git a/pkg/generated/clientset/versioned/fake/doc.go b/pkg/generated/clientset/versioned/fake/doc.go new file mode 100644 index 0000000..31a6a19 --- /dev/null +++ b/pkg/generated/clientset/versioned/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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 fake clientset. +package fake diff --git a/pkg/generated/clientset/versioned/fake/register.go b/pkg/generated/clientset/versioned/fake/register.go new file mode 100644 index 0000000..f6b3a90 --- /dev/null +++ b/pkg/generated/clientset/versioned/fake/register.go @@ -0,0 +1,56 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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 ( + migrationv1beta1 "github.com/harvester/vm-import-controller/pkg/apis/migration.harvesterhci.io/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + serializer "k8s.io/apimachinery/pkg/runtime/serializer" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" +) + +var scheme = runtime.NewScheme() +var codecs = serializer.NewCodecFactory(scheme) + +var localSchemeBuilder = runtime.SchemeBuilder{ + migrationv1beta1.AddToScheme, +} + +// AddToScheme adds all types of this clientset into the given scheme. This allows composition +// of clientsets, like in: +// +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) +// +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// +// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types +// correctly. +var AddToScheme = localSchemeBuilder.AddToScheme + +func init() { + v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) + utilruntime.Must(AddToScheme(scheme)) +} diff --git a/pkg/generated/clientset/versioned/scheme/doc.go b/pkg/generated/clientset/versioned/scheme/doc.go new file mode 100644 index 0000000..db734cb --- /dev/null +++ b/pkg/generated/clientset/versioned/scheme/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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 contains the scheme of the automatically generated clientset. +package scheme diff --git a/pkg/generated/clientset/versioned/scheme/register.go b/pkg/generated/clientset/versioned/scheme/register.go new file mode 100644 index 0000000..de95fc9 --- /dev/null +++ b/pkg/generated/clientset/versioned/scheme/register.go @@ -0,0 +1,56 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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 scheme + +import ( + migrationv1beta1 "github.com/harvester/vm-import-controller/pkg/apis/migration.harvesterhci.io/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + serializer "k8s.io/apimachinery/pkg/runtime/serializer" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" +) + +var Scheme = runtime.NewScheme() +var Codecs = serializer.NewCodecFactory(Scheme) +var ParameterCodec = runtime.NewParameterCodec(Scheme) +var localSchemeBuilder = runtime.SchemeBuilder{ + migrationv1beta1.AddToScheme, +} + +// AddToScheme adds all types of this clientset into the given scheme. This allows composition +// of clientsets, like in: +// +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) +// +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// +// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types +// correctly. +var AddToScheme = localSchemeBuilder.AddToScheme + +func init() { + v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) + utilruntime.Must(AddToScheme(Scheme)) +} diff --git a/pkg/generated/clientset/versioned/typed/migration.harvesterhci.io/v1beta1/doc.go b/pkg/generated/clientset/versioned/typed/migration.harvesterhci.io/v1beta1/doc.go new file mode 100644 index 0000000..d9184ae --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/migration.harvesterhci.io/v1beta1/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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/migration.harvesterhci.io/v1beta1/fake/doc.go b/pkg/generated/clientset/versioned/typed/migration.harvesterhci.io/v1beta1/fake/doc.go new file mode 100644 index 0000000..85a2987 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/migration.harvesterhci.io/v1beta1/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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/migration.harvesterhci.io/v1beta1/fake/fake_migration.harvesterhci.io_client.go b/pkg/generated/clientset/versioned/typed/migration.harvesterhci.io/v1beta1/fake/fake_migration.harvesterhci.io_client.go new file mode 100644 index 0000000..f2f188e --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/migration.harvesterhci.io/v1beta1/fake/fake_migration.harvesterhci.io_client.go @@ -0,0 +1,48 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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/vm-import-controller/pkg/generated/clientset/versioned/typed/migration.harvesterhci.io/v1beta1" + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" +) + +type FakeMigrationV1beta1 struct { + *testing.Fake +} + +func (c *FakeMigrationV1beta1) OpenstackSources(namespace string) v1beta1.OpenstackSourceInterface { + return &FakeOpenstackSources{c, namespace} +} + +func (c *FakeMigrationV1beta1) VirtualMachineImports(namespace string) v1beta1.VirtualMachineImportInterface { + return &FakeVirtualMachineImports{c, namespace} +} + +func (c *FakeMigrationV1beta1) VmwareSources(namespace string) v1beta1.VmwareSourceInterface { + return &FakeVmwareSources{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeMigrationV1beta1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/pkg/generated/clientset/versioned/typed/migration.harvesterhci.io/v1beta1/fake/fake_openstacksource.go b/pkg/generated/clientset/versioned/typed/migration.harvesterhci.io/v1beta1/fake/fake_openstacksource.go new file mode 100644 index 0000000..7e44d48 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/migration.harvesterhci.io/v1beta1/fake/fake_openstacksource.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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 "github.com/harvester/vm-import-controller/pkg/apis/migration.harvesterhci.io/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" +) + +// FakeOpenstackSources implements OpenstackSourceInterface +type FakeOpenstackSources struct { + Fake *FakeMigrationV1beta1 + ns string +} + +var openstacksourcesResource = schema.GroupVersionResource{Group: "migration.harvesterhci.io", Version: "v1beta1", Resource: "openstacksources"} + +var openstacksourcesKind = schema.GroupVersionKind{Group: "migration.harvesterhci.io", Version: "v1beta1", Kind: "OpenstackSource"} + +// Get takes name of the openstackSource, and returns the corresponding openstackSource object, and an error if there is any. +func (c *FakeOpenstackSources) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.OpenstackSource, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(openstacksourcesResource, c.ns, name), &v1beta1.OpenstackSource{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.OpenstackSource), err +} + +// List takes label and field selectors, and returns the list of OpenstackSources that match those selectors. +func (c *FakeOpenstackSources) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.OpenstackSourceList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(openstacksourcesResource, openstacksourcesKind, c.ns, opts), &v1beta1.OpenstackSourceList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.OpenstackSourceList{ListMeta: obj.(*v1beta1.OpenstackSourceList).ListMeta} + for _, item := range obj.(*v1beta1.OpenstackSourceList).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 openstackSources. +func (c *FakeOpenstackSources) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(openstacksourcesResource, c.ns, opts)) + +} + +// Create takes the representation of a openstackSource and creates it. Returns the server's representation of the openstackSource, and an error, if there is any. +func (c *FakeOpenstackSources) Create(ctx context.Context, openstackSource *v1beta1.OpenstackSource, opts v1.CreateOptions) (result *v1beta1.OpenstackSource, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(openstacksourcesResource, c.ns, openstackSource), &v1beta1.OpenstackSource{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.OpenstackSource), err +} + +// Update takes the representation of a openstackSource and updates it. Returns the server's representation of the openstackSource, and an error, if there is any. +func (c *FakeOpenstackSources) Update(ctx context.Context, openstackSource *v1beta1.OpenstackSource, opts v1.UpdateOptions) (result *v1beta1.OpenstackSource, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(openstacksourcesResource, c.ns, openstackSource), &v1beta1.OpenstackSource{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.OpenstackSource), 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 *FakeOpenstackSources) UpdateStatus(ctx context.Context, openstackSource *v1beta1.OpenstackSource, opts v1.UpdateOptions) (*v1beta1.OpenstackSource, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(openstacksourcesResource, "status", c.ns, openstackSource), &v1beta1.OpenstackSource{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.OpenstackSource), err +} + +// Delete takes name of the openstackSource and deletes it. Returns an error if one occurs. +func (c *FakeOpenstackSources) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(openstacksourcesResource, c.ns, name, opts), &v1beta1.OpenstackSource{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeOpenstackSources) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(openstacksourcesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.OpenstackSourceList{}) + return err +} + +// Patch applies the patch and returns the patched openstackSource. +func (c *FakeOpenstackSources) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.OpenstackSource, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(openstacksourcesResource, c.ns, name, pt, data, subresources...), &v1beta1.OpenstackSource{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.OpenstackSource), err +} diff --git a/pkg/generated/clientset/versioned/typed/migration.harvesterhci.io/v1beta1/fake/fake_virtualmachineimport.go b/pkg/generated/clientset/versioned/typed/migration.harvesterhci.io/v1beta1/fake/fake_virtualmachineimport.go new file mode 100644 index 0000000..1d9b8a1 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/migration.harvesterhci.io/v1beta1/fake/fake_virtualmachineimport.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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 "github.com/harvester/vm-import-controller/pkg/apis/migration.harvesterhci.io/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" +) + +// FakeVirtualMachineImports implements VirtualMachineImportInterface +type FakeVirtualMachineImports struct { + Fake *FakeMigrationV1beta1 + ns string +} + +var virtualmachineimportsResource = schema.GroupVersionResource{Group: "migration.harvesterhci.io", Version: "v1beta1", Resource: "virtualmachineimports"} + +var virtualmachineimportsKind = schema.GroupVersionKind{Group: "migration.harvesterhci.io", Version: "v1beta1", Kind: "VirtualMachineImport"} + +// Get takes name of the virtualMachineImport, and returns the corresponding virtualMachineImport object, and an error if there is any. +func (c *FakeVirtualMachineImports) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VirtualMachineImport, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(virtualmachineimportsResource, c.ns, name), &v1beta1.VirtualMachineImport{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VirtualMachineImport), err +} + +// List takes label and field selectors, and returns the list of VirtualMachineImports that match those selectors. +func (c *FakeVirtualMachineImports) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VirtualMachineImportList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(virtualmachineimportsResource, virtualmachineimportsKind, c.ns, opts), &v1beta1.VirtualMachineImportList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.VirtualMachineImportList{ListMeta: obj.(*v1beta1.VirtualMachineImportList).ListMeta} + for _, item := range obj.(*v1beta1.VirtualMachineImportList).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 virtualMachineImports. +func (c *FakeVirtualMachineImports) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(virtualmachineimportsResource, c.ns, opts)) + +} + +// Create takes the representation of a virtualMachineImport and creates it. Returns the server's representation of the virtualMachineImport, and an error, if there is any. +func (c *FakeVirtualMachineImports) Create(ctx context.Context, virtualMachineImport *v1beta1.VirtualMachineImport, opts v1.CreateOptions) (result *v1beta1.VirtualMachineImport, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(virtualmachineimportsResource, c.ns, virtualMachineImport), &v1beta1.VirtualMachineImport{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VirtualMachineImport), err +} + +// Update takes the representation of a virtualMachineImport and updates it. Returns the server's representation of the virtualMachineImport, and an error, if there is any. +func (c *FakeVirtualMachineImports) Update(ctx context.Context, virtualMachineImport *v1beta1.VirtualMachineImport, opts v1.UpdateOptions) (result *v1beta1.VirtualMachineImport, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(virtualmachineimportsResource, c.ns, virtualMachineImport), &v1beta1.VirtualMachineImport{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VirtualMachineImport), 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 *FakeVirtualMachineImports) UpdateStatus(ctx context.Context, virtualMachineImport *v1beta1.VirtualMachineImport, opts v1.UpdateOptions) (*v1beta1.VirtualMachineImport, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(virtualmachineimportsResource, "status", c.ns, virtualMachineImport), &v1beta1.VirtualMachineImport{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VirtualMachineImport), err +} + +// Delete takes name of the virtualMachineImport and deletes it. Returns an error if one occurs. +func (c *FakeVirtualMachineImports) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(virtualmachineimportsResource, c.ns, name, opts), &v1beta1.VirtualMachineImport{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeVirtualMachineImports) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(virtualmachineimportsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.VirtualMachineImportList{}) + return err +} + +// Patch applies the patch and returns the patched virtualMachineImport. +func (c *FakeVirtualMachineImports) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VirtualMachineImport, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(virtualmachineimportsResource, c.ns, name, pt, data, subresources...), &v1beta1.VirtualMachineImport{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VirtualMachineImport), err +} diff --git a/pkg/generated/clientset/versioned/typed/migration.harvesterhci.io/v1beta1/fake/fake_vmwaresource.go b/pkg/generated/clientset/versioned/typed/migration.harvesterhci.io/v1beta1/fake/fake_vmwaresource.go new file mode 100644 index 0000000..2addf16 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/migration.harvesterhci.io/v1beta1/fake/fake_vmwaresource.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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 "github.com/harvester/vm-import-controller/pkg/apis/migration.harvesterhci.io/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" +) + +// FakeVmwareSources implements VmwareSourceInterface +type FakeVmwareSources struct { + Fake *FakeMigrationV1beta1 + ns string +} + +var vmwaresourcesResource = schema.GroupVersionResource{Group: "migration.harvesterhci.io", Version: "v1beta1", Resource: "vmwaresources"} + +var vmwaresourcesKind = schema.GroupVersionKind{Group: "migration.harvesterhci.io", Version: "v1beta1", Kind: "VmwareSource"} + +// Get takes name of the vmwareSource, and returns the corresponding vmwareSource object, and an error if there is any. +func (c *FakeVmwareSources) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VmwareSource, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(vmwaresourcesResource, c.ns, name), &v1beta1.VmwareSource{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VmwareSource), err +} + +// List takes label and field selectors, and returns the list of VmwareSources that match those selectors. +func (c *FakeVmwareSources) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VmwareSourceList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(vmwaresourcesResource, vmwaresourcesKind, c.ns, opts), &v1beta1.VmwareSourceList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.VmwareSourceList{ListMeta: obj.(*v1beta1.VmwareSourceList).ListMeta} + for _, item := range obj.(*v1beta1.VmwareSourceList).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 vmwareSources. +func (c *FakeVmwareSources) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(vmwaresourcesResource, c.ns, opts)) + +} + +// Create takes the representation of a vmwareSource and creates it. Returns the server's representation of the vmwareSource, and an error, if there is any. +func (c *FakeVmwareSources) Create(ctx context.Context, vmwareSource *v1beta1.VmwareSource, opts v1.CreateOptions) (result *v1beta1.VmwareSource, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(vmwaresourcesResource, c.ns, vmwareSource), &v1beta1.VmwareSource{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VmwareSource), err +} + +// Update takes the representation of a vmwareSource and updates it. Returns the server's representation of the vmwareSource, and an error, if there is any. +func (c *FakeVmwareSources) Update(ctx context.Context, vmwareSource *v1beta1.VmwareSource, opts v1.UpdateOptions) (result *v1beta1.VmwareSource, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(vmwaresourcesResource, c.ns, vmwareSource), &v1beta1.VmwareSource{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VmwareSource), 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 *FakeVmwareSources) UpdateStatus(ctx context.Context, vmwareSource *v1beta1.VmwareSource, opts v1.UpdateOptions) (*v1beta1.VmwareSource, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(vmwaresourcesResource, "status", c.ns, vmwareSource), &v1beta1.VmwareSource{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VmwareSource), err +} + +// Delete takes name of the vmwareSource and deletes it. Returns an error if one occurs. +func (c *FakeVmwareSources) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(vmwaresourcesResource, c.ns, name, opts), &v1beta1.VmwareSource{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeVmwareSources) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(vmwaresourcesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.VmwareSourceList{}) + return err +} + +// Patch applies the patch and returns the patched vmwareSource. +func (c *FakeVmwareSources) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VmwareSource, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(vmwaresourcesResource, c.ns, name, pt, data, subresources...), &v1beta1.VmwareSource{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VmwareSource), err +} diff --git a/pkg/generated/clientset/versioned/typed/migration.harvesterhci.io/v1beta1/generated_expansion.go b/pkg/generated/clientset/versioned/typed/migration.harvesterhci.io/v1beta1/generated_expansion.go new file mode 100644 index 0000000..37804c6 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/migration.harvesterhci.io/v1beta1/generated_expansion.go @@ -0,0 +1,25 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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 OpenstackSourceExpansion interface{} + +type VirtualMachineImportExpansion interface{} + +type VmwareSourceExpansion interface{} diff --git a/pkg/generated/clientset/versioned/typed/migration.harvesterhci.io/v1beta1/migration.harvesterhci.io_client.go b/pkg/generated/clientset/versioned/typed/migration.harvesterhci.io/v1beta1/migration.harvesterhci.io_client.go new file mode 100644 index 0000000..dff8f41 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/migration.harvesterhci.io/v1beta1/migration.harvesterhci.io_client.go @@ -0,0 +1,117 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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 ( + "net/http" + + v1beta1 "github.com/harvester/vm-import-controller/pkg/apis/migration.harvesterhci.io/v1beta1" + "github.com/harvester/vm-import-controller/pkg/generated/clientset/versioned/scheme" + rest "k8s.io/client-go/rest" +) + +type MigrationV1beta1Interface interface { + RESTClient() rest.Interface + OpenstackSourcesGetter + VirtualMachineImportsGetter + VmwareSourcesGetter +} + +// MigrationV1beta1Client is used to interact with features provided by the migration.harvesterhci.io group. +type MigrationV1beta1Client struct { + restClient rest.Interface +} + +func (c *MigrationV1beta1Client) OpenstackSources(namespace string) OpenstackSourceInterface { + return newOpenstackSources(c, namespace) +} + +func (c *MigrationV1beta1Client) VirtualMachineImports(namespace string) VirtualMachineImportInterface { + return newVirtualMachineImports(c, namespace) +} + +func (c *MigrationV1beta1Client) VmwareSources(namespace string) VmwareSourceInterface { + return newVmwareSources(c, namespace) +} + +// NewForConfig creates a new MigrationV1beta1Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*MigrationV1beta1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + httpClient, err := rest.HTTPClientFor(&config) + if err != nil { + return nil, err + } + return NewForConfigAndClient(&config, httpClient) +} + +// NewForConfigAndClient creates a new MigrationV1beta1Client for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*MigrationV1beta1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientForConfigAndClient(&config, h) + if err != nil { + return nil, err + } + return &MigrationV1beta1Client{client}, nil +} + +// NewForConfigOrDie creates a new MigrationV1beta1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *MigrationV1beta1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new MigrationV1beta1Client for the given RESTClient. +func New(c rest.Interface) *MigrationV1beta1Client { + return &MigrationV1beta1Client{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 *MigrationV1beta1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/pkg/generated/clientset/versioned/typed/migration.harvesterhci.io/v1beta1/openstacksource.go b/pkg/generated/clientset/versioned/typed/migration.harvesterhci.io/v1beta1/openstacksource.go new file mode 100644 index 0000000..9d3bfc1 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/migration.harvesterhci.io/v1beta1/openstacksource.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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" + + v1beta1 "github.com/harvester/vm-import-controller/pkg/apis/migration.harvesterhci.io/v1beta1" + scheme "github.com/harvester/vm-import-controller/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" + rest "k8s.io/client-go/rest" +) + +// OpenstackSourcesGetter has a method to return a OpenstackSourceInterface. +// A group's client should implement this interface. +type OpenstackSourcesGetter interface { + OpenstackSources(namespace string) OpenstackSourceInterface +} + +// OpenstackSourceInterface has methods to work with OpenstackSource resources. +type OpenstackSourceInterface interface { + Create(ctx context.Context, openstackSource *v1beta1.OpenstackSource, opts v1.CreateOptions) (*v1beta1.OpenstackSource, error) + Update(ctx context.Context, openstackSource *v1beta1.OpenstackSource, opts v1.UpdateOptions) (*v1beta1.OpenstackSource, error) + UpdateStatus(ctx context.Context, openstackSource *v1beta1.OpenstackSource, opts v1.UpdateOptions) (*v1beta1.OpenstackSource, 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.OpenstackSource, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.OpenstackSourceList, 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.OpenstackSource, err error) + OpenstackSourceExpansion +} + +// openstackSources implements OpenstackSourceInterface +type openstackSources struct { + client rest.Interface + ns string +} + +// newOpenstackSources returns a OpenstackSources +func newOpenstackSources(c *MigrationV1beta1Client, namespace string) *openstackSources { + return &openstackSources{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the openstackSource, and returns the corresponding openstackSource object, and an error if there is any. +func (c *openstackSources) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.OpenstackSource, err error) { + result = &v1beta1.OpenstackSource{} + err = c.client.Get(). + Namespace(c.ns). + Resource("openstacksources"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of OpenstackSources that match those selectors. +func (c *openstackSources) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.OpenstackSourceList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.OpenstackSourceList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("openstacksources"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested openstackSources. +func (c *openstackSources) 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("openstacksources"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a openstackSource and creates it. Returns the server's representation of the openstackSource, and an error, if there is any. +func (c *openstackSources) Create(ctx context.Context, openstackSource *v1beta1.OpenstackSource, opts v1.CreateOptions) (result *v1beta1.OpenstackSource, err error) { + result = &v1beta1.OpenstackSource{} + err = c.client.Post(). + Namespace(c.ns). + Resource("openstacksources"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(openstackSource). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a openstackSource and updates it. Returns the server's representation of the openstackSource, and an error, if there is any. +func (c *openstackSources) Update(ctx context.Context, openstackSource *v1beta1.OpenstackSource, opts v1.UpdateOptions) (result *v1beta1.OpenstackSource, err error) { + result = &v1beta1.OpenstackSource{} + err = c.client.Put(). + Namespace(c.ns). + Resource("openstacksources"). + Name(openstackSource.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(openstackSource). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *openstackSources) UpdateStatus(ctx context.Context, openstackSource *v1beta1.OpenstackSource, opts v1.UpdateOptions) (result *v1beta1.OpenstackSource, err error) { + result = &v1beta1.OpenstackSource{} + err = c.client.Put(). + Namespace(c.ns). + Resource("openstacksources"). + Name(openstackSource.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(openstackSource). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the openstackSource and deletes it. Returns an error if one occurs. +func (c *openstackSources) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("openstacksources"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *openstackSources) 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("openstacksources"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched openstackSource. +func (c *openstackSources) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.OpenstackSource, err error) { + result = &v1beta1.OpenstackSource{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("openstacksources"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/generated/clientset/versioned/typed/migration.harvesterhci.io/v1beta1/virtualmachineimport.go b/pkg/generated/clientset/versioned/typed/migration.harvesterhci.io/v1beta1/virtualmachineimport.go new file mode 100644 index 0000000..bcd5853 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/migration.harvesterhci.io/v1beta1/virtualmachineimport.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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" + + v1beta1 "github.com/harvester/vm-import-controller/pkg/apis/migration.harvesterhci.io/v1beta1" + scheme "github.com/harvester/vm-import-controller/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" + rest "k8s.io/client-go/rest" +) + +// VirtualMachineImportsGetter has a method to return a VirtualMachineImportInterface. +// A group's client should implement this interface. +type VirtualMachineImportsGetter interface { + VirtualMachineImports(namespace string) VirtualMachineImportInterface +} + +// VirtualMachineImportInterface has methods to work with VirtualMachineImport resources. +type VirtualMachineImportInterface interface { + Create(ctx context.Context, virtualMachineImport *v1beta1.VirtualMachineImport, opts v1.CreateOptions) (*v1beta1.VirtualMachineImport, error) + Update(ctx context.Context, virtualMachineImport *v1beta1.VirtualMachineImport, opts v1.UpdateOptions) (*v1beta1.VirtualMachineImport, error) + UpdateStatus(ctx context.Context, virtualMachineImport *v1beta1.VirtualMachineImport, opts v1.UpdateOptions) (*v1beta1.VirtualMachineImport, 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.VirtualMachineImport, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.VirtualMachineImportList, 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.VirtualMachineImport, err error) + VirtualMachineImportExpansion +} + +// virtualMachineImports implements VirtualMachineImportInterface +type virtualMachineImports struct { + client rest.Interface + ns string +} + +// newVirtualMachineImports returns a VirtualMachineImports +func newVirtualMachineImports(c *MigrationV1beta1Client, namespace string) *virtualMachineImports { + return &virtualMachineImports{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the virtualMachineImport, and returns the corresponding virtualMachineImport object, and an error if there is any. +func (c *virtualMachineImports) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VirtualMachineImport, err error) { + result = &v1beta1.VirtualMachineImport{} + err = c.client.Get(). + Namespace(c.ns). + Resource("virtualmachineimports"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of VirtualMachineImports that match those selectors. +func (c *virtualMachineImports) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VirtualMachineImportList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.VirtualMachineImportList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("virtualmachineimports"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested virtualMachineImports. +func (c *virtualMachineImports) 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("virtualmachineimports"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a virtualMachineImport and creates it. Returns the server's representation of the virtualMachineImport, and an error, if there is any. +func (c *virtualMachineImports) Create(ctx context.Context, virtualMachineImport *v1beta1.VirtualMachineImport, opts v1.CreateOptions) (result *v1beta1.VirtualMachineImport, err error) { + result = &v1beta1.VirtualMachineImport{} + err = c.client.Post(). + Namespace(c.ns). + Resource("virtualmachineimports"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(virtualMachineImport). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a virtualMachineImport and updates it. Returns the server's representation of the virtualMachineImport, and an error, if there is any. +func (c *virtualMachineImports) Update(ctx context.Context, virtualMachineImport *v1beta1.VirtualMachineImport, opts v1.UpdateOptions) (result *v1beta1.VirtualMachineImport, err error) { + result = &v1beta1.VirtualMachineImport{} + err = c.client.Put(). + Namespace(c.ns). + Resource("virtualmachineimports"). + Name(virtualMachineImport.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(virtualMachineImport). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *virtualMachineImports) UpdateStatus(ctx context.Context, virtualMachineImport *v1beta1.VirtualMachineImport, opts v1.UpdateOptions) (result *v1beta1.VirtualMachineImport, err error) { + result = &v1beta1.VirtualMachineImport{} + err = c.client.Put(). + Namespace(c.ns). + Resource("virtualmachineimports"). + Name(virtualMachineImport.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(virtualMachineImport). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the virtualMachineImport and deletes it. Returns an error if one occurs. +func (c *virtualMachineImports) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("virtualmachineimports"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *virtualMachineImports) 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("virtualmachineimports"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched virtualMachineImport. +func (c *virtualMachineImports) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VirtualMachineImport, err error) { + result = &v1beta1.VirtualMachineImport{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("virtualmachineimports"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/generated/clientset/versioned/typed/migration.harvesterhci.io/v1beta1/vmwaresource.go b/pkg/generated/clientset/versioned/typed/migration.harvesterhci.io/v1beta1/vmwaresource.go new file mode 100644 index 0000000..d7feddc --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/migration.harvesterhci.io/v1beta1/vmwaresource.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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" + + v1beta1 "github.com/harvester/vm-import-controller/pkg/apis/migration.harvesterhci.io/v1beta1" + scheme "github.com/harvester/vm-import-controller/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" + rest "k8s.io/client-go/rest" +) + +// VmwareSourcesGetter has a method to return a VmwareSourceInterface. +// A group's client should implement this interface. +type VmwareSourcesGetter interface { + VmwareSources(namespace string) VmwareSourceInterface +} + +// VmwareSourceInterface has methods to work with VmwareSource resources. +type VmwareSourceInterface interface { + Create(ctx context.Context, vmwareSource *v1beta1.VmwareSource, opts v1.CreateOptions) (*v1beta1.VmwareSource, error) + Update(ctx context.Context, vmwareSource *v1beta1.VmwareSource, opts v1.UpdateOptions) (*v1beta1.VmwareSource, error) + UpdateStatus(ctx context.Context, vmwareSource *v1beta1.VmwareSource, opts v1.UpdateOptions) (*v1beta1.VmwareSource, 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.VmwareSource, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.VmwareSourceList, 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.VmwareSource, err error) + VmwareSourceExpansion +} + +// vmwareSources implements VmwareSourceInterface +type vmwareSources struct { + client rest.Interface + ns string +} + +// newVmwareSources returns a VmwareSources +func newVmwareSources(c *MigrationV1beta1Client, namespace string) *vmwareSources { + return &vmwareSources{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the vmwareSource, and returns the corresponding vmwareSource object, and an error if there is any. +func (c *vmwareSources) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VmwareSource, err error) { + result = &v1beta1.VmwareSource{} + err = c.client.Get(). + Namespace(c.ns). + Resource("vmwaresources"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of VmwareSources that match those selectors. +func (c *vmwareSources) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VmwareSourceList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.VmwareSourceList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("vmwaresources"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested vmwareSources. +func (c *vmwareSources) 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("vmwaresources"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a vmwareSource and creates it. Returns the server's representation of the vmwareSource, and an error, if there is any. +func (c *vmwareSources) Create(ctx context.Context, vmwareSource *v1beta1.VmwareSource, opts v1.CreateOptions) (result *v1beta1.VmwareSource, err error) { + result = &v1beta1.VmwareSource{} + err = c.client.Post(). + Namespace(c.ns). + Resource("vmwaresources"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(vmwareSource). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a vmwareSource and updates it. Returns the server's representation of the vmwareSource, and an error, if there is any. +func (c *vmwareSources) Update(ctx context.Context, vmwareSource *v1beta1.VmwareSource, opts v1.UpdateOptions) (result *v1beta1.VmwareSource, err error) { + result = &v1beta1.VmwareSource{} + err = c.client.Put(). + Namespace(c.ns). + Resource("vmwaresources"). + Name(vmwareSource.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(vmwareSource). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *vmwareSources) UpdateStatus(ctx context.Context, vmwareSource *v1beta1.VmwareSource, opts v1.UpdateOptions) (result *v1beta1.VmwareSource, err error) { + result = &v1beta1.VmwareSource{} + err = c.client.Put(). + Namespace(c.ns). + Resource("vmwaresources"). + Name(vmwareSource.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(vmwareSource). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the vmwareSource and deletes it. Returns an error if one occurs. +func (c *vmwareSources) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("vmwaresources"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *vmwareSources) 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("vmwaresources"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched vmwareSource. +func (c *vmwareSources) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VmwareSource, err error) { + result = &v1beta1.VmwareSource{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("vmwaresources"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/generated/controllers/migration.harvesterhci.io/factory.go b/pkg/generated/controllers/migration.harvesterhci.io/factory.go index 30b13bd..4972264 100644 --- a/pkg/generated/controllers/migration.harvesterhci.io/factory.go +++ b/pkg/generated/controllers/migration.harvesterhci.io/factory.go @@ -1,5 +1,5 @@ /* -Copyright 2022 Rancher Labs, Inc. +Copyright 2023 Rancher Labs, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ limitations under the License. package migration import ( + "github.com/rancher/lasso/pkg/controller" "github.com/rancher/wrangler/pkg/generic" "k8s.io/client-go/rest" ) @@ -65,3 +66,7 @@ func NewFactoryFromConfigWithOptionsOrDie(config *rest.Config, opts *FactoryOpti func (c *Factory) Migration() Interface { return New(c.ControllerFactory()) } + +func (c *Factory) WithAgent(userAgent string) Interface { + return New(controller.NewSharedControllerFactoryWithAgent(userAgent, c.ControllerFactory())) +} diff --git a/pkg/generated/controllers/migration.harvesterhci.io/interface.go b/pkg/generated/controllers/migration.harvesterhci.io/interface.go index 1fac104..3cb87f1 100644 --- a/pkg/generated/controllers/migration.harvesterhci.io/interface.go +++ b/pkg/generated/controllers/migration.harvesterhci.io/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2022 Rancher Labs, Inc. +Copyright 2023 Rancher Labs, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/generated/controllers/migration.harvesterhci.io/v1beta1/interface.go b/pkg/generated/controllers/migration.harvesterhci.io/v1beta1/interface.go index 33cd2eb..6cef481 100644 --- a/pkg/generated/controllers/migration.harvesterhci.io/v1beta1/interface.go +++ b/pkg/generated/controllers/migration.harvesterhci.io/v1beta1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2022 Rancher Labs, Inc. +Copyright 2023 Rancher Labs, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/generated/controllers/migration.harvesterhci.io/v1beta1/openstacksource.go b/pkg/generated/controllers/migration.harvesterhci.io/v1beta1/openstacksource.go index d116f19..56b05f0 100644 --- a/pkg/generated/controllers/migration.harvesterhci.io/v1beta1/openstacksource.go +++ b/pkg/generated/controllers/migration.harvesterhci.io/v1beta1/openstacksource.go @@ -1,5 +1,5 @@ /* -Copyright 2022 Rancher Labs, Inc. +Copyright 2023 Rancher Labs, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/generated/controllers/migration.harvesterhci.io/v1beta1/virtualmachineimport.go b/pkg/generated/controllers/migration.harvesterhci.io/v1beta1/virtualmachineimport.go index 13da2be..839da68 100644 --- a/pkg/generated/controllers/migration.harvesterhci.io/v1beta1/virtualmachineimport.go +++ b/pkg/generated/controllers/migration.harvesterhci.io/v1beta1/virtualmachineimport.go @@ -1,5 +1,5 @@ /* -Copyright 2022 Rancher Labs, Inc. +Copyright 2023 Rancher Labs, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/generated/controllers/migration.harvesterhci.io/v1beta1/vmwaresource.go b/pkg/generated/controllers/migration.harvesterhci.io/v1beta1/vmwaresource.go index 45586a7..d237de4 100644 --- a/pkg/generated/controllers/migration.harvesterhci.io/v1beta1/vmwaresource.go +++ b/pkg/generated/controllers/migration.harvesterhci.io/v1beta1/vmwaresource.go @@ -1,5 +1,5 @@ /* -Copyright 2022 Rancher Labs, Inc. +Copyright 2023 Rancher Labs, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.