github.com/operator-framework/operator-lifecycle-manager@v0.30.0/pkg/fakes/fake_strategy_resolver.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package fakes 3 4 import ( 5 "sync" 6 7 "github.com/operator-framework/api/pkg/operators/v1alpha1" 8 "github.com/operator-framework/operator-lifecycle-manager/pkg/controller/install" 9 "github.com/operator-framework/operator-lifecycle-manager/pkg/lib/operatorclient" 10 "github.com/operator-framework/operator-lifecycle-manager/pkg/lib/operatorlister" 11 "github.com/operator-framework/operator-lifecycle-manager/pkg/lib/ownerutil" 12 ) 13 14 type FakeStrategyResolverInterface struct { 15 InstallerForStrategyStub func(string, operatorclient.ClientInterface, operatorlister.OperatorLister, ownerutil.Owner, map[string]string, []v1alpha1.APIServiceDescription, []v1alpha1.WebhookDescription, install.Strategy) install.StrategyInstaller 16 installerForStrategyMutex sync.RWMutex 17 installerForStrategyArgsForCall []struct { 18 arg1 string 19 arg2 operatorclient.ClientInterface 20 arg3 operatorlister.OperatorLister 21 arg4 ownerutil.Owner 22 arg5 map[string]string 23 arg6 []v1alpha1.APIServiceDescription 24 arg7 []v1alpha1.WebhookDescription 25 arg8 install.Strategy 26 } 27 installerForStrategyReturns struct { 28 result1 install.StrategyInstaller 29 } 30 installerForStrategyReturnsOnCall map[int]struct { 31 result1 install.StrategyInstaller 32 } 33 UnmarshalStrategyStub func(v1alpha1.NamedInstallStrategy) (install.Strategy, error) 34 unmarshalStrategyMutex sync.RWMutex 35 unmarshalStrategyArgsForCall []struct { 36 arg1 v1alpha1.NamedInstallStrategy 37 } 38 unmarshalStrategyReturns struct { 39 result1 install.Strategy 40 result2 error 41 } 42 unmarshalStrategyReturnsOnCall map[int]struct { 43 result1 install.Strategy 44 result2 error 45 } 46 invocations map[string][][]interface{} 47 invocationsMutex sync.RWMutex 48 } 49 50 func (fake *FakeStrategyResolverInterface) InstallerForStrategy(arg1 string, arg2 operatorclient.ClientInterface, arg3 operatorlister.OperatorLister, arg4 ownerutil.Owner, arg5 map[string]string, arg6 []v1alpha1.APIServiceDescription, arg7 []v1alpha1.WebhookDescription, arg8 install.Strategy) install.StrategyInstaller { 51 var arg6Copy []v1alpha1.APIServiceDescription 52 if arg6 != nil { 53 arg6Copy = make([]v1alpha1.APIServiceDescription, len(arg6)) 54 copy(arg6Copy, arg6) 55 } 56 var arg7Copy []v1alpha1.WebhookDescription 57 if arg7 != nil { 58 arg7Copy = make([]v1alpha1.WebhookDescription, len(arg7)) 59 copy(arg7Copy, arg7) 60 } 61 fake.installerForStrategyMutex.Lock() 62 ret, specificReturn := fake.installerForStrategyReturnsOnCall[len(fake.installerForStrategyArgsForCall)] 63 fake.installerForStrategyArgsForCall = append(fake.installerForStrategyArgsForCall, struct { 64 arg1 string 65 arg2 operatorclient.ClientInterface 66 arg3 operatorlister.OperatorLister 67 arg4 ownerutil.Owner 68 arg5 map[string]string 69 arg6 []v1alpha1.APIServiceDescription 70 arg7 []v1alpha1.WebhookDescription 71 arg8 install.Strategy 72 }{arg1, arg2, arg3, arg4, arg5, arg6Copy, arg7Copy, arg8}) 73 stub := fake.InstallerForStrategyStub 74 fakeReturns := fake.installerForStrategyReturns 75 fake.recordInvocation("InstallerForStrategy", []interface{}{arg1, arg2, arg3, arg4, arg5, arg6Copy, arg7Copy, arg8}) 76 fake.installerForStrategyMutex.Unlock() 77 if stub != nil { 78 return stub(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) 79 } 80 if specificReturn { 81 return ret.result1 82 } 83 return fakeReturns.result1 84 } 85 86 func (fake *FakeStrategyResolverInterface) InstallerForStrategyCallCount() int { 87 fake.installerForStrategyMutex.RLock() 88 defer fake.installerForStrategyMutex.RUnlock() 89 return len(fake.installerForStrategyArgsForCall) 90 } 91 92 func (fake *FakeStrategyResolverInterface) InstallerForStrategyCalls(stub func(string, operatorclient.ClientInterface, operatorlister.OperatorLister, ownerutil.Owner, map[string]string, []v1alpha1.APIServiceDescription, []v1alpha1.WebhookDescription, install.Strategy) install.StrategyInstaller) { 93 fake.installerForStrategyMutex.Lock() 94 defer fake.installerForStrategyMutex.Unlock() 95 fake.InstallerForStrategyStub = stub 96 } 97 98 func (fake *FakeStrategyResolverInterface) InstallerForStrategyArgsForCall(i int) (string, operatorclient.ClientInterface, operatorlister.OperatorLister, ownerutil.Owner, map[string]string, []v1alpha1.APIServiceDescription, []v1alpha1.WebhookDescription, install.Strategy) { 99 fake.installerForStrategyMutex.RLock() 100 defer fake.installerForStrategyMutex.RUnlock() 101 argsForCall := fake.installerForStrategyArgsForCall[i] 102 return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4, argsForCall.arg5, argsForCall.arg6, argsForCall.arg7, argsForCall.arg8 103 } 104 105 func (fake *FakeStrategyResolverInterface) InstallerForStrategyReturns(result1 install.StrategyInstaller) { 106 fake.installerForStrategyMutex.Lock() 107 defer fake.installerForStrategyMutex.Unlock() 108 fake.InstallerForStrategyStub = nil 109 fake.installerForStrategyReturns = struct { 110 result1 install.StrategyInstaller 111 }{result1} 112 } 113 114 func (fake *FakeStrategyResolverInterface) InstallerForStrategyReturnsOnCall(i int, result1 install.StrategyInstaller) { 115 fake.installerForStrategyMutex.Lock() 116 defer fake.installerForStrategyMutex.Unlock() 117 fake.InstallerForStrategyStub = nil 118 if fake.installerForStrategyReturnsOnCall == nil { 119 fake.installerForStrategyReturnsOnCall = make(map[int]struct { 120 result1 install.StrategyInstaller 121 }) 122 } 123 fake.installerForStrategyReturnsOnCall[i] = struct { 124 result1 install.StrategyInstaller 125 }{result1} 126 } 127 128 func (fake *FakeStrategyResolverInterface) UnmarshalStrategy(arg1 v1alpha1.NamedInstallStrategy) (install.Strategy, error) { 129 fake.unmarshalStrategyMutex.Lock() 130 ret, specificReturn := fake.unmarshalStrategyReturnsOnCall[len(fake.unmarshalStrategyArgsForCall)] 131 fake.unmarshalStrategyArgsForCall = append(fake.unmarshalStrategyArgsForCall, struct { 132 arg1 v1alpha1.NamedInstallStrategy 133 }{arg1}) 134 stub := fake.UnmarshalStrategyStub 135 fakeReturns := fake.unmarshalStrategyReturns 136 fake.recordInvocation("UnmarshalStrategy", []interface{}{arg1}) 137 fake.unmarshalStrategyMutex.Unlock() 138 if stub != nil { 139 return stub(arg1) 140 } 141 if specificReturn { 142 return ret.result1, ret.result2 143 } 144 return fakeReturns.result1, fakeReturns.result2 145 } 146 147 func (fake *FakeStrategyResolverInterface) UnmarshalStrategyCallCount() int { 148 fake.unmarshalStrategyMutex.RLock() 149 defer fake.unmarshalStrategyMutex.RUnlock() 150 return len(fake.unmarshalStrategyArgsForCall) 151 } 152 153 func (fake *FakeStrategyResolverInterface) UnmarshalStrategyCalls(stub func(v1alpha1.NamedInstallStrategy) (install.Strategy, error)) { 154 fake.unmarshalStrategyMutex.Lock() 155 defer fake.unmarshalStrategyMutex.Unlock() 156 fake.UnmarshalStrategyStub = stub 157 } 158 159 func (fake *FakeStrategyResolverInterface) UnmarshalStrategyArgsForCall(i int) v1alpha1.NamedInstallStrategy { 160 fake.unmarshalStrategyMutex.RLock() 161 defer fake.unmarshalStrategyMutex.RUnlock() 162 argsForCall := fake.unmarshalStrategyArgsForCall[i] 163 return argsForCall.arg1 164 } 165 166 func (fake *FakeStrategyResolverInterface) UnmarshalStrategyReturns(result1 install.Strategy, result2 error) { 167 fake.unmarshalStrategyMutex.Lock() 168 defer fake.unmarshalStrategyMutex.Unlock() 169 fake.UnmarshalStrategyStub = nil 170 fake.unmarshalStrategyReturns = struct { 171 result1 install.Strategy 172 result2 error 173 }{result1, result2} 174 } 175 176 func (fake *FakeStrategyResolverInterface) UnmarshalStrategyReturnsOnCall(i int, result1 install.Strategy, result2 error) { 177 fake.unmarshalStrategyMutex.Lock() 178 defer fake.unmarshalStrategyMutex.Unlock() 179 fake.UnmarshalStrategyStub = nil 180 if fake.unmarshalStrategyReturnsOnCall == nil { 181 fake.unmarshalStrategyReturnsOnCall = make(map[int]struct { 182 result1 install.Strategy 183 result2 error 184 }) 185 } 186 fake.unmarshalStrategyReturnsOnCall[i] = struct { 187 result1 install.Strategy 188 result2 error 189 }{result1, result2} 190 } 191 192 func (fake *FakeStrategyResolverInterface) Invocations() map[string][][]interface{} { 193 fake.invocationsMutex.RLock() 194 defer fake.invocationsMutex.RUnlock() 195 fake.installerForStrategyMutex.RLock() 196 defer fake.installerForStrategyMutex.RUnlock() 197 fake.unmarshalStrategyMutex.RLock() 198 defer fake.unmarshalStrategyMutex.RUnlock() 199 copiedInvocations := map[string][][]interface{}{} 200 for key, value := range fake.invocations { 201 copiedInvocations[key] = value 202 } 203 return copiedInvocations 204 } 205 206 func (fake *FakeStrategyResolverInterface) recordInvocation(key string, args []interface{}) { 207 fake.invocationsMutex.Lock() 208 defer fake.invocationsMutex.Unlock() 209 if fake.invocations == nil { 210 fake.invocations = map[string][][]interface{}{} 211 } 212 if fake.invocations[key] == nil { 213 fake.invocations[key] = [][]interface{}{} 214 } 215 fake.invocations[key] = append(fake.invocations[key], args) 216 } 217 218 var _ install.StrategyResolverInterface = new(FakeStrategyResolverInterface)