volcano.sh/apis@v1.8.2/pkg/client/clientset/versioned/fake/clientset_generated.go (about)

     1  /*
     2  Copyright 2021 The Volcano Authors.
     3  
     4  Licensed under the Apache License, Version 2.0 (the "License");
     5  you may not use this file except in compliance with the License.
     6  You may obtain a copy of the License at
     7  
     8      http://www.apache.org/licenses/LICENSE-2.0
     9  
    10  Unless required by applicable law or agreed to in writing, software
    11  distributed under the License is distributed on an "AS IS" BASIS,
    12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  See the License for the specific language governing permissions and
    14  limitations under the License.
    15  */
    16  // Code generated by client-gen. DO NOT EDIT.
    17  
    18  package fake
    19  
    20  import (
    21  	"k8s.io/apimachinery/pkg/runtime"
    22  	"k8s.io/apimachinery/pkg/watch"
    23  	"k8s.io/client-go/discovery"
    24  	fakediscovery "k8s.io/client-go/discovery/fake"
    25  	"k8s.io/client-go/testing"
    26  	clientset "volcano.sh/apis/pkg/client/clientset/versioned"
    27  	batchv1alpha1 "volcano.sh/apis/pkg/client/clientset/versioned/typed/batch/v1alpha1"
    28  	fakebatchv1alpha1 "volcano.sh/apis/pkg/client/clientset/versioned/typed/batch/v1alpha1/fake"
    29  	busv1alpha1 "volcano.sh/apis/pkg/client/clientset/versioned/typed/bus/v1alpha1"
    30  	fakebusv1alpha1 "volcano.sh/apis/pkg/client/clientset/versioned/typed/bus/v1alpha1/fake"
    31  	flowv1alpha1 "volcano.sh/apis/pkg/client/clientset/versioned/typed/flow/v1alpha1"
    32  	fakeflowv1alpha1 "volcano.sh/apis/pkg/client/clientset/versioned/typed/flow/v1alpha1/fake"
    33  	nodeinfov1alpha1 "volcano.sh/apis/pkg/client/clientset/versioned/typed/nodeinfo/v1alpha1"
    34  	fakenodeinfov1alpha1 "volcano.sh/apis/pkg/client/clientset/versioned/typed/nodeinfo/v1alpha1/fake"
    35  	schedulingv1beta1 "volcano.sh/apis/pkg/client/clientset/versioned/typed/scheduling/v1beta1"
    36  	fakeschedulingv1beta1 "volcano.sh/apis/pkg/client/clientset/versioned/typed/scheduling/v1beta1/fake"
    37  )
    38  
    39  // NewSimpleClientset returns a clientset that will respond with the provided objects.
    40  // It's backed by a very simple object tracker that processes creates, updates and deletions as-is,
    41  // without applying any validations and/or defaults. It shouldn't be considered a replacement
    42  // for a real clientset and is mostly useful in simple unit tests.
    43  func NewSimpleClientset(objects ...runtime.Object) *Clientset {
    44  	o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder())
    45  	for _, obj := range objects {
    46  		if err := o.Add(obj); err != nil {
    47  			panic(err)
    48  		}
    49  	}
    50  
    51  	cs := &Clientset{tracker: o}
    52  	cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake}
    53  	cs.AddReactor("*", "*", testing.ObjectReaction(o))
    54  	cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) {
    55  		gvr := action.GetResource()
    56  		ns := action.GetNamespace()
    57  		watch, err := o.Watch(gvr, ns)
    58  		if err != nil {
    59  			return false, nil, err
    60  		}
    61  		return true, watch, nil
    62  	})
    63  
    64  	return cs
    65  }
    66  
    67  // Clientset implements clientset.Interface. Meant to be embedded into a
    68  // struct to get a default implementation. This makes faking out just the method
    69  // you want to test easier.
    70  type Clientset struct {
    71  	testing.Fake
    72  	discovery *fakediscovery.FakeDiscovery
    73  	tracker   testing.ObjectTracker
    74  }
    75  
    76  func (c *Clientset) Discovery() discovery.DiscoveryInterface {
    77  	return c.discovery
    78  }
    79  
    80  func (c *Clientset) Tracker() testing.ObjectTracker {
    81  	return c.tracker
    82  }
    83  
    84  var (
    85  	_ clientset.Interface = &Clientset{}
    86  	_ testing.FakeClient  = &Clientset{}
    87  )
    88  
    89  // BatchV1alpha1 retrieves the BatchV1alpha1Client
    90  func (c *Clientset) BatchV1alpha1() batchv1alpha1.BatchV1alpha1Interface {
    91  	return &fakebatchv1alpha1.FakeBatchV1alpha1{Fake: &c.Fake}
    92  }
    93  
    94  // BusV1alpha1 retrieves the BusV1alpha1Client
    95  func (c *Clientset) BusV1alpha1() busv1alpha1.BusV1alpha1Interface {
    96  	return &fakebusv1alpha1.FakeBusV1alpha1{Fake: &c.Fake}
    97  }
    98  
    99  // FlowV1alpha1 retrieves the FlowV1alpha1Client
   100  func (c *Clientset) FlowV1alpha1() flowv1alpha1.FlowV1alpha1Interface {
   101  	return &fakeflowv1alpha1.FakeFlowV1alpha1{Fake: &c.Fake}
   102  }
   103  
   104  // NodeinfoV1alpha1 retrieves the NodeinfoV1alpha1Client
   105  func (c *Clientset) NodeinfoV1alpha1() nodeinfov1alpha1.NodeinfoV1alpha1Interface {
   106  	return &fakenodeinfov1alpha1.FakeNodeinfoV1alpha1{Fake: &c.Fake}
   107  }
   108  
   109  // SchedulingV1beta1 retrieves the SchedulingV1beta1Client
   110  func (c *Clientset) SchedulingV1beta1() schedulingv1beta1.SchedulingV1beta1Interface {
   111  	return &fakeschedulingv1beta1.FakeSchedulingV1beta1{Fake: &c.Fake}
   112  }