github.com/wanddynosios/cli/v8@v8.7.9-0.20240221182337-1a92e3a7017f/actor/v7action/v7actionfakes/fake_kubernetes_config_getter.go (about)

     1  // Code generated by counterfeiter. DO NOT EDIT.
     2  package v7actionfakes
     3  
     4  import (
     5  	"sync"
     6  
     7  	"code.cloudfoundry.org/cli/actor/v7action"
     8  	"k8s.io/client-go/tools/clientcmd/api"
     9  )
    10  
    11  type FakeKubernetesConfigGetter struct {
    12  	GetStub        func() (*api.Config, error)
    13  	getMutex       sync.RWMutex
    14  	getArgsForCall []struct {
    15  	}
    16  	getReturns struct {
    17  		result1 *api.Config
    18  		result2 error
    19  	}
    20  	getReturnsOnCall map[int]struct {
    21  		result1 *api.Config
    22  		result2 error
    23  	}
    24  	invocations      map[string][][]interface{}
    25  	invocationsMutex sync.RWMutex
    26  }
    27  
    28  func (fake *FakeKubernetesConfigGetter) Get() (*api.Config, error) {
    29  	fake.getMutex.Lock()
    30  	ret, specificReturn := fake.getReturnsOnCall[len(fake.getArgsForCall)]
    31  	fake.getArgsForCall = append(fake.getArgsForCall, struct {
    32  	}{})
    33  	fake.recordInvocation("Get", []interface{}{})
    34  	fake.getMutex.Unlock()
    35  	if fake.GetStub != nil {
    36  		return fake.GetStub()
    37  	}
    38  	if specificReturn {
    39  		return ret.result1, ret.result2
    40  	}
    41  	fakeReturns := fake.getReturns
    42  	return fakeReturns.result1, fakeReturns.result2
    43  }
    44  
    45  func (fake *FakeKubernetesConfigGetter) GetCallCount() int {
    46  	fake.getMutex.RLock()
    47  	defer fake.getMutex.RUnlock()
    48  	return len(fake.getArgsForCall)
    49  }
    50  
    51  func (fake *FakeKubernetesConfigGetter) GetCalls(stub func() (*api.Config, error)) {
    52  	fake.getMutex.Lock()
    53  	defer fake.getMutex.Unlock()
    54  	fake.GetStub = stub
    55  }
    56  
    57  func (fake *FakeKubernetesConfigGetter) GetReturns(result1 *api.Config, result2 error) {
    58  	fake.getMutex.Lock()
    59  	defer fake.getMutex.Unlock()
    60  	fake.GetStub = nil
    61  	fake.getReturns = struct {
    62  		result1 *api.Config
    63  		result2 error
    64  	}{result1, result2}
    65  }
    66  
    67  func (fake *FakeKubernetesConfigGetter) GetReturnsOnCall(i int, result1 *api.Config, result2 error) {
    68  	fake.getMutex.Lock()
    69  	defer fake.getMutex.Unlock()
    70  	fake.GetStub = nil
    71  	if fake.getReturnsOnCall == nil {
    72  		fake.getReturnsOnCall = make(map[int]struct {
    73  			result1 *api.Config
    74  			result2 error
    75  		})
    76  	}
    77  	fake.getReturnsOnCall[i] = struct {
    78  		result1 *api.Config
    79  		result2 error
    80  	}{result1, result2}
    81  }
    82  
    83  func (fake *FakeKubernetesConfigGetter) Invocations() map[string][][]interface{} {
    84  	fake.invocationsMutex.RLock()
    85  	defer fake.invocationsMutex.RUnlock()
    86  	fake.getMutex.RLock()
    87  	defer fake.getMutex.RUnlock()
    88  	copiedInvocations := map[string][][]interface{}{}
    89  	for key, value := range fake.invocations {
    90  		copiedInvocations[key] = value
    91  	}
    92  	return copiedInvocations
    93  }
    94  
    95  func (fake *FakeKubernetesConfigGetter) recordInvocation(key string, args []interface{}) {
    96  	fake.invocationsMutex.Lock()
    97  	defer fake.invocationsMutex.Unlock()
    98  	if fake.invocations == nil {
    99  		fake.invocations = map[string][][]interface{}{}
   100  	}
   101  	if fake.invocations[key] == nil {
   102  		fake.invocations[key] = [][]interface{}{}
   103  	}
   104  	fake.invocations[key] = append(fake.invocations[key], args)
   105  }
   106  
   107  var _ v7action.KubernetesConfigGetter = new(FakeKubernetesConfigGetter)