From d0999c6835525040193125d314c6b856f6b71a23 Mon Sep 17 00:00:00 2001 From: Ben Oukhanov Date: Sun, 3 Nov 2024 20:14:13 +0200 Subject: [PATCH] feat(CNV-40411): set default instancetype and preference labels During execution of the disk-uploader, it should be able to get the default-instancetype and default-preference labels from the DV or PVC, and set them in the newly created containerDisk metadata afterwards. Signed-off-by: Ben Oukhanov --- cmd/disk-uploader/main.go | 8 +- modules/disk-uploader/pkg/image/image.go | 31 +++- .../disk-uploader/pkg/vmexport/vmexport.go | 31 ++++ .../pkg/vmexport/vmexport_test.go | 91 +++++++++++ .../versioned/fake/clientset_generated.go | 89 +++++++++++ .../clientset/versioned/fake/doc.go | 20 +++ .../clientset/versioned/fake/register.go | 58 +++++++ .../versioned/typed/core/v1beta1/fake/doc.go | 20 +++ .../typed/core/v1beta1/fake/fake_cdi.go | 133 ++++++++++++++++ .../typed/core/v1beta1/fake/fake_cdiconfig.go | 133 ++++++++++++++++ .../core/v1beta1/fake/fake_core_client.go | 76 ++++++++++ .../core/v1beta1/fake/fake_dataimportcron.go | 142 ++++++++++++++++++ .../core/v1beta1/fake/fake_datasource.go | 142 ++++++++++++++++++ .../core/v1beta1/fake/fake_datavolume.go | 142 ++++++++++++++++++ .../core/v1beta1/fake/fake_objecttransfer.go | 133 ++++++++++++++++ .../core/v1beta1/fake/fake_storageprofile.go | 133 ++++++++++++++++ .../v1beta1/fake/fake_volumeclonesource.go | 130 ++++++++++++++++ .../v1beta1/fake/fake_volumeimportsource.go | 142 ++++++++++++++++++ .../v1beta1/fake/fake_volumeuploadsource.go | 142 ++++++++++++++++++ .../typed/upload/v1beta1/fake/doc.go | 20 +++ .../upload/v1beta1/fake/fake_upload_client.go | 40 +++++ .../v1beta1/fake/fake_uploadtokenrequest.go | 142 ++++++++++++++++++ vendor/modules.txt | 3 + 23 files changed, 1999 insertions(+), 2 deletions(-) create mode 100644 vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/fake/clientset_generated.go create mode 100644 vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/fake/doc.go create mode 100644 vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/fake/register.go create mode 100644 vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/core/v1beta1/fake/doc.go create mode 100644 vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/core/v1beta1/fake/fake_cdi.go create mode 100644 vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/core/v1beta1/fake/fake_cdiconfig.go create mode 100644 vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/core/v1beta1/fake/fake_core_client.go create mode 100644 vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/core/v1beta1/fake/fake_dataimportcron.go create mode 100644 vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/core/v1beta1/fake/fake_datasource.go create mode 100644 vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/core/v1beta1/fake/fake_datavolume.go create mode 100644 vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/core/v1beta1/fake/fake_objecttransfer.go create mode 100644 vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/core/v1beta1/fake/fake_storageprofile.go create mode 100644 vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/core/v1beta1/fake/fake_volumeclonesource.go create mode 100644 vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/core/v1beta1/fake/fake_volumeimportsource.go create mode 100644 vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/core/v1beta1/fake/fake_volumeuploadsource.go create mode 100644 vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/upload/v1beta1/fake/doc.go create mode 100644 vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/upload/v1beta1/fake/fake_upload_client.go create mode 100644 vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/upload/v1beta1/fake/fake_uploadtokenrequest.go diff --git a/cmd/disk-uploader/main.go b/cmd/disk-uploader/main.go index e549c3358..20bb984bc 100644 --- a/cmd/disk-uploader/main.go +++ b/cmd/disk-uploader/main.go @@ -89,7 +89,13 @@ func run(opts parse.CLIOptions, k8sClient kubernetes.Interface, virtClient kubec log.Logger().Info("Building a new container image...") - containerImage, err := image.Build(diskPath) + labels, err := vmexport.GetLabelsFromExportSource(virtClient, kind, namespace, name, volumeName) + if err != nil { + return err + } + + config := image.DefaultConfig(labels) + containerImage, err := image.Build(diskPath, config) if err != nil { return err } diff --git a/modules/disk-uploader/pkg/image/image.go b/modules/disk-uploader/pkg/image/image.go index a83ff7734..7291c089d 100644 --- a/modules/disk-uploader/pkg/image/image.go +++ b/modules/disk-uploader/pkg/image/image.go @@ -2,6 +2,7 @@ package image import ( "context" + "fmt" "log" "os" "time" @@ -16,7 +17,24 @@ import ( tar "kubevirt.io/containerdisks/pkg/build" ) -func Build(diskPath string) (v1.Image, error) { +var labelEnvPairs = map[string]string{ + "instancetype.kubevirt.io/default-instancetype": "INSTANCETYPE_KUBEVIRT_IO_DEFAULT_INSTANCETYPE", + "instancetype.kubevirt.io/default-instancetype-kind": "INSTANCETYPE_KUBEVIRT_IO_DEFAULT_INSTANCETYPE_KIND", + "instancetype.kubevirt.io/default-preference": "INSTANCETYPE_KUBEVIRT_IO_DEFAULT_PREFERENCE", + "instancetype.kubevirt.io/default-preference-kind": "INSTANCETYPE_KUBEVIRT_IO_DEFAULT_PREFERENCE_KIND", +} + +func DefaultConfig(labels map[string]string) v1.Config { + var env []string + for label, envVar := range labelEnvPairs { + if value, exists := labels[label]; exists { + env = append(env, fmt.Sprintf("%s=%s", envVar, value)) + } + } + return v1.Config{Env: env} +} + +func Build(diskPath string, config v1.Config) (v1.Image, error) { layer, err := tarball.LayerFromOpener(tar.StreamLayerOpener(diskPath)) if err != nil { log.Fatalf("Error creating layer from file: %v", err) @@ -28,6 +46,17 @@ func Build(diskPath string) (v1.Image, error) { log.Fatalf("Error appending layer: %v", err) return nil, err } + + configFile, err := image.ConfigFile() + if err != nil { + return nil, fmt.Errorf("error getting the image config file: %v", err) + } + configFile.Config = config + + image, err = mutate.ConfigFile(image, configFile) + if err != nil { + return nil, fmt.Errorf("error setting the image config file: %v", err) + } return image, nil } diff --git a/modules/disk-uploader/pkg/vmexport/vmexport.go b/modules/disk-uploader/pkg/vmexport/vmexport.go index 346a3206d..616c03120 100644 --- a/modules/disk-uploader/pkg/vmexport/vmexport.go +++ b/modules/disk-uploader/pkg/vmexport/vmexport.go @@ -8,6 +8,7 @@ import ( "github.com/kubevirt/kubevirt-tekton-tasks/modules/shared/pkg/ownerreference" corev1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/wait" @@ -90,6 +91,36 @@ func GetRawDiskUrlFromVolumes(client kubecli.KubevirtClient, namespace, name, vo return "", fmt.Errorf("volume %s is not found in VirtualMachineExport internal volumes", volumeName) } +func GetLabelsFromExportSource(virtClient kubecli.KubevirtClient, exportSourceKind, exportSourceNamespace, exportSourceName, volumeName string) (map[string]string, error) { + switch exportSourceKind { + case "VirtualMachine", "VirtualMachineSnapshot": + return getLabelsFromVirtualMachineOrSnapshot(virtClient, exportSourceNamespace, volumeName) + case "PersistentVolumeClaim": + return getLabelsFromPVC(virtClient, exportSourceNamespace, exportSourceName) + default: + return nil, fmt.Errorf("unsupported source kind: %s", exportSourceKind) + } +} + +func getLabelsFromVirtualMachineOrSnapshot(virtClient kubecli.KubevirtClient, namespace, volumeName string) (map[string]string, error) { + dv, err := virtClient.CdiClient().CdiV1beta1().DataVolumes(namespace).Get(context.Background(), volumeName, metav1.GetOptions{}) + if err == nil { + return dv.GetLabels(), nil + } + if !errors.IsNotFound(err) { + return nil, err + } + return getLabelsFromPVC(virtClient, namespace, volumeName) +} + +func getLabelsFromPVC(virtClient kubecli.KubevirtClient, namespace, name string) (map[string]string, error) { + pvc, err := virtClient.CoreV1().PersistentVolumeClaims(namespace).Get(context.Background(), name, metav1.GetOptions{}) + if err != nil { + return nil, err + } + return pvc.GetLabels(), nil +} + func getExportSource(exportSourceKind, exportSourceName string) (corev1.TypedLocalObjectReference, error) { switch exportSourceKind { case sourceVM: diff --git a/modules/disk-uploader/pkg/vmexport/vmexport_test.go b/modules/disk-uploader/pkg/vmexport/vmexport_test.go index bc9b2ea60..d51c8a441 100644 --- a/modules/disk-uploader/pkg/vmexport/vmexport_test.go +++ b/modules/disk-uploader/pkg/vmexport/vmexport_test.go @@ -15,8 +15,10 @@ import ( fakek8sclient "k8s.io/client-go/kubernetes/fake" v1beta1 "kubevirt.io/api/export/v1beta1" + fakecdiclient "kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/fake" kubevirtfake "kubevirt.io/client-go/generated/kubevirt/clientset/versioned/fake" "kubevirt.io/client-go/kubecli" + cdiv1beta1 "kubevirt.io/containerized-data-importer-api/pkg/apis/core/v1beta1" "github.com/kubevirt/kubevirt-tekton-tasks/modules/disk-uploader/pkg/vmexport" ) @@ -29,6 +31,7 @@ var _ = Describe("VMExport", func() { var ( kubeClient *fakek8sclient.Clientset + cdiClient *fakecdiclient.Clientset vmExportClient *kubevirtfake.Clientset virtClient kubecli.KubevirtClient ) @@ -37,11 +40,13 @@ var _ = Describe("VMExport", func() { ctrl := gomock.NewController(GinkgoT()) kubeClient = fakek8sclient.NewSimpleClientset() vmExportClient = kubevirtfake.NewSimpleClientset() + cdiClient = fakecdiclient.NewSimpleClientset() kubecli.GetKubevirtClientFromClientConfig = kubecli.GetMockKubevirtClientFromClientConfig kubecli.MockKubevirtClientInstance = kubecli.NewMockKubevirtClient(ctrl) kubecli.MockKubevirtClientInstance.EXPECT().CoreV1().Return(kubeClient.CoreV1()).AnyTimes() kubecli.MockKubevirtClientInstance.EXPECT().VirtualMachineExport(namespace).Return(vmExportClient.ExportV1beta1().VirtualMachineExports(namespace)).AnyTimes() + kubecli.MockKubevirtClientInstance.EXPECT().CdiClient().Return(cdiClient).AnyTimes() virtClient, _ = kubecli.GetKubevirtClientFromClientConfig(nil) @@ -186,4 +191,90 @@ var _ = Describe("VMExport", func() { Expect(err).To(MatchError("no links found in VirtualMachineExport status")) }) }) + + Describe("GetLabelsFromExportSource", func() { + var ( + defaultInstanceType = "instancetype.kubevirt.io/default-instancetype" + defaultPreference = "instancetype.kubevirt.io/default-preference" + ) + + DescribeTable("should return labels from datavolume", func(resourceType string) { + _, err := virtClient.CdiClient().CdiV1beta1().DataVolumes(namespace).Create(context.Background(), &cdiv1beta1.DataVolume{ + ObjectMeta: metav1.ObjectMeta{ + Name: "example-volume", + Namespace: namespace, + Labels: map[string]string{ + defaultInstanceType: "cx1.2xlarge", + defaultPreference: "fedora", + }, + }, + }, metav1.CreateOptions{}) + Expect(err).NotTo(HaveOccurred()) + + labels, err := vmexport.GetLabelsFromExportSource(virtClient, resourceType, namespace, name, "example-volume") + Expect(err).NotTo(HaveOccurred()) + Expect(labels).To(HaveKeyWithValue(defaultInstanceType, "cx1.2xlarge")) + Expect(labels).To(HaveKeyWithValue(defaultPreference, "fedora")) + }, + Entry("for VirtualMachine", "VirtualMachine"), + Entry("for VirtualMachineSnapshot", "VirtualMachineSnapshot"), + ) + + DescribeTable("should return labels from pvc if there is no datavolume", func(resourceType string) { + _, err := kubeClient.CoreV1().PersistentVolumeClaims(namespace).Create(context.Background(), &corev1.PersistentVolumeClaim{ + ObjectMeta: metav1.ObjectMeta{ + Name: "example-pvc", + Namespace: namespace, + Labels: map[string]string{ + defaultInstanceType: "cx1.2xlarge", + defaultPreference: "fedora", + }, + }, + }, metav1.CreateOptions{}) + Expect(err).NotTo(HaveOccurred()) + + labels, err := vmexport.GetLabelsFromExportSource(virtClient, resourceType, namespace, name, "example-pvc") + Expect(err).NotTo(HaveOccurred()) + Expect(labels).To(HaveKeyWithValue(defaultInstanceType, "cx1.2xlarge")) + Expect(labels).To(HaveKeyWithValue(defaultPreference, "fedora")) + }, + Entry("for VirtualMachine", "VirtualMachine"), + Entry("for VirtualMachineSnapshot", "VirtualMachineSnapshot"), + ) + + It("should return labels directly from pvc", func() { + _, err := kubeClient.CoreV1().PersistentVolumeClaims(namespace).Create(context.Background(), &corev1.PersistentVolumeClaim{ + ObjectMeta: metav1.ObjectMeta{ + Name: "example-pvc", + Namespace: namespace, + Labels: map[string]string{ + defaultInstanceType: "cx1.2xlarge", + defaultPreference: "fedora", + }, + }, + }, metav1.CreateOptions{}) + Expect(err).NotTo(HaveOccurred()) + + labels, err := vmexport.GetLabelsFromExportSource(virtClient, "PersistentVolumeClaim", namespace, "example-pvc", "") + Expect(err).NotTo(HaveOccurred()) + Expect(labels).To(HaveKeyWithValue(defaultInstanceType, "cx1.2xlarge")) + Expect(labels).To(HaveKeyWithValue(defaultPreference, "fedora")) + }) + + It("should return unsupported source kind error", func() { + labels, err := vmexport.GetLabelsFromExportSource(virtClient, "VirtualMachineInstance", namespace, name, "disk-volume-1") + Expect(err).To(MatchError("unsupported source kind: VirtualMachineInstance")) + Expect(labels).To(BeNil()) + }) + + DescribeTable("should return an error when DV or PVC is not found", func(exportSourceKind string, volumeName string) { + labels, err := vmexport.GetLabelsFromExportSource(virtClient, exportSourceKind, namespace, name, volumeName) + Expect(err).To(MatchError(errors.IsNotFound, "errors.IsNotFound")) + Expect(labels).To(BeNil()) + }, + Entry("for VirtualMachine with missing DV and PVC", "VirtualMachine", "example-volume"), + Entry("for VirtualMachineSnapshot with missing DV and PVC", "VirtualMachineSnapshot", "example-volume"), + Entry("for PersistentVolumeClaim with missing PVC", "PersistentVolumeClaim", ""), + ) + }) }) diff --git a/vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/fake/clientset_generated.go b/vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/fake/clientset_generated.go new file mode 100644 index 000000000..e90f36277 --- /dev/null +++ b/vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/fake/clientset_generated.go @@ -0,0 +1,89 @@ +/* +Copyright The KubeVirt Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/discovery" + fakediscovery "k8s.io/client-go/discovery/fake" + "k8s.io/client-go/testing" + clientset "kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned" + cdiv1beta1 "kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/core/v1beta1" + fakecdiv1beta1 "kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/core/v1beta1/fake" + uploadv1beta1 "kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/upload/v1beta1" + fakeuploadv1beta1 "kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/upload/v1beta1/fake" +) + +// NewSimpleClientset returns a clientset that will respond with the provided objects. +// It's backed by a very simple object tracker that processes creates, updates and deletions as-is, +// without applying any validations and/or defaults. It shouldn't be considered a replacement +// for a real clientset and is mostly useful in simple unit tests. +func NewSimpleClientset(objects ...runtime.Object) *Clientset { + o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) + for _, obj := range objects { + if err := o.Add(obj); err != nil { + panic(err) + } + } + + cs := &Clientset{tracker: o} + cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} + cs.AddReactor("*", "*", testing.ObjectReaction(o)) + cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { + gvr := action.GetResource() + ns := action.GetNamespace() + watch, err := o.Watch(gvr, ns) + if err != nil { + return false, nil, err + } + return true, watch, nil + }) + + return cs +} + +// Clientset implements clientset.Interface. Meant to be embedded into a +// struct to get a default implementation. This makes faking out just the method +// you want to test easier. +type Clientset struct { + testing.Fake + discovery *fakediscovery.FakeDiscovery + tracker testing.ObjectTracker +} + +func (c *Clientset) Discovery() discovery.DiscoveryInterface { + return c.discovery +} + +func (c *Clientset) Tracker() testing.ObjectTracker { + return c.tracker +} + +var _ clientset.Interface = &Clientset{} + +// CdiV1beta1 retrieves the CdiV1beta1Client +func (c *Clientset) CdiV1beta1() cdiv1beta1.CdiV1beta1Interface { + return &fakecdiv1beta1.FakeCdiV1beta1{Fake: &c.Fake} +} + +// UploadV1beta1 retrieves the UploadV1beta1Client +func (c *Clientset) UploadV1beta1() uploadv1beta1.UploadV1beta1Interface { + return &fakeuploadv1beta1.FakeUploadV1beta1{Fake: &c.Fake} +} diff --git a/vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/fake/doc.go b/vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/fake/doc.go new file mode 100644 index 000000000..1d08de669 --- /dev/null +++ b/vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The KubeVirt Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated fake clientset. +package fake diff --git a/vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/fake/register.go b/vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/fake/register.go new file mode 100644 index 000000000..6e9b857fa --- /dev/null +++ b/vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/fake/register.go @@ -0,0 +1,58 @@ +/* +Copyright The KubeVirt Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + serializer "k8s.io/apimachinery/pkg/runtime/serializer" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" + cdiv1beta1 "kubevirt.io/containerized-data-importer-api/pkg/apis/core/v1beta1" + uploadv1beta1 "kubevirt.io/containerized-data-importer-api/pkg/apis/upload/v1beta1" +) + +var scheme = runtime.NewScheme() +var codecs = serializer.NewCodecFactory(scheme) + +var localSchemeBuilder = runtime.SchemeBuilder{ + cdiv1beta1.AddToScheme, + uploadv1beta1.AddToScheme, +} + +// AddToScheme adds all types of this clientset into the given scheme. This allows composition +// of clientsets, like in: +// +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) +// +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// +// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types +// correctly. +var AddToScheme = localSchemeBuilder.AddToScheme + +func init() { + v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) + utilruntime.Must(AddToScheme(scheme)) +} diff --git a/vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/core/v1beta1/fake/doc.go b/vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/core/v1beta1/fake/doc.go new file mode 100644 index 000000000..0ab586ad6 --- /dev/null +++ b/vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/core/v1beta1/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The KubeVirt Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/core/v1beta1/fake/fake_cdi.go b/vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/core/v1beta1/fake/fake_cdi.go new file mode 100644 index 000000000..387195cba --- /dev/null +++ b/vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/core/v1beta1/fake/fake_cdi.go @@ -0,0 +1,133 @@ +/* +Copyright The KubeVirt Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + v1beta1 "kubevirt.io/containerized-data-importer-api/pkg/apis/core/v1beta1" +) + +// FakeCDIs implements CDIInterface +type FakeCDIs struct { + Fake *FakeCdiV1beta1 +} + +var cdisResource = schema.GroupVersionResource{Group: "cdi.kubevirt.io", Version: "v1beta1", Resource: "cdis"} + +var cdisKind = schema.GroupVersionKind{Group: "cdi.kubevirt.io", Version: "v1beta1", Kind: "CDI"} + +// Get takes name of the cDI, and returns the corresponding cDI object, and an error if there is any. +func (c *FakeCDIs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.CDI, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(cdisResource, name), &v1beta1.CDI{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.CDI), err +} + +// List takes label and field selectors, and returns the list of CDIs that match those selectors. +func (c *FakeCDIs) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CDIList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(cdisResource, cdisKind, opts), &v1beta1.CDIList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.CDIList{ListMeta: obj.(*v1beta1.CDIList).ListMeta} + for _, item := range obj.(*v1beta1.CDIList).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 cDIs. +func (c *FakeCDIs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(cdisResource, opts)) +} + +// Create takes the representation of a cDI and creates it. Returns the server's representation of the cDI, and an error, if there is any. +func (c *FakeCDIs) Create(ctx context.Context, cDI *v1beta1.CDI, opts v1.CreateOptions) (result *v1beta1.CDI, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(cdisResource, cDI), &v1beta1.CDI{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.CDI), err +} + +// Update takes the representation of a cDI and updates it. Returns the server's representation of the cDI, and an error, if there is any. +func (c *FakeCDIs) Update(ctx context.Context, cDI *v1beta1.CDI, opts v1.UpdateOptions) (result *v1beta1.CDI, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(cdisResource, cDI), &v1beta1.CDI{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.CDI), 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 *FakeCDIs) UpdateStatus(ctx context.Context, cDI *v1beta1.CDI, opts v1.UpdateOptions) (*v1beta1.CDI, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(cdisResource, "status", cDI), &v1beta1.CDI{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.CDI), err +} + +// Delete takes name of the cDI and deletes it. Returns an error if one occurs. +func (c *FakeCDIs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(cdisResource, name), &v1beta1.CDI{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeCDIs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(cdisResource, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.CDIList{}) + return err +} + +// Patch applies the patch and returns the patched cDI. +func (c *FakeCDIs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CDI, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(cdisResource, name, pt, data, subresources...), &v1beta1.CDI{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.CDI), err +} diff --git a/vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/core/v1beta1/fake/fake_cdiconfig.go b/vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/core/v1beta1/fake/fake_cdiconfig.go new file mode 100644 index 000000000..7934ea8c8 --- /dev/null +++ b/vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/core/v1beta1/fake/fake_cdiconfig.go @@ -0,0 +1,133 @@ +/* +Copyright The KubeVirt Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + v1beta1 "kubevirt.io/containerized-data-importer-api/pkg/apis/core/v1beta1" +) + +// FakeCDIConfigs implements CDIConfigInterface +type FakeCDIConfigs struct { + Fake *FakeCdiV1beta1 +} + +var cdiconfigsResource = schema.GroupVersionResource{Group: "cdi.kubevirt.io", Version: "v1beta1", Resource: "cdiconfigs"} + +var cdiconfigsKind = schema.GroupVersionKind{Group: "cdi.kubevirt.io", Version: "v1beta1", Kind: "CDIConfig"} + +// Get takes name of the cDIConfig, and returns the corresponding cDIConfig object, and an error if there is any. +func (c *FakeCDIConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.CDIConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(cdiconfigsResource, name), &v1beta1.CDIConfig{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.CDIConfig), err +} + +// List takes label and field selectors, and returns the list of CDIConfigs that match those selectors. +func (c *FakeCDIConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CDIConfigList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(cdiconfigsResource, cdiconfigsKind, opts), &v1beta1.CDIConfigList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.CDIConfigList{ListMeta: obj.(*v1beta1.CDIConfigList).ListMeta} + for _, item := range obj.(*v1beta1.CDIConfigList).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 cDIConfigs. +func (c *FakeCDIConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(cdiconfigsResource, opts)) +} + +// Create takes the representation of a cDIConfig and creates it. Returns the server's representation of the cDIConfig, and an error, if there is any. +func (c *FakeCDIConfigs) Create(ctx context.Context, cDIConfig *v1beta1.CDIConfig, opts v1.CreateOptions) (result *v1beta1.CDIConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(cdiconfigsResource, cDIConfig), &v1beta1.CDIConfig{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.CDIConfig), err +} + +// Update takes the representation of a cDIConfig and updates it. Returns the server's representation of the cDIConfig, and an error, if there is any. +func (c *FakeCDIConfigs) Update(ctx context.Context, cDIConfig *v1beta1.CDIConfig, opts v1.UpdateOptions) (result *v1beta1.CDIConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(cdiconfigsResource, cDIConfig), &v1beta1.CDIConfig{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.CDIConfig), 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 *FakeCDIConfigs) UpdateStatus(ctx context.Context, cDIConfig *v1beta1.CDIConfig, opts v1.UpdateOptions) (*v1beta1.CDIConfig, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(cdiconfigsResource, "status", cDIConfig), &v1beta1.CDIConfig{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.CDIConfig), err +} + +// Delete takes name of the cDIConfig and deletes it. Returns an error if one occurs. +func (c *FakeCDIConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(cdiconfigsResource, name), &v1beta1.CDIConfig{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeCDIConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(cdiconfigsResource, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.CDIConfigList{}) + return err +} + +// Patch applies the patch and returns the patched cDIConfig. +func (c *FakeCDIConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CDIConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(cdiconfigsResource, name, pt, data, subresources...), &v1beta1.CDIConfig{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.CDIConfig), err +} diff --git a/vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/core/v1beta1/fake/fake_core_client.go b/vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/core/v1beta1/fake/fake_core_client.go new file mode 100644 index 000000000..8af9a4d20 --- /dev/null +++ b/vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/core/v1beta1/fake/fake_core_client.go @@ -0,0 +1,76 @@ +/* +Copyright The KubeVirt Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" + v1beta1 "kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/core/v1beta1" +) + +type FakeCdiV1beta1 struct { + *testing.Fake +} + +func (c *FakeCdiV1beta1) CDIs() v1beta1.CDIInterface { + return &FakeCDIs{c} +} + +func (c *FakeCdiV1beta1) CDIConfigs() v1beta1.CDIConfigInterface { + return &FakeCDIConfigs{c} +} + +func (c *FakeCdiV1beta1) DataImportCrons(namespace string) v1beta1.DataImportCronInterface { + return &FakeDataImportCrons{c, namespace} +} + +func (c *FakeCdiV1beta1) DataSources(namespace string) v1beta1.DataSourceInterface { + return &FakeDataSources{c, namespace} +} + +func (c *FakeCdiV1beta1) DataVolumes(namespace string) v1beta1.DataVolumeInterface { + return &FakeDataVolumes{c, namespace} +} + +func (c *FakeCdiV1beta1) ObjectTransfers() v1beta1.ObjectTransferInterface { + return &FakeObjectTransfers{c} +} + +func (c *FakeCdiV1beta1) StorageProfiles() v1beta1.StorageProfileInterface { + return &FakeStorageProfiles{c} +} + +func (c *FakeCdiV1beta1) VolumeCloneSources(namespace string) v1beta1.VolumeCloneSourceInterface { + return &FakeVolumeCloneSources{c, namespace} +} + +func (c *FakeCdiV1beta1) VolumeImportSources(namespace string) v1beta1.VolumeImportSourceInterface { + return &FakeVolumeImportSources{c, namespace} +} + +func (c *FakeCdiV1beta1) VolumeUploadSources(namespace string) v1beta1.VolumeUploadSourceInterface { + return &FakeVolumeUploadSources{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeCdiV1beta1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/core/v1beta1/fake/fake_dataimportcron.go b/vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/core/v1beta1/fake/fake_dataimportcron.go new file mode 100644 index 000000000..024d76144 --- /dev/null +++ b/vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/core/v1beta1/fake/fake_dataimportcron.go @@ -0,0 +1,142 @@ +/* +Copyright The KubeVirt Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + v1beta1 "kubevirt.io/containerized-data-importer-api/pkg/apis/core/v1beta1" +) + +// FakeDataImportCrons implements DataImportCronInterface +type FakeDataImportCrons struct { + Fake *FakeCdiV1beta1 + ns string +} + +var dataimportcronsResource = schema.GroupVersionResource{Group: "cdi.kubevirt.io", Version: "v1beta1", Resource: "dataimportcrons"} + +var dataimportcronsKind = schema.GroupVersionKind{Group: "cdi.kubevirt.io", Version: "v1beta1", Kind: "DataImportCron"} + +// Get takes name of the dataImportCron, and returns the corresponding dataImportCron object, and an error if there is any. +func (c *FakeDataImportCrons) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.DataImportCron, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(dataimportcronsResource, c.ns, name), &v1beta1.DataImportCron{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.DataImportCron), err +} + +// List takes label and field selectors, and returns the list of DataImportCrons that match those selectors. +func (c *FakeDataImportCrons) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.DataImportCronList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(dataimportcronsResource, dataimportcronsKind, c.ns, opts), &v1beta1.DataImportCronList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.DataImportCronList{ListMeta: obj.(*v1beta1.DataImportCronList).ListMeta} + for _, item := range obj.(*v1beta1.DataImportCronList).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 dataImportCrons. +func (c *FakeDataImportCrons) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(dataimportcronsResource, c.ns, opts)) + +} + +// Create takes the representation of a dataImportCron and creates it. Returns the server's representation of the dataImportCron, and an error, if there is any. +func (c *FakeDataImportCrons) Create(ctx context.Context, dataImportCron *v1beta1.DataImportCron, opts v1.CreateOptions) (result *v1beta1.DataImportCron, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(dataimportcronsResource, c.ns, dataImportCron), &v1beta1.DataImportCron{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.DataImportCron), err +} + +// Update takes the representation of a dataImportCron and updates it. Returns the server's representation of the dataImportCron, and an error, if there is any. +func (c *FakeDataImportCrons) Update(ctx context.Context, dataImportCron *v1beta1.DataImportCron, opts v1.UpdateOptions) (result *v1beta1.DataImportCron, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(dataimportcronsResource, c.ns, dataImportCron), &v1beta1.DataImportCron{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.DataImportCron), 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 *FakeDataImportCrons) UpdateStatus(ctx context.Context, dataImportCron *v1beta1.DataImportCron, opts v1.UpdateOptions) (*v1beta1.DataImportCron, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(dataimportcronsResource, "status", c.ns, dataImportCron), &v1beta1.DataImportCron{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.DataImportCron), err +} + +// Delete takes name of the dataImportCron and deletes it. Returns an error if one occurs. +func (c *FakeDataImportCrons) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(dataimportcronsResource, c.ns, name), &v1beta1.DataImportCron{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeDataImportCrons) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(dataimportcronsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.DataImportCronList{}) + return err +} + +// Patch applies the patch and returns the patched dataImportCron. +func (c *FakeDataImportCrons) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.DataImportCron, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(dataimportcronsResource, c.ns, name, pt, data, subresources...), &v1beta1.DataImportCron{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.DataImportCron), err +} diff --git a/vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/core/v1beta1/fake/fake_datasource.go b/vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/core/v1beta1/fake/fake_datasource.go new file mode 100644 index 000000000..77a2bcbcd --- /dev/null +++ b/vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/core/v1beta1/fake/fake_datasource.go @@ -0,0 +1,142 @@ +/* +Copyright The KubeVirt Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + v1beta1 "kubevirt.io/containerized-data-importer-api/pkg/apis/core/v1beta1" +) + +// FakeDataSources implements DataSourceInterface +type FakeDataSources struct { + Fake *FakeCdiV1beta1 + ns string +} + +var datasourcesResource = schema.GroupVersionResource{Group: "cdi.kubevirt.io", Version: "v1beta1", Resource: "datasources"} + +var datasourcesKind = schema.GroupVersionKind{Group: "cdi.kubevirt.io", Version: "v1beta1", Kind: "DataSource"} + +// Get takes name of the dataSource, and returns the corresponding dataSource object, and an error if there is any. +func (c *FakeDataSources) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.DataSource, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(datasourcesResource, c.ns, name), &v1beta1.DataSource{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.DataSource), err +} + +// List takes label and field selectors, and returns the list of DataSources that match those selectors. +func (c *FakeDataSources) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.DataSourceList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(datasourcesResource, datasourcesKind, c.ns, opts), &v1beta1.DataSourceList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.DataSourceList{ListMeta: obj.(*v1beta1.DataSourceList).ListMeta} + for _, item := range obj.(*v1beta1.DataSourceList).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 dataSources. +func (c *FakeDataSources) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(datasourcesResource, c.ns, opts)) + +} + +// Create takes the representation of a dataSource and creates it. Returns the server's representation of the dataSource, and an error, if there is any. +func (c *FakeDataSources) Create(ctx context.Context, dataSource *v1beta1.DataSource, opts v1.CreateOptions) (result *v1beta1.DataSource, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(datasourcesResource, c.ns, dataSource), &v1beta1.DataSource{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.DataSource), err +} + +// Update takes the representation of a dataSource and updates it. Returns the server's representation of the dataSource, and an error, if there is any. +func (c *FakeDataSources) Update(ctx context.Context, dataSource *v1beta1.DataSource, opts v1.UpdateOptions) (result *v1beta1.DataSource, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(datasourcesResource, c.ns, dataSource), &v1beta1.DataSource{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.DataSource), 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 *FakeDataSources) UpdateStatus(ctx context.Context, dataSource *v1beta1.DataSource, opts v1.UpdateOptions) (*v1beta1.DataSource, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(datasourcesResource, "status", c.ns, dataSource), &v1beta1.DataSource{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.DataSource), err +} + +// Delete takes name of the dataSource and deletes it. Returns an error if one occurs. +func (c *FakeDataSources) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(datasourcesResource, c.ns, name), &v1beta1.DataSource{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeDataSources) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(datasourcesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.DataSourceList{}) + return err +} + +// Patch applies the patch and returns the patched dataSource. +func (c *FakeDataSources) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.DataSource, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(datasourcesResource, c.ns, name, pt, data, subresources...), &v1beta1.DataSource{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.DataSource), err +} diff --git a/vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/core/v1beta1/fake/fake_datavolume.go b/vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/core/v1beta1/fake/fake_datavolume.go new file mode 100644 index 000000000..9a2ccd507 --- /dev/null +++ b/vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/core/v1beta1/fake/fake_datavolume.go @@ -0,0 +1,142 @@ +/* +Copyright The KubeVirt Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + v1beta1 "kubevirt.io/containerized-data-importer-api/pkg/apis/core/v1beta1" +) + +// FakeDataVolumes implements DataVolumeInterface +type FakeDataVolumes struct { + Fake *FakeCdiV1beta1 + ns string +} + +var datavolumesResource = schema.GroupVersionResource{Group: "cdi.kubevirt.io", Version: "v1beta1", Resource: "datavolumes"} + +var datavolumesKind = schema.GroupVersionKind{Group: "cdi.kubevirt.io", Version: "v1beta1", Kind: "DataVolume"} + +// Get takes name of the dataVolume, and returns the corresponding dataVolume object, and an error if there is any. +func (c *FakeDataVolumes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.DataVolume, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(datavolumesResource, c.ns, name), &v1beta1.DataVolume{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.DataVolume), err +} + +// List takes label and field selectors, and returns the list of DataVolumes that match those selectors. +func (c *FakeDataVolumes) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.DataVolumeList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(datavolumesResource, datavolumesKind, c.ns, opts), &v1beta1.DataVolumeList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.DataVolumeList{ListMeta: obj.(*v1beta1.DataVolumeList).ListMeta} + for _, item := range obj.(*v1beta1.DataVolumeList).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 dataVolumes. +func (c *FakeDataVolumes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(datavolumesResource, c.ns, opts)) + +} + +// Create takes the representation of a dataVolume and creates it. Returns the server's representation of the dataVolume, and an error, if there is any. +func (c *FakeDataVolumes) Create(ctx context.Context, dataVolume *v1beta1.DataVolume, opts v1.CreateOptions) (result *v1beta1.DataVolume, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(datavolumesResource, c.ns, dataVolume), &v1beta1.DataVolume{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.DataVolume), err +} + +// Update takes the representation of a dataVolume and updates it. Returns the server's representation of the dataVolume, and an error, if there is any. +func (c *FakeDataVolumes) Update(ctx context.Context, dataVolume *v1beta1.DataVolume, opts v1.UpdateOptions) (result *v1beta1.DataVolume, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(datavolumesResource, c.ns, dataVolume), &v1beta1.DataVolume{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.DataVolume), 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 *FakeDataVolumes) UpdateStatus(ctx context.Context, dataVolume *v1beta1.DataVolume, opts v1.UpdateOptions) (*v1beta1.DataVolume, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(datavolumesResource, "status", c.ns, dataVolume), &v1beta1.DataVolume{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.DataVolume), err +} + +// Delete takes name of the dataVolume and deletes it. Returns an error if one occurs. +func (c *FakeDataVolumes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(datavolumesResource, c.ns, name), &v1beta1.DataVolume{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeDataVolumes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(datavolumesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.DataVolumeList{}) + return err +} + +// Patch applies the patch and returns the patched dataVolume. +func (c *FakeDataVolumes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.DataVolume, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(datavolumesResource, c.ns, name, pt, data, subresources...), &v1beta1.DataVolume{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.DataVolume), err +} diff --git a/vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/core/v1beta1/fake/fake_objecttransfer.go b/vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/core/v1beta1/fake/fake_objecttransfer.go new file mode 100644 index 000000000..5be035169 --- /dev/null +++ b/vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/core/v1beta1/fake/fake_objecttransfer.go @@ -0,0 +1,133 @@ +/* +Copyright The KubeVirt Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + v1beta1 "kubevirt.io/containerized-data-importer-api/pkg/apis/core/v1beta1" +) + +// FakeObjectTransfers implements ObjectTransferInterface +type FakeObjectTransfers struct { + Fake *FakeCdiV1beta1 +} + +var objecttransfersResource = schema.GroupVersionResource{Group: "cdi.kubevirt.io", Version: "v1beta1", Resource: "objecttransfers"} + +var objecttransfersKind = schema.GroupVersionKind{Group: "cdi.kubevirt.io", Version: "v1beta1", Kind: "ObjectTransfer"} + +// Get takes name of the objectTransfer, and returns the corresponding objectTransfer object, and an error if there is any. +func (c *FakeObjectTransfers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ObjectTransfer, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(objecttransfersResource, name), &v1beta1.ObjectTransfer{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.ObjectTransfer), err +} + +// List takes label and field selectors, and returns the list of ObjectTransfers that match those selectors. +func (c *FakeObjectTransfers) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ObjectTransferList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(objecttransfersResource, objecttransfersKind, opts), &v1beta1.ObjectTransferList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.ObjectTransferList{ListMeta: obj.(*v1beta1.ObjectTransferList).ListMeta} + for _, item := range obj.(*v1beta1.ObjectTransferList).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 objectTransfers. +func (c *FakeObjectTransfers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(objecttransfersResource, opts)) +} + +// Create takes the representation of a objectTransfer and creates it. Returns the server's representation of the objectTransfer, and an error, if there is any. +func (c *FakeObjectTransfers) Create(ctx context.Context, objectTransfer *v1beta1.ObjectTransfer, opts v1.CreateOptions) (result *v1beta1.ObjectTransfer, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(objecttransfersResource, objectTransfer), &v1beta1.ObjectTransfer{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.ObjectTransfer), err +} + +// Update takes the representation of a objectTransfer and updates it. Returns the server's representation of the objectTransfer, and an error, if there is any. +func (c *FakeObjectTransfers) Update(ctx context.Context, objectTransfer *v1beta1.ObjectTransfer, opts v1.UpdateOptions) (result *v1beta1.ObjectTransfer, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(objecttransfersResource, objectTransfer), &v1beta1.ObjectTransfer{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.ObjectTransfer), 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 *FakeObjectTransfers) UpdateStatus(ctx context.Context, objectTransfer *v1beta1.ObjectTransfer, opts v1.UpdateOptions) (*v1beta1.ObjectTransfer, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(objecttransfersResource, "status", objectTransfer), &v1beta1.ObjectTransfer{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.ObjectTransfer), err +} + +// Delete takes name of the objectTransfer and deletes it. Returns an error if one occurs. +func (c *FakeObjectTransfers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(objecttransfersResource, name), &v1beta1.ObjectTransfer{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeObjectTransfers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(objecttransfersResource, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.ObjectTransferList{}) + return err +} + +// Patch applies the patch and returns the patched objectTransfer. +func (c *FakeObjectTransfers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ObjectTransfer, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(objecttransfersResource, name, pt, data, subresources...), &v1beta1.ObjectTransfer{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.ObjectTransfer), err +} diff --git a/vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/core/v1beta1/fake/fake_storageprofile.go b/vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/core/v1beta1/fake/fake_storageprofile.go new file mode 100644 index 000000000..c566ea14a --- /dev/null +++ b/vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/core/v1beta1/fake/fake_storageprofile.go @@ -0,0 +1,133 @@ +/* +Copyright The KubeVirt Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + v1beta1 "kubevirt.io/containerized-data-importer-api/pkg/apis/core/v1beta1" +) + +// FakeStorageProfiles implements StorageProfileInterface +type FakeStorageProfiles struct { + Fake *FakeCdiV1beta1 +} + +var storageprofilesResource = schema.GroupVersionResource{Group: "cdi.kubevirt.io", Version: "v1beta1", Resource: "storageprofiles"} + +var storageprofilesKind = schema.GroupVersionKind{Group: "cdi.kubevirt.io", Version: "v1beta1", Kind: "StorageProfile"} + +// Get takes name of the storageProfile, and returns the corresponding storageProfile object, and an error if there is any. +func (c *FakeStorageProfiles) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.StorageProfile, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(storageprofilesResource, name), &v1beta1.StorageProfile{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.StorageProfile), err +} + +// List takes label and field selectors, and returns the list of StorageProfiles that match those selectors. +func (c *FakeStorageProfiles) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.StorageProfileList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(storageprofilesResource, storageprofilesKind, opts), &v1beta1.StorageProfileList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.StorageProfileList{ListMeta: obj.(*v1beta1.StorageProfileList).ListMeta} + for _, item := range obj.(*v1beta1.StorageProfileList).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 storageProfiles. +func (c *FakeStorageProfiles) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(storageprofilesResource, opts)) +} + +// Create takes the representation of a storageProfile and creates it. Returns the server's representation of the storageProfile, and an error, if there is any. +func (c *FakeStorageProfiles) Create(ctx context.Context, storageProfile *v1beta1.StorageProfile, opts v1.CreateOptions) (result *v1beta1.StorageProfile, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(storageprofilesResource, storageProfile), &v1beta1.StorageProfile{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.StorageProfile), err +} + +// Update takes the representation of a storageProfile and updates it. Returns the server's representation of the storageProfile, and an error, if there is any. +func (c *FakeStorageProfiles) Update(ctx context.Context, storageProfile *v1beta1.StorageProfile, opts v1.UpdateOptions) (result *v1beta1.StorageProfile, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(storageprofilesResource, storageProfile), &v1beta1.StorageProfile{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.StorageProfile), 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 *FakeStorageProfiles) UpdateStatus(ctx context.Context, storageProfile *v1beta1.StorageProfile, opts v1.UpdateOptions) (*v1beta1.StorageProfile, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(storageprofilesResource, "status", storageProfile), &v1beta1.StorageProfile{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.StorageProfile), err +} + +// Delete takes name of the storageProfile and deletes it. Returns an error if one occurs. +func (c *FakeStorageProfiles) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(storageprofilesResource, name), &v1beta1.StorageProfile{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeStorageProfiles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(storageprofilesResource, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.StorageProfileList{}) + return err +} + +// Patch applies the patch and returns the patched storageProfile. +func (c *FakeStorageProfiles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.StorageProfile, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(storageprofilesResource, name, pt, data, subresources...), &v1beta1.StorageProfile{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.StorageProfile), err +} diff --git a/vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/core/v1beta1/fake/fake_volumeclonesource.go b/vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/core/v1beta1/fake/fake_volumeclonesource.go new file mode 100644 index 000000000..2cc1a3d99 --- /dev/null +++ b/vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/core/v1beta1/fake/fake_volumeclonesource.go @@ -0,0 +1,130 @@ +/* +Copyright The KubeVirt Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + v1beta1 "kubevirt.io/containerized-data-importer-api/pkg/apis/core/v1beta1" +) + +// FakeVolumeCloneSources implements VolumeCloneSourceInterface +type FakeVolumeCloneSources struct { + Fake *FakeCdiV1beta1 + ns string +} + +var volumeclonesourcesResource = schema.GroupVersionResource{Group: "cdi.kubevirt.io", Version: "v1beta1", Resource: "volumeclonesources"} + +var volumeclonesourcesKind = schema.GroupVersionKind{Group: "cdi.kubevirt.io", Version: "v1beta1", Kind: "VolumeCloneSource"} + +// Get takes name of the volumeCloneSource, and returns the corresponding volumeCloneSource object, and an error if there is any. +func (c *FakeVolumeCloneSources) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VolumeCloneSource, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(volumeclonesourcesResource, c.ns, name), &v1beta1.VolumeCloneSource{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VolumeCloneSource), err +} + +// List takes label and field selectors, and returns the list of VolumeCloneSources that match those selectors. +func (c *FakeVolumeCloneSources) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VolumeCloneSourceList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(volumeclonesourcesResource, volumeclonesourcesKind, c.ns, opts), &v1beta1.VolumeCloneSourceList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.VolumeCloneSourceList{ListMeta: obj.(*v1beta1.VolumeCloneSourceList).ListMeta} + for _, item := range obj.(*v1beta1.VolumeCloneSourceList).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 volumeCloneSources. +func (c *FakeVolumeCloneSources) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(volumeclonesourcesResource, c.ns, opts)) + +} + +// Create takes the representation of a volumeCloneSource and creates it. Returns the server's representation of the volumeCloneSource, and an error, if there is any. +func (c *FakeVolumeCloneSources) Create(ctx context.Context, volumeCloneSource *v1beta1.VolumeCloneSource, opts v1.CreateOptions) (result *v1beta1.VolumeCloneSource, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(volumeclonesourcesResource, c.ns, volumeCloneSource), &v1beta1.VolumeCloneSource{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VolumeCloneSource), err +} + +// Update takes the representation of a volumeCloneSource and updates it. Returns the server's representation of the volumeCloneSource, and an error, if there is any. +func (c *FakeVolumeCloneSources) Update(ctx context.Context, volumeCloneSource *v1beta1.VolumeCloneSource, opts v1.UpdateOptions) (result *v1beta1.VolumeCloneSource, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(volumeclonesourcesResource, c.ns, volumeCloneSource), &v1beta1.VolumeCloneSource{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VolumeCloneSource), err +} + +// Delete takes name of the volumeCloneSource and deletes it. Returns an error if one occurs. +func (c *FakeVolumeCloneSources) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(volumeclonesourcesResource, c.ns, name), &v1beta1.VolumeCloneSource{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeVolumeCloneSources) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(volumeclonesourcesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.VolumeCloneSourceList{}) + return err +} + +// Patch applies the patch and returns the patched volumeCloneSource. +func (c *FakeVolumeCloneSources) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VolumeCloneSource, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(volumeclonesourcesResource, c.ns, name, pt, data, subresources...), &v1beta1.VolumeCloneSource{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VolumeCloneSource), err +} diff --git a/vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/core/v1beta1/fake/fake_volumeimportsource.go b/vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/core/v1beta1/fake/fake_volumeimportsource.go new file mode 100644 index 000000000..3ae435d9b --- /dev/null +++ b/vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/core/v1beta1/fake/fake_volumeimportsource.go @@ -0,0 +1,142 @@ +/* +Copyright The KubeVirt Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + v1beta1 "kubevirt.io/containerized-data-importer-api/pkg/apis/core/v1beta1" +) + +// FakeVolumeImportSources implements VolumeImportSourceInterface +type FakeVolumeImportSources struct { + Fake *FakeCdiV1beta1 + ns string +} + +var volumeimportsourcesResource = schema.GroupVersionResource{Group: "cdi.kubevirt.io", Version: "v1beta1", Resource: "volumeimportsources"} + +var volumeimportsourcesKind = schema.GroupVersionKind{Group: "cdi.kubevirt.io", Version: "v1beta1", Kind: "VolumeImportSource"} + +// Get takes name of the volumeImportSource, and returns the corresponding volumeImportSource object, and an error if there is any. +func (c *FakeVolumeImportSources) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VolumeImportSource, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(volumeimportsourcesResource, c.ns, name), &v1beta1.VolumeImportSource{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VolumeImportSource), err +} + +// List takes label and field selectors, and returns the list of VolumeImportSources that match those selectors. +func (c *FakeVolumeImportSources) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VolumeImportSourceList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(volumeimportsourcesResource, volumeimportsourcesKind, c.ns, opts), &v1beta1.VolumeImportSourceList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.VolumeImportSourceList{ListMeta: obj.(*v1beta1.VolumeImportSourceList).ListMeta} + for _, item := range obj.(*v1beta1.VolumeImportSourceList).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 volumeImportSources. +func (c *FakeVolumeImportSources) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(volumeimportsourcesResource, c.ns, opts)) + +} + +// Create takes the representation of a volumeImportSource and creates it. Returns the server's representation of the volumeImportSource, and an error, if there is any. +func (c *FakeVolumeImportSources) Create(ctx context.Context, volumeImportSource *v1beta1.VolumeImportSource, opts v1.CreateOptions) (result *v1beta1.VolumeImportSource, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(volumeimportsourcesResource, c.ns, volumeImportSource), &v1beta1.VolumeImportSource{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VolumeImportSource), err +} + +// Update takes the representation of a volumeImportSource and updates it. Returns the server's representation of the volumeImportSource, and an error, if there is any. +func (c *FakeVolumeImportSources) Update(ctx context.Context, volumeImportSource *v1beta1.VolumeImportSource, opts v1.UpdateOptions) (result *v1beta1.VolumeImportSource, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(volumeimportsourcesResource, c.ns, volumeImportSource), &v1beta1.VolumeImportSource{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VolumeImportSource), 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 *FakeVolumeImportSources) UpdateStatus(ctx context.Context, volumeImportSource *v1beta1.VolumeImportSource, opts v1.UpdateOptions) (*v1beta1.VolumeImportSource, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(volumeimportsourcesResource, "status", c.ns, volumeImportSource), &v1beta1.VolumeImportSource{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VolumeImportSource), err +} + +// Delete takes name of the volumeImportSource and deletes it. Returns an error if one occurs. +func (c *FakeVolumeImportSources) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(volumeimportsourcesResource, c.ns, name), &v1beta1.VolumeImportSource{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeVolumeImportSources) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(volumeimportsourcesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.VolumeImportSourceList{}) + return err +} + +// Patch applies the patch and returns the patched volumeImportSource. +func (c *FakeVolumeImportSources) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VolumeImportSource, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(volumeimportsourcesResource, c.ns, name, pt, data, subresources...), &v1beta1.VolumeImportSource{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VolumeImportSource), err +} diff --git a/vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/core/v1beta1/fake/fake_volumeuploadsource.go b/vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/core/v1beta1/fake/fake_volumeuploadsource.go new file mode 100644 index 000000000..ba96e11b4 --- /dev/null +++ b/vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/core/v1beta1/fake/fake_volumeuploadsource.go @@ -0,0 +1,142 @@ +/* +Copyright The KubeVirt Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + v1beta1 "kubevirt.io/containerized-data-importer-api/pkg/apis/core/v1beta1" +) + +// FakeVolumeUploadSources implements VolumeUploadSourceInterface +type FakeVolumeUploadSources struct { + Fake *FakeCdiV1beta1 + ns string +} + +var volumeuploadsourcesResource = schema.GroupVersionResource{Group: "cdi.kubevirt.io", Version: "v1beta1", Resource: "volumeuploadsources"} + +var volumeuploadsourcesKind = schema.GroupVersionKind{Group: "cdi.kubevirt.io", Version: "v1beta1", Kind: "VolumeUploadSource"} + +// Get takes name of the volumeUploadSource, and returns the corresponding volumeUploadSource object, and an error if there is any. +func (c *FakeVolumeUploadSources) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VolumeUploadSource, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(volumeuploadsourcesResource, c.ns, name), &v1beta1.VolumeUploadSource{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VolumeUploadSource), err +} + +// List takes label and field selectors, and returns the list of VolumeUploadSources that match those selectors. +func (c *FakeVolumeUploadSources) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VolumeUploadSourceList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(volumeuploadsourcesResource, volumeuploadsourcesKind, c.ns, opts), &v1beta1.VolumeUploadSourceList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.VolumeUploadSourceList{ListMeta: obj.(*v1beta1.VolumeUploadSourceList).ListMeta} + for _, item := range obj.(*v1beta1.VolumeUploadSourceList).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 volumeUploadSources. +func (c *FakeVolumeUploadSources) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(volumeuploadsourcesResource, c.ns, opts)) + +} + +// Create takes the representation of a volumeUploadSource and creates it. Returns the server's representation of the volumeUploadSource, and an error, if there is any. +func (c *FakeVolumeUploadSources) Create(ctx context.Context, volumeUploadSource *v1beta1.VolumeUploadSource, opts v1.CreateOptions) (result *v1beta1.VolumeUploadSource, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(volumeuploadsourcesResource, c.ns, volumeUploadSource), &v1beta1.VolumeUploadSource{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VolumeUploadSource), err +} + +// Update takes the representation of a volumeUploadSource and updates it. Returns the server's representation of the volumeUploadSource, and an error, if there is any. +func (c *FakeVolumeUploadSources) Update(ctx context.Context, volumeUploadSource *v1beta1.VolumeUploadSource, opts v1.UpdateOptions) (result *v1beta1.VolumeUploadSource, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(volumeuploadsourcesResource, c.ns, volumeUploadSource), &v1beta1.VolumeUploadSource{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VolumeUploadSource), 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 *FakeVolumeUploadSources) UpdateStatus(ctx context.Context, volumeUploadSource *v1beta1.VolumeUploadSource, opts v1.UpdateOptions) (*v1beta1.VolumeUploadSource, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(volumeuploadsourcesResource, "status", c.ns, volumeUploadSource), &v1beta1.VolumeUploadSource{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VolumeUploadSource), err +} + +// Delete takes name of the volumeUploadSource and deletes it. Returns an error if one occurs. +func (c *FakeVolumeUploadSources) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(volumeuploadsourcesResource, c.ns, name), &v1beta1.VolumeUploadSource{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeVolumeUploadSources) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(volumeuploadsourcesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.VolumeUploadSourceList{}) + return err +} + +// Patch applies the patch and returns the patched volumeUploadSource. +func (c *FakeVolumeUploadSources) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VolumeUploadSource, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(volumeuploadsourcesResource, c.ns, name, pt, data, subresources...), &v1beta1.VolumeUploadSource{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VolumeUploadSource), err +} diff --git a/vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/upload/v1beta1/fake/doc.go b/vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/upload/v1beta1/fake/doc.go new file mode 100644 index 000000000..0ab586ad6 --- /dev/null +++ b/vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/upload/v1beta1/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The KubeVirt Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/upload/v1beta1/fake/fake_upload_client.go b/vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/upload/v1beta1/fake/fake_upload_client.go new file mode 100644 index 000000000..1b2dac028 --- /dev/null +++ b/vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/upload/v1beta1/fake/fake_upload_client.go @@ -0,0 +1,40 @@ +/* +Copyright The KubeVirt Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" + v1beta1 "kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/upload/v1beta1" +) + +type FakeUploadV1beta1 struct { + *testing.Fake +} + +func (c *FakeUploadV1beta1) UploadTokenRequests(namespace string) v1beta1.UploadTokenRequestInterface { + return &FakeUploadTokenRequests{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeUploadV1beta1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/upload/v1beta1/fake/fake_uploadtokenrequest.go b/vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/upload/v1beta1/fake/fake_uploadtokenrequest.go new file mode 100644 index 000000000..2382f84ce --- /dev/null +++ b/vendor/kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/upload/v1beta1/fake/fake_uploadtokenrequest.go @@ -0,0 +1,142 @@ +/* +Copyright The KubeVirt Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + v1beta1 "kubevirt.io/containerized-data-importer-api/pkg/apis/upload/v1beta1" +) + +// FakeUploadTokenRequests implements UploadTokenRequestInterface +type FakeUploadTokenRequests struct { + Fake *FakeUploadV1beta1 + ns string +} + +var uploadtokenrequestsResource = schema.GroupVersionResource{Group: "upload.cdi.kubevirt.io", Version: "v1beta1", Resource: "uploadtokenrequests"} + +var uploadtokenrequestsKind = schema.GroupVersionKind{Group: "upload.cdi.kubevirt.io", Version: "v1beta1", Kind: "UploadTokenRequest"} + +// Get takes name of the uploadTokenRequest, and returns the corresponding uploadTokenRequest object, and an error if there is any. +func (c *FakeUploadTokenRequests) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.UploadTokenRequest, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(uploadtokenrequestsResource, c.ns, name), &v1beta1.UploadTokenRequest{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.UploadTokenRequest), err +} + +// List takes label and field selectors, and returns the list of UploadTokenRequests that match those selectors. +func (c *FakeUploadTokenRequests) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.UploadTokenRequestList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(uploadtokenrequestsResource, uploadtokenrequestsKind, c.ns, opts), &v1beta1.UploadTokenRequestList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.UploadTokenRequestList{ListMeta: obj.(*v1beta1.UploadTokenRequestList).ListMeta} + for _, item := range obj.(*v1beta1.UploadTokenRequestList).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 uploadTokenRequests. +func (c *FakeUploadTokenRequests) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(uploadtokenrequestsResource, c.ns, opts)) + +} + +// Create takes the representation of a uploadTokenRequest and creates it. Returns the server's representation of the uploadTokenRequest, and an error, if there is any. +func (c *FakeUploadTokenRequests) Create(ctx context.Context, uploadTokenRequest *v1beta1.UploadTokenRequest, opts v1.CreateOptions) (result *v1beta1.UploadTokenRequest, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(uploadtokenrequestsResource, c.ns, uploadTokenRequest), &v1beta1.UploadTokenRequest{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.UploadTokenRequest), err +} + +// Update takes the representation of a uploadTokenRequest and updates it. Returns the server's representation of the uploadTokenRequest, and an error, if there is any. +func (c *FakeUploadTokenRequests) Update(ctx context.Context, uploadTokenRequest *v1beta1.UploadTokenRequest, opts v1.UpdateOptions) (result *v1beta1.UploadTokenRequest, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(uploadtokenrequestsResource, c.ns, uploadTokenRequest), &v1beta1.UploadTokenRequest{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.UploadTokenRequest), 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 *FakeUploadTokenRequests) UpdateStatus(ctx context.Context, uploadTokenRequest *v1beta1.UploadTokenRequest, opts v1.UpdateOptions) (*v1beta1.UploadTokenRequest, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(uploadtokenrequestsResource, "status", c.ns, uploadTokenRequest), &v1beta1.UploadTokenRequest{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.UploadTokenRequest), err +} + +// Delete takes name of the uploadTokenRequest and deletes it. Returns an error if one occurs. +func (c *FakeUploadTokenRequests) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(uploadtokenrequestsResource, c.ns, name), &v1beta1.UploadTokenRequest{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeUploadTokenRequests) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(uploadtokenrequestsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.UploadTokenRequestList{}) + return err +} + +// Patch applies the patch and returns the patched uploadTokenRequest. +func (c *FakeUploadTokenRequests) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.UploadTokenRequest, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(uploadtokenrequestsResource, c.ns, name, pt, data, subresources...), &v1beta1.UploadTokenRequest{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.UploadTokenRequest), err +} diff --git a/vendor/modules.txt b/vendor/modules.txt index ce6ffe452..3c5b1f181 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1329,9 +1329,12 @@ kubevirt.io/api/snapshot/v1beta1 # kubevirt.io/client-go v1.3.1 ## explicit; go 1.22.0 kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned +kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/fake kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/scheme kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/core/v1beta1 +kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/core/v1beta1/fake kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/upload/v1beta1 +kubevirt.io/client-go/generated/containerized-data-importer/clientset/versioned/typed/upload/v1beta1/fake kubevirt.io/client-go/generated/external-snapshotter/clientset/versioned kubevirt.io/client-go/generated/external-snapshotter/clientset/versioned/scheme kubevirt.io/client-go/generated/external-snapshotter/clientset/versioned/typed/volumesnapshot/v1