This commit is contained in:
Mikalai Radchuk 2023-01-17 16:37:53 +00:00 коммит произвёл Caden Marchese
Родитель bfa3552ba5
Коммит 4d92ce60a1
8 изменённых файлов: 0 добавлений и 381 удалений

Просмотреть файл

@ -1,69 +0,0 @@
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
clientset "github.com/openshift/client-go/imageregistry/clientset/versioned"
imageregistryv1 "github.com/openshift/client-go/imageregistry/clientset/versioned/typed/imageregistry/v1"
fakeimageregistryv1 "github.com/openshift/client-go/imageregistry/clientset/versioned/typed/imageregistry/v1/fake"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/watch"
"k8s.io/client-go/discovery"
fakediscovery "k8s.io/client-go/discovery/fake"
"k8s.io/client-go/testing"
)
// NewSimpleClientset returns a clientset that will respond with the provided objects.
// It's backed by a very simple object tracker that processes creates, updates and deletions as-is,
// without applying any validations and/or defaults. It shouldn't be considered a replacement
// for a real clientset and is mostly useful in simple unit tests.
func NewSimpleClientset(objects ...runtime.Object) *Clientset {
o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder())
for _, obj := range objects {
if err := o.Add(obj); err != nil {
panic(err)
}
}
cs := &Clientset{tracker: o}
cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake}
cs.AddReactor("*", "*", testing.ObjectReaction(o))
cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) {
gvr := action.GetResource()
ns := action.GetNamespace()
watch, err := o.Watch(gvr, ns)
if err != nil {
return false, nil, err
}
return true, watch, nil
})
return cs
}
// Clientset implements clientset.Interface. Meant to be embedded into a
// struct to get a default implementation. This makes faking out just the method
// you want to test easier.
type Clientset struct {
testing.Fake
discovery *fakediscovery.FakeDiscovery
tracker testing.ObjectTracker
}
func (c *Clientset) Discovery() discovery.DiscoveryInterface {
return c.discovery
}
func (c *Clientset) Tracker() testing.ObjectTracker {
return c.tracker
}
var (
_ clientset.Interface = &Clientset{}
_ testing.FakeClient = &Clientset{}
)
// ImageregistryV1 retrieves the ImageregistryV1Client
func (c *Clientset) ImageregistryV1() imageregistryv1.ImageregistryV1Interface {
return &fakeimageregistryv1.FakeImageregistryV1{Fake: &c.Fake}
}

4
vendor/github.com/openshift/client-go/imageregistry/clientset/versioned/fake/doc.go сгенерированный поставляемый
Просмотреть файл

@ -1,4 +0,0 @@
// Code generated by client-gen. DO NOT EDIT.
// This package has the automatically generated fake clientset.
package fake

40
vendor/github.com/openshift/client-go/imageregistry/clientset/versioned/fake/register.go сгенерированный поставляемый
Просмотреть файл

@ -1,40 +0,0 @@
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
imageregistryv1 "github.com/openshift/api/imageregistry/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
schema "k8s.io/apimachinery/pkg/runtime/schema"
serializer "k8s.io/apimachinery/pkg/runtime/serializer"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
)
var scheme = runtime.NewScheme()
var codecs = serializer.NewCodecFactory(scheme)
var localSchemeBuilder = runtime.SchemeBuilder{
imageregistryv1.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))
}

Просмотреть файл

@ -1,4 +0,0 @@
// Code generated by client-gen. DO NOT EDIT.
// Package fake has the automatically generated clients.
package fake

Просмотреть файл

@ -1,117 +0,0 @@
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
"context"
imageregistryv1 "github.com/openshift/api/imageregistry/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
)
// FakeConfigs implements ConfigInterface
type FakeConfigs struct {
Fake *FakeImageregistryV1
}
var configsResource = schema.GroupVersionResource{Group: "imageregistry.operator.openshift.io", Version: "v1", Resource: "configs"}
var configsKind = schema.GroupVersionKind{Group: "imageregistry.operator.openshift.io", Version: "v1", Kind: "Config"}
// Get takes name of the config, and returns the corresponding config object, and an error if there is any.
func (c *FakeConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *imageregistryv1.Config, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootGetAction(configsResource, name), &imageregistryv1.Config{})
if obj == nil {
return nil, err
}
return obj.(*imageregistryv1.Config), err
}
// List takes label and field selectors, and returns the list of Configs that match those selectors.
func (c *FakeConfigs) List(ctx context.Context, opts v1.ListOptions) (result *imageregistryv1.ConfigList, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootListAction(configsResource, configsKind, opts), &imageregistryv1.ConfigList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &imageregistryv1.ConfigList{ListMeta: obj.(*imageregistryv1.ConfigList).ListMeta}
for _, item := range obj.(*imageregistryv1.ConfigList).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 configs.
func (c *FakeConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewRootWatchAction(configsResource, opts))
}
// Create takes the representation of a config and creates it. Returns the server's representation of the config, and an error, if there is any.
func (c *FakeConfigs) Create(ctx context.Context, config *imageregistryv1.Config, opts v1.CreateOptions) (result *imageregistryv1.Config, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(configsResource, config), &imageregistryv1.Config{})
if obj == nil {
return nil, err
}
return obj.(*imageregistryv1.Config), err
}
// Update takes the representation of a config and updates it. Returns the server's representation of the config, and an error, if there is any.
func (c *FakeConfigs) Update(ctx context.Context, config *imageregistryv1.Config, opts v1.UpdateOptions) (result *imageregistryv1.Config, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootUpdateAction(configsResource, config), &imageregistryv1.Config{})
if obj == nil {
return nil, err
}
return obj.(*imageregistryv1.Config), 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 *FakeConfigs) UpdateStatus(ctx context.Context, config *imageregistryv1.Config, opts v1.UpdateOptions) (*imageregistryv1.Config, error) {
obj, err := c.Fake.
Invokes(testing.NewRootUpdateSubresourceAction(configsResource, "status", config), &imageregistryv1.Config{})
if obj == nil {
return nil, err
}
return obj.(*imageregistryv1.Config), err
}
// Delete takes name of the config and deletes it. Returns an error if one occurs.
func (c *FakeConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewRootDeleteActionWithOptions(configsResource, name, opts), &imageregistryv1.Config{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(configsResource, listOpts)
_, err := c.Fake.Invokes(action, &imageregistryv1.ConfigList{})
return err
}
// Patch applies the patch and returns the patched config.
func (c *FakeConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *imageregistryv1.Config, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(configsResource, name, pt, data, subresources...), &imageregistryv1.Config{})
if obj == nil {
return nil, err
}
return obj.(*imageregistryv1.Config), err
}

Просмотреть файл

@ -1,117 +0,0 @@
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
"context"
imageregistryv1 "github.com/openshift/api/imageregistry/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
)
// FakeImagePruners implements ImagePrunerInterface
type FakeImagePruners struct {
Fake *FakeImageregistryV1
}
var imageprunersResource = schema.GroupVersionResource{Group: "imageregistry.operator.openshift.io", Version: "v1", Resource: "imagepruners"}
var imageprunersKind = schema.GroupVersionKind{Group: "imageregistry.operator.openshift.io", Version: "v1", Kind: "ImagePruner"}
// Get takes name of the imagePruner, and returns the corresponding imagePruner object, and an error if there is any.
func (c *FakeImagePruners) Get(ctx context.Context, name string, options v1.GetOptions) (result *imageregistryv1.ImagePruner, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootGetAction(imageprunersResource, name), &imageregistryv1.ImagePruner{})
if obj == nil {
return nil, err
}
return obj.(*imageregistryv1.ImagePruner), err
}
// List takes label and field selectors, and returns the list of ImagePruners that match those selectors.
func (c *FakeImagePruners) List(ctx context.Context, opts v1.ListOptions) (result *imageregistryv1.ImagePrunerList, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootListAction(imageprunersResource, imageprunersKind, opts), &imageregistryv1.ImagePrunerList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &imageregistryv1.ImagePrunerList{ListMeta: obj.(*imageregistryv1.ImagePrunerList).ListMeta}
for _, item := range obj.(*imageregistryv1.ImagePrunerList).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 imagePruners.
func (c *FakeImagePruners) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewRootWatchAction(imageprunersResource, opts))
}
// Create takes the representation of a imagePruner and creates it. Returns the server's representation of the imagePruner, and an error, if there is any.
func (c *FakeImagePruners) Create(ctx context.Context, imagePruner *imageregistryv1.ImagePruner, opts v1.CreateOptions) (result *imageregistryv1.ImagePruner, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(imageprunersResource, imagePruner), &imageregistryv1.ImagePruner{})
if obj == nil {
return nil, err
}
return obj.(*imageregistryv1.ImagePruner), err
}
// Update takes the representation of a imagePruner and updates it. Returns the server's representation of the imagePruner, and an error, if there is any.
func (c *FakeImagePruners) Update(ctx context.Context, imagePruner *imageregistryv1.ImagePruner, opts v1.UpdateOptions) (result *imageregistryv1.ImagePruner, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootUpdateAction(imageprunersResource, imagePruner), &imageregistryv1.ImagePruner{})
if obj == nil {
return nil, err
}
return obj.(*imageregistryv1.ImagePruner), 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 *FakeImagePruners) UpdateStatus(ctx context.Context, imagePruner *imageregistryv1.ImagePruner, opts v1.UpdateOptions) (*imageregistryv1.ImagePruner, error) {
obj, err := c.Fake.
Invokes(testing.NewRootUpdateSubresourceAction(imageprunersResource, "status", imagePruner), &imageregistryv1.ImagePruner{})
if obj == nil {
return nil, err
}
return obj.(*imageregistryv1.ImagePruner), err
}
// Delete takes name of the imagePruner and deletes it. Returns an error if one occurs.
func (c *FakeImagePruners) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewRootDeleteActionWithOptions(imageprunersResource, name, opts), &imageregistryv1.ImagePruner{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeImagePruners) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(imageprunersResource, listOpts)
_, err := c.Fake.Invokes(action, &imageregistryv1.ImagePrunerList{})
return err
}
// Patch applies the patch and returns the patched imagePruner.
func (c *FakeImagePruners) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *imageregistryv1.ImagePruner, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(imageprunersResource, name, pt, data, subresources...), &imageregistryv1.ImagePruner{})
if obj == nil {
return nil, err
}
return obj.(*imageregistryv1.ImagePruner), err
}

Просмотреть файл

@ -1,28 +0,0 @@
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
v1 "github.com/openshift/client-go/imageregistry/clientset/versioned/typed/imageregistry/v1"
rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing"
)
type FakeImageregistryV1 struct {
*testing.Fake
}
func (c *FakeImageregistryV1) Configs() v1.ConfigInterface {
return &FakeConfigs{c}
}
func (c *FakeImageregistryV1) ImagePruners() v1.ImagePrunerInterface {
return &FakeImagePruners{c}
}
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *FakeImageregistryV1) RESTClient() rest.Interface {
var ret *rest.RESTClient
return ret
}

2
vendor/modules.txt поставляемый
Просмотреть файл

@ -1077,10 +1077,8 @@ github.com/openshift/client-go/config/clientset/versioned/scheme
github.com/openshift/client-go/config/clientset/versioned/typed/config/v1
github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake
github.com/openshift/client-go/imageregistry/clientset/versioned
github.com/openshift/client-go/imageregistry/clientset/versioned/fake
github.com/openshift/client-go/imageregistry/clientset/versioned/scheme
github.com/openshift/client-go/imageregistry/clientset/versioned/typed/imageregistry/v1
github.com/openshift/client-go/imageregistry/clientset/versioned/typed/imageregistry/v1/fake
github.com/openshift/client-go/machine/clientset/versioned
github.com/openshift/client-go/machine/clientset/versioned/fake
github.com/openshift/client-go/machine/clientset/versioned/scheme