github.com/argoproj/argo-cd@v1.8.7/controller/cache/mocks/LiveStateCache.go (about) 1 // Code generated by mockery v1.0.0. DO NOT EDIT. 2 3 package mocks 4 5 import ( 6 context "context" 7 8 cache "github.com/argoproj/gitops-engine/pkg/cache" 9 10 kube "github.com/argoproj/gitops-engine/pkg/utils/kube" 11 12 mock "github.com/stretchr/testify/mock" 13 14 schema "k8s.io/apimachinery/pkg/runtime/schema" 15 16 unstructured "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" 17 18 v1 "k8s.io/apimachinery/pkg/apis/meta/v1" 19 20 v1alpha1 "github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1" 21 ) 22 23 // LiveStateCache is an autogenerated mock type for the LiveStateCache type 24 type LiveStateCache struct { 25 mock.Mock 26 } 27 28 // GetClusterCache provides a mock function with given fields: server 29 func (_m *LiveStateCache) GetClusterCache(server string) (cache.ClusterCache, error) { 30 ret := _m.Called(server) 31 32 var r0 cache.ClusterCache 33 if rf, ok := ret.Get(0).(func(string) cache.ClusterCache); ok { 34 r0 = rf(server) 35 } else { 36 if ret.Get(0) != nil { 37 r0 = ret.Get(0).(cache.ClusterCache) 38 } 39 } 40 41 var r1 error 42 if rf, ok := ret.Get(1).(func(string) error); ok { 43 r1 = rf(server) 44 } else { 45 r1 = ret.Error(1) 46 } 47 48 return r0, r1 49 } 50 51 // GetClustersInfo provides a mock function with given fields: 52 func (_m *LiveStateCache) GetClustersInfo() []cache.ClusterInfo { 53 ret := _m.Called() 54 55 var r0 []cache.ClusterInfo 56 if rf, ok := ret.Get(0).(func() []cache.ClusterInfo); ok { 57 r0 = rf() 58 } else { 59 if ret.Get(0) != nil { 60 r0 = ret.Get(0).([]cache.ClusterInfo) 61 } 62 } 63 64 return r0 65 } 66 67 // GetManagedLiveObjs provides a mock function with given fields: a, targetObjs 68 func (_m *LiveStateCache) GetManagedLiveObjs(a *v1alpha1.Application, targetObjs []*unstructured.Unstructured) (map[kube.ResourceKey]*unstructured.Unstructured, error) { 69 ret := _m.Called(a, targetObjs) 70 71 var r0 map[kube.ResourceKey]*unstructured.Unstructured 72 if rf, ok := ret.Get(0).(func(*v1alpha1.Application, []*unstructured.Unstructured) map[kube.ResourceKey]*unstructured.Unstructured); ok { 73 r0 = rf(a, targetObjs) 74 } else { 75 if ret.Get(0) != nil { 76 r0 = ret.Get(0).(map[kube.ResourceKey]*unstructured.Unstructured) 77 } 78 } 79 80 var r1 error 81 if rf, ok := ret.Get(1).(func(*v1alpha1.Application, []*unstructured.Unstructured) error); ok { 82 r1 = rf(a, targetObjs) 83 } else { 84 r1 = ret.Error(1) 85 } 86 87 return r0, r1 88 } 89 90 // GetNamespaceTopLevelResources provides a mock function with given fields: server, namespace 91 func (_m *LiveStateCache) GetNamespaceTopLevelResources(server string, namespace string) (map[kube.ResourceKey]v1alpha1.ResourceNode, error) { 92 ret := _m.Called(server, namespace) 93 94 var r0 map[kube.ResourceKey]v1alpha1.ResourceNode 95 if rf, ok := ret.Get(0).(func(string, string) map[kube.ResourceKey]v1alpha1.ResourceNode); ok { 96 r0 = rf(server, namespace) 97 } else { 98 if ret.Get(0) != nil { 99 r0 = ret.Get(0).(map[kube.ResourceKey]v1alpha1.ResourceNode) 100 } 101 } 102 103 var r1 error 104 if rf, ok := ret.Get(1).(func(string, string) error); ok { 105 r1 = rf(server, namespace) 106 } else { 107 r1 = ret.Error(1) 108 } 109 110 return r0, r1 111 } 112 113 // GetVersionsInfo provides a mock function with given fields: serverURL 114 func (_m *LiveStateCache) GetVersionsInfo(serverURL string) (string, []v1.APIGroup, error) { 115 ret := _m.Called(serverURL) 116 117 var r0 string 118 if rf, ok := ret.Get(0).(func(string) string); ok { 119 r0 = rf(serverURL) 120 } else { 121 r0 = ret.Get(0).(string) 122 } 123 124 var r1 []v1.APIGroup 125 if rf, ok := ret.Get(1).(func(string) []v1.APIGroup); ok { 126 r1 = rf(serverURL) 127 } else { 128 if ret.Get(1) != nil { 129 r1 = ret.Get(1).([]v1.APIGroup) 130 } 131 } 132 133 var r2 error 134 if rf, ok := ret.Get(2).(func(string) error); ok { 135 r2 = rf(serverURL) 136 } else { 137 r2 = ret.Error(2) 138 } 139 140 return r0, r1, r2 141 } 142 143 // Init provides a mock function with given fields: 144 func (_m *LiveStateCache) Init() error { 145 ret := _m.Called() 146 147 var r0 error 148 if rf, ok := ret.Get(0).(func() error); ok { 149 r0 = rf() 150 } else { 151 r0 = ret.Error(0) 152 } 153 154 return r0 155 } 156 157 // IsNamespaced provides a mock function with given fields: server, gk 158 func (_m *LiveStateCache) IsNamespaced(server string, gk schema.GroupKind) (bool, error) { 159 ret := _m.Called(server, gk) 160 161 var r0 bool 162 if rf, ok := ret.Get(0).(func(string, schema.GroupKind) bool); ok { 163 r0 = rf(server, gk) 164 } else { 165 r0 = ret.Get(0).(bool) 166 } 167 168 var r1 error 169 if rf, ok := ret.Get(1).(func(string, schema.GroupKind) error); ok { 170 r1 = rf(server, gk) 171 } else { 172 r1 = ret.Error(1) 173 } 174 175 return r0, r1 176 } 177 178 // IterateHierarchy provides a mock function with given fields: server, key, action 179 func (_m *LiveStateCache) IterateHierarchy(server string, key kube.ResourceKey, action func(v1alpha1.ResourceNode, string)) error { 180 ret := _m.Called(server, key, action) 181 182 var r0 error 183 if rf, ok := ret.Get(0).(func(string, kube.ResourceKey, func(v1alpha1.ResourceNode, string)) error); ok { 184 r0 = rf(server, key, action) 185 } else { 186 r0 = ret.Error(0) 187 } 188 189 return r0 190 } 191 192 // Run provides a mock function with given fields: ctx 193 func (_m *LiveStateCache) Run(ctx context.Context) error { 194 ret := _m.Called(ctx) 195 196 var r0 error 197 if rf, ok := ret.Get(0).(func(context.Context) error); ok { 198 r0 = rf(ctx) 199 } else { 200 r0 = ret.Error(0) 201 } 202 203 return r0 204 }