2025-05-16 20:38:51 +00:00
// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify
2018-12-03 18:27:43 +00:00
package mocks
2019-09-04 17:46:14 +00:00
import (
2025-05-16 20:38:51 +00:00
"context"
2019-12-26 22:08:31 +00:00
2026-02-12 14:29:40 +00:00
"github.com/argoproj/argo-cd/gitops-engine/pkg/cache"
"github.com/argoproj/argo-cd/gitops-engine/pkg/utils/kube"
2025-05-16 20:38:51 +00:00
cache0 "github.com/argoproj/argo-cd/v3/controller/cache"
"github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1"
2019-12-04 23:23:18 +00:00
mock "github.com/stretchr/testify/mock"
2025-05-16 20:38:51 +00:00
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime/schema"
)
2019-09-04 17:46:14 +00:00
2025-05-16 20:38:51 +00:00
// NewLiveStateCache creates a new instance of LiveStateCache. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewLiveStateCache ( t interface {
mock . TestingT
Cleanup ( func ( ) )
} ) * LiveStateCache {
mock := & LiveStateCache { }
mock . Mock . Test ( t )
2019-09-04 17:46:14 +00:00
2025-05-16 20:38:51 +00:00
t . Cleanup ( func ( ) { mock . AssertExpectations ( t ) } )
2019-09-04 17:46:14 +00:00
2025-05-16 20:38:51 +00:00
return mock
}
2018-12-03 18:27:43 +00:00
// LiveStateCache is an autogenerated mock type for the LiveStateCache type
type LiveStateCache struct {
mock . Mock
}
2025-05-15 18:06:03 +00:00
type LiveStateCache_Expecter struct {
mock * mock . Mock
}
func ( _m * LiveStateCache ) EXPECT ( ) * LiveStateCache_Expecter {
return & LiveStateCache_Expecter { mock : & _m . Mock }
}
2025-05-16 20:38:51 +00:00
// GetClusterCache provides a mock function for the type LiveStateCache
func ( _mock * LiveStateCache ) GetClusterCache ( server * v1alpha1 . Cluster ) ( cache . ClusterCache , error ) {
ret := _mock . Called ( server )
2020-05-15 17:01:18 +00:00
2024-05-23 08:15:15 +00:00
if len ( ret ) == 0 {
panic ( "no return value specified for GetClusterCache" )
}
2020-05-15 17:01:18 +00:00
var r0 cache . ClusterCache
2024-05-23 08:15:15 +00:00
var r1 error
2025-05-16 20:38:51 +00:00
if returnFunc , ok := ret . Get ( 0 ) . ( func ( * v1alpha1 . Cluster ) ( cache . ClusterCache , error ) ) ; ok {
return returnFunc ( server )
2024-05-23 08:15:15 +00:00
}
2025-05-16 20:38:51 +00:00
if returnFunc , ok := ret . Get ( 0 ) . ( func ( * v1alpha1 . Cluster ) cache . ClusterCache ) ; ok {
r0 = returnFunc ( server )
2020-05-15 17:01:18 +00:00
} else {
if ret . Get ( 0 ) != nil {
r0 = ret . Get ( 0 ) . ( cache . ClusterCache )
}
}
2025-05-16 20:38:51 +00:00
if returnFunc , ok := ret . Get ( 1 ) . ( func ( * v1alpha1 . Cluster ) error ) ; ok {
r1 = returnFunc ( server )
2020-05-15 17:01:18 +00:00
} else {
r1 = ret . Error ( 1 )
}
return r0 , r1
}
2025-05-15 18:06:03 +00:00
// LiveStateCache_GetClusterCache_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetClusterCache'
type LiveStateCache_GetClusterCache_Call struct {
* mock . Call
}
// GetClusterCache is a helper method to define mock.On call
2025-06-13 19:58:11 +00:00
// - server *v1alpha1.Cluster
2025-05-15 18:06:03 +00:00
func ( _e * LiveStateCache_Expecter ) GetClusterCache ( server interface { } ) * LiveStateCache_GetClusterCache_Call {
return & LiveStateCache_GetClusterCache_Call { Call : _e . mock . On ( "GetClusterCache" , server ) }
}
func ( _c * LiveStateCache_GetClusterCache_Call ) Run ( run func ( server * v1alpha1 . Cluster ) ) * LiveStateCache_GetClusterCache_Call {
_c . Call . Run ( func ( args mock . Arguments ) {
2025-06-13 19:58:11 +00:00
var arg0 * v1alpha1 . Cluster
if args [ 0 ] != nil {
arg0 = args [ 0 ] . ( * v1alpha1 . Cluster )
}
run (
arg0 ,
)
2025-05-15 18:06:03 +00:00
} )
return _c
}
2025-05-16 20:38:51 +00:00
func ( _c * LiveStateCache_GetClusterCache_Call ) Return ( clusterCache cache . ClusterCache , err error ) * LiveStateCache_GetClusterCache_Call {
_c . Call . Return ( clusterCache , err )
2025-05-15 18:06:03 +00:00
return _c
}
2025-05-16 20:38:51 +00:00
func ( _c * LiveStateCache_GetClusterCache_Call ) RunAndReturn ( run func ( server * v1alpha1 . Cluster ) ( cache . ClusterCache , error ) ) * LiveStateCache_GetClusterCache_Call {
2025-05-15 18:06:03 +00:00
_c . Call . Return ( run )
return _c
}
2025-05-16 20:38:51 +00:00
// GetClustersInfo provides a mock function for the type LiveStateCache
func ( _mock * LiveStateCache ) GetClustersInfo ( ) [ ] cache . ClusterInfo {
ret := _mock . Called ( )
2019-12-26 22:08:31 +00:00
2024-05-23 08:15:15 +00:00
if len ( ret ) == 0 {
panic ( "no return value specified for GetClustersInfo" )
}
2020-05-15 17:01:18 +00:00
var r0 [ ] cache . ClusterInfo
2025-05-16 20:38:51 +00:00
if returnFunc , ok := ret . Get ( 0 ) . ( func ( ) [ ] cache . ClusterInfo ) ; ok {
r0 = returnFunc ( )
2019-12-26 22:08:31 +00:00
} else {
if ret . Get ( 0 ) != nil {
2020-05-15 17:01:18 +00:00
r0 = ret . Get ( 0 ) . ( [ ] cache . ClusterInfo )
2019-12-26 22:08:31 +00:00
}
}
return r0
}
2025-05-15 18:06:03 +00:00
// LiveStateCache_GetClustersInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetClustersInfo'
type LiveStateCache_GetClustersInfo_Call struct {
* mock . Call
}
// GetClustersInfo is a helper method to define mock.On call
func ( _e * LiveStateCache_Expecter ) GetClustersInfo ( ) * LiveStateCache_GetClustersInfo_Call {
return & LiveStateCache_GetClustersInfo_Call { Call : _e . mock . On ( "GetClustersInfo" ) }
}
func ( _c * LiveStateCache_GetClustersInfo_Call ) Run ( run func ( ) ) * LiveStateCache_GetClustersInfo_Call {
_c . Call . Run ( func ( args mock . Arguments ) {
run ( )
} )
return _c
}
2025-05-16 20:38:51 +00:00
func ( _c * LiveStateCache_GetClustersInfo_Call ) Return ( clusterInfos [ ] cache . ClusterInfo ) * LiveStateCache_GetClustersInfo_Call {
_c . Call . Return ( clusterInfos )
2025-05-15 18:06:03 +00:00
return _c
}
func ( _c * LiveStateCache_GetClustersInfo_Call ) RunAndReturn ( run func ( ) [ ] cache . ClusterInfo ) * LiveStateCache_GetClustersInfo_Call {
_c . Call . Return ( run )
return _c
}
2025-05-16 20:38:51 +00:00
// GetManagedLiveObjs provides a mock function for the type LiveStateCache
func ( _mock * LiveStateCache ) GetManagedLiveObjs ( destCluster * v1alpha1 . Cluster , a * v1alpha1 . Application , targetObjs [ ] * unstructured . Unstructured ) ( map [ kube . ResourceKey ] * unstructured . Unstructured , error ) {
ret := _mock . Called ( destCluster , a , targetObjs )
2018-12-03 18:27:43 +00:00
2024-05-23 08:15:15 +00:00
if len ( ret ) == 0 {
panic ( "no return value specified for GetManagedLiveObjs" )
}
2018-12-03 18:27:43 +00:00
var r0 map [ kube . ResourceKey ] * unstructured . Unstructured
2024-05-23 08:15:15 +00:00
var r1 error
2025-05-16 20:38:51 +00:00
if returnFunc , ok := ret . Get ( 0 ) . ( func ( * v1alpha1 . Cluster , * v1alpha1 . Application , [ ] * unstructured . Unstructured ) ( map [ kube . ResourceKey ] * unstructured . Unstructured , error ) ) ; ok {
return returnFunc ( destCluster , a , targetObjs )
2024-05-23 08:15:15 +00:00
}
2025-05-16 20:38:51 +00:00
if returnFunc , ok := ret . Get ( 0 ) . ( func ( * v1alpha1 . Cluster , * v1alpha1 . Application , [ ] * unstructured . Unstructured ) map [ kube . ResourceKey ] * unstructured . Unstructured ) ; ok {
r0 = returnFunc ( destCluster , a , targetObjs )
2018-12-03 18:27:43 +00:00
} else {
if ret . Get ( 0 ) != nil {
r0 = ret . Get ( 0 ) . ( map [ kube . ResourceKey ] * unstructured . Unstructured )
}
}
2025-05-16 20:38:51 +00:00
if returnFunc , ok := ret . Get ( 1 ) . ( func ( * v1alpha1 . Cluster , * v1alpha1 . Application , [ ] * unstructured . Unstructured ) error ) ; ok {
r1 = returnFunc ( destCluster , a , targetObjs )
2018-12-03 18:27:43 +00:00
} else {
r1 = ret . Error ( 1 )
}
return r0 , r1
}
2025-05-15 18:06:03 +00:00
// LiveStateCache_GetManagedLiveObjs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetManagedLiveObjs'
type LiveStateCache_GetManagedLiveObjs_Call struct {
* mock . Call
}
// GetManagedLiveObjs is a helper method to define mock.On call
2025-06-13 19:58:11 +00:00
// - destCluster *v1alpha1.Cluster
// - a *v1alpha1.Application
// - targetObjs []*unstructured.Unstructured
2025-05-15 18:06:03 +00:00
func ( _e * LiveStateCache_Expecter ) GetManagedLiveObjs ( destCluster interface { } , a interface { } , targetObjs interface { } ) * LiveStateCache_GetManagedLiveObjs_Call {
return & LiveStateCache_GetManagedLiveObjs_Call { Call : _e . mock . On ( "GetManagedLiveObjs" , destCluster , a , targetObjs ) }
}
func ( _c * LiveStateCache_GetManagedLiveObjs_Call ) Run ( run func ( destCluster * v1alpha1 . Cluster , a * v1alpha1 . Application , targetObjs [ ] * unstructured . Unstructured ) ) * LiveStateCache_GetManagedLiveObjs_Call {
_c . Call . Run ( func ( args mock . Arguments ) {
2025-06-13 19:58:11 +00:00
var arg0 * v1alpha1 . Cluster
if args [ 0 ] != nil {
arg0 = args [ 0 ] . ( * v1alpha1 . Cluster )
}
var arg1 * v1alpha1 . Application
if args [ 1 ] != nil {
arg1 = args [ 1 ] . ( * v1alpha1 . Application )
}
var arg2 [ ] * unstructured . Unstructured
if args [ 2 ] != nil {
arg2 = args [ 2 ] . ( [ ] * unstructured . Unstructured )
}
run (
arg0 ,
arg1 ,
arg2 ,
)
2025-05-15 18:06:03 +00:00
} )
return _c
}
2025-05-16 20:38:51 +00:00
func ( _c * LiveStateCache_GetManagedLiveObjs_Call ) Return ( resourceKeyToUnstructured map [ kube . ResourceKey ] * unstructured . Unstructured , err error ) * LiveStateCache_GetManagedLiveObjs_Call {
_c . Call . Return ( resourceKeyToUnstructured , err )
2025-05-15 18:06:03 +00:00
return _c
}
2025-05-16 20:38:51 +00:00
func ( _c * LiveStateCache_GetManagedLiveObjs_Call ) RunAndReturn ( run func ( destCluster * v1alpha1 . Cluster , a * v1alpha1 . Application , targetObjs [ ] * unstructured . Unstructured ) ( map [ kube . ResourceKey ] * unstructured . Unstructured , error ) ) * LiveStateCache_GetManagedLiveObjs_Call {
2025-05-15 18:06:03 +00:00
_c . Call . Return ( run )
return _c
}
2025-05-16 20:38:51 +00:00
// GetNamespaceTopLevelResources provides a mock function for the type LiveStateCache
func ( _mock * LiveStateCache ) GetNamespaceTopLevelResources ( server * v1alpha1 . Cluster , namespace string ) ( map [ kube . ResourceKey ] v1alpha1 . ResourceNode , error ) {
ret := _mock . Called ( server , namespace )
2019-08-19 15:14:48 +00:00
2024-05-23 08:15:15 +00:00
if len ( ret ) == 0 {
panic ( "no return value specified for GetNamespaceTopLevelResources" )
}
2019-08-19 15:14:48 +00:00
var r0 map [ kube . ResourceKey ] v1alpha1 . ResourceNode
2024-05-23 08:15:15 +00:00
var r1 error
2025-05-16 20:38:51 +00:00
if returnFunc , ok := ret . Get ( 0 ) . ( func ( * v1alpha1 . Cluster , string ) ( map [ kube . ResourceKey ] v1alpha1 . ResourceNode , error ) ) ; ok {
return returnFunc ( server , namespace )
2024-05-23 08:15:15 +00:00
}
2025-05-16 20:38:51 +00:00
if returnFunc , ok := ret . Get ( 0 ) . ( func ( * v1alpha1 . Cluster , string ) map [ kube . ResourceKey ] v1alpha1 . ResourceNode ) ; ok {
r0 = returnFunc ( server , namespace )
2019-08-19 15:14:48 +00:00
} else {
if ret . Get ( 0 ) != nil {
r0 = ret . Get ( 0 ) . ( map [ kube . ResourceKey ] v1alpha1 . ResourceNode )
}
}
2025-05-16 20:38:51 +00:00
if returnFunc , ok := ret . Get ( 1 ) . ( func ( * v1alpha1 . Cluster , string ) error ) ; ok {
r1 = returnFunc ( server , namespace )
2019-08-19 15:14:48 +00:00
} else {
r1 = ret . Error ( 1 )
}
return r0 , r1
}
2025-05-15 18:06:03 +00:00
// LiveStateCache_GetNamespaceTopLevelResources_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetNamespaceTopLevelResources'
type LiveStateCache_GetNamespaceTopLevelResources_Call struct {
* mock . Call
}
// GetNamespaceTopLevelResources is a helper method to define mock.On call
2025-06-13 19:58:11 +00:00
// - server *v1alpha1.Cluster
// - namespace string
2025-05-15 18:06:03 +00:00
func ( _e * LiveStateCache_Expecter ) GetNamespaceTopLevelResources ( server interface { } , namespace interface { } ) * LiveStateCache_GetNamespaceTopLevelResources_Call {
return & LiveStateCache_GetNamespaceTopLevelResources_Call { Call : _e . mock . On ( "GetNamespaceTopLevelResources" , server , namespace ) }
}
func ( _c * LiveStateCache_GetNamespaceTopLevelResources_Call ) Run ( run func ( server * v1alpha1 . Cluster , namespace string ) ) * LiveStateCache_GetNamespaceTopLevelResources_Call {
_c . Call . Run ( func ( args mock . Arguments ) {
2025-06-13 19:58:11 +00:00
var arg0 * v1alpha1 . Cluster
if args [ 0 ] != nil {
arg0 = args [ 0 ] . ( * v1alpha1 . Cluster )
}
var arg1 string
if args [ 1 ] != nil {
arg1 = args [ 1 ] . ( string )
}
run (
arg0 ,
arg1 ,
)
2025-05-15 18:06:03 +00:00
} )
return _c
}
2025-05-16 20:38:51 +00:00
func ( _c * LiveStateCache_GetNamespaceTopLevelResources_Call ) Return ( resourceKeyToResourceNode map [ kube . ResourceKey ] v1alpha1 . ResourceNode , err error ) * LiveStateCache_GetNamespaceTopLevelResources_Call {
_c . Call . Return ( resourceKeyToResourceNode , err )
2025-05-15 18:06:03 +00:00
return _c
}
2025-05-16 20:38:51 +00:00
func ( _c * LiveStateCache_GetNamespaceTopLevelResources_Call ) RunAndReturn ( run func ( server * v1alpha1 . Cluster , namespace string ) ( map [ kube . ResourceKey ] v1alpha1 . ResourceNode , error ) ) * LiveStateCache_GetNamespaceTopLevelResources_Call {
2025-05-15 18:06:03 +00:00
_c . Call . Return ( run )
return _c
}
2025-05-16 20:38:51 +00:00
// GetVersionsInfo provides a mock function for the type LiveStateCache
func ( _mock * LiveStateCache ) GetVersionsInfo ( server * v1alpha1 . Cluster ) ( string , [ ] kube . APIResourceInfo , error ) {
ret := _mock . Called ( server )
2019-12-04 23:23:18 +00:00
2024-05-23 08:15:15 +00:00
if len ( ret ) == 0 {
panic ( "no return value specified for GetVersionsInfo" )
}
2019-12-04 23:23:18 +00:00
var r0 string
2024-05-23 08:15:15 +00:00
var r1 [ ] kube . APIResourceInfo
var r2 error
2025-05-16 20:38:51 +00:00
if returnFunc , ok := ret . Get ( 0 ) . ( func ( * v1alpha1 . Cluster ) ( string , [ ] kube . APIResourceInfo , error ) ) ; ok {
return returnFunc ( server )
2024-05-23 08:15:15 +00:00
}
2025-05-16 20:38:51 +00:00
if returnFunc , ok := ret . Get ( 0 ) . ( func ( * v1alpha1 . Cluster ) string ) ; ok {
r0 = returnFunc ( server )
2019-12-04 23:23:18 +00:00
} else {
r0 = ret . Get ( 0 ) . ( string )
}
2025-05-16 20:38:51 +00:00
if returnFunc , ok := ret . Get ( 1 ) . ( func ( * v1alpha1 . Cluster ) [ ] kube . APIResourceInfo ) ; ok {
r1 = returnFunc ( server )
2019-12-04 23:23:18 +00:00
} else {
2020-03-17 21:20:36 +00:00
if ret . Get ( 1 ) != nil {
2021-10-25 23:52:19 +00:00
r1 = ret . Get ( 1 ) . ( [ ] kube . APIResourceInfo )
2020-03-17 21:20:36 +00:00
}
2019-12-04 23:23:18 +00:00
}
2025-05-16 20:38:51 +00:00
if returnFunc , ok := ret . Get ( 2 ) . ( func ( * v1alpha1 . Cluster ) error ) ; ok {
r2 = returnFunc ( server )
2020-03-17 21:20:36 +00:00
} else {
r2 = ret . Error ( 2 )
}
return r0 , r1 , r2
2019-12-04 23:23:18 +00:00
}
2025-05-15 18:06:03 +00:00
// LiveStateCache_GetVersionsInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetVersionsInfo'
type LiveStateCache_GetVersionsInfo_Call struct {
* mock . Call
}
// GetVersionsInfo is a helper method to define mock.On call
2025-06-13 19:58:11 +00:00
// - server *v1alpha1.Cluster
2025-05-15 18:06:03 +00:00
func ( _e * LiveStateCache_Expecter ) GetVersionsInfo ( server interface { } ) * LiveStateCache_GetVersionsInfo_Call {
return & LiveStateCache_GetVersionsInfo_Call { Call : _e . mock . On ( "GetVersionsInfo" , server ) }
}
func ( _c * LiveStateCache_GetVersionsInfo_Call ) Run ( run func ( server * v1alpha1 . Cluster ) ) * LiveStateCache_GetVersionsInfo_Call {
_c . Call . Run ( func ( args mock . Arguments ) {
2025-06-13 19:58:11 +00:00
var arg0 * v1alpha1 . Cluster
if args [ 0 ] != nil {
arg0 = args [ 0 ] . ( * v1alpha1 . Cluster )
}
run (
arg0 ,
)
2025-05-15 18:06:03 +00:00
} )
return _c
}
2025-05-16 20:38:51 +00:00
func ( _c * LiveStateCache_GetVersionsInfo_Call ) Return ( s string , aPIResourceInfos [ ] kube . APIResourceInfo , err error ) * LiveStateCache_GetVersionsInfo_Call {
_c . Call . Return ( s , aPIResourceInfos , err )
2025-05-15 18:06:03 +00:00
return _c
}
2025-05-16 20:38:51 +00:00
func ( _c * LiveStateCache_GetVersionsInfo_Call ) RunAndReturn ( run func ( server * v1alpha1 . Cluster ) ( string , [ ] kube . APIResourceInfo , error ) ) * LiveStateCache_GetVersionsInfo_Call {
2025-05-15 18:06:03 +00:00
_c . Call . Return ( run )
return _c
}
2025-05-16 20:38:51 +00:00
// Init provides a mock function for the type LiveStateCache
func ( _mock * LiveStateCache ) Init ( ) error {
ret := _mock . Called ( )
2020-06-12 22:05:01 +00:00
2024-05-23 08:15:15 +00:00
if len ( ret ) == 0 {
panic ( "no return value specified for Init" )
}
2020-06-12 22:05:01 +00:00
var r0 error
2025-05-16 20:38:51 +00:00
if returnFunc , ok := ret . Get ( 0 ) . ( func ( ) error ) ; ok {
r0 = returnFunc ( )
2020-06-12 22:05:01 +00:00
} else {
r0 = ret . Error ( 0 )
}
return r0
}
2025-05-15 18:06:03 +00:00
// LiveStateCache_Init_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Init'
type LiveStateCache_Init_Call struct {
* mock . Call
}
// Init is a helper method to define mock.On call
func ( _e * LiveStateCache_Expecter ) Init ( ) * LiveStateCache_Init_Call {
return & LiveStateCache_Init_Call { Call : _e . mock . On ( "Init" ) }
}
func ( _c * LiveStateCache_Init_Call ) Run ( run func ( ) ) * LiveStateCache_Init_Call {
_c . Call . Run ( func ( args mock . Arguments ) {
run ( )
} )
return _c
}
2025-05-16 20:38:51 +00:00
func ( _c * LiveStateCache_Init_Call ) Return ( err error ) * LiveStateCache_Init_Call {
_c . Call . Return ( err )
2025-05-15 18:06:03 +00:00
return _c
}
func ( _c * LiveStateCache_Init_Call ) RunAndReturn ( run func ( ) error ) * LiveStateCache_Init_Call {
_c . Call . Return ( run )
return _c
}
2025-05-16 20:38:51 +00:00
// IsNamespaced provides a mock function for the type LiveStateCache
func ( _mock * LiveStateCache ) IsNamespaced ( server * v1alpha1 . Cluster , gk schema . GroupKind ) ( bool , error ) {
ret := _mock . Called ( server , gk )
2018-12-03 18:27:43 +00:00
2024-05-23 08:15:15 +00:00
if len ( ret ) == 0 {
panic ( "no return value specified for IsNamespaced" )
}
2018-12-03 18:27:43 +00:00
var r0 bool
2024-05-23 08:15:15 +00:00
var r1 error
2025-05-16 20:38:51 +00:00
if returnFunc , ok := ret . Get ( 0 ) . ( func ( * v1alpha1 . Cluster , schema . GroupKind ) ( bool , error ) ) ; ok {
return returnFunc ( server , gk )
2024-05-23 08:15:15 +00:00
}
2025-05-16 20:38:51 +00:00
if returnFunc , ok := ret . Get ( 0 ) . ( func ( * v1alpha1 . Cluster , schema . GroupKind ) bool ) ; ok {
r0 = returnFunc ( server , gk )
2018-12-03 18:27:43 +00:00
} else {
r0 = ret . Get ( 0 ) . ( bool )
}
2025-05-16 20:38:51 +00:00
if returnFunc , ok := ret . Get ( 1 ) . ( func ( * v1alpha1 . Cluster , schema . GroupKind ) error ) ; ok {
r1 = returnFunc ( server , gk )
2018-12-03 18:27:43 +00:00
} else {
r1 = ret . Error ( 1 )
}
return r0 , r1
}
2025-05-15 18:06:03 +00:00
// LiveStateCache_IsNamespaced_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsNamespaced'
type LiveStateCache_IsNamespaced_Call struct {
* mock . Call
}
// IsNamespaced is a helper method to define mock.On call
2025-06-13 19:58:11 +00:00
// - server *v1alpha1.Cluster
// - gk schema.GroupKind
2025-05-15 18:06:03 +00:00
func ( _e * LiveStateCache_Expecter ) IsNamespaced ( server interface { } , gk interface { } ) * LiveStateCache_IsNamespaced_Call {
return & LiveStateCache_IsNamespaced_Call { Call : _e . mock . On ( "IsNamespaced" , server , gk ) }
}
func ( _c * LiveStateCache_IsNamespaced_Call ) Run ( run func ( server * v1alpha1 . Cluster , gk schema . GroupKind ) ) * LiveStateCache_IsNamespaced_Call {
_c . Call . Run ( func ( args mock . Arguments ) {
2025-06-13 19:58:11 +00:00
var arg0 * v1alpha1 . Cluster
if args [ 0 ] != nil {
arg0 = args [ 0 ] . ( * v1alpha1 . Cluster )
}
var arg1 schema . GroupKind
if args [ 1 ] != nil {
arg1 = args [ 1 ] . ( schema . GroupKind )
}
run (
arg0 ,
arg1 ,
)
2025-05-15 18:06:03 +00:00
} )
return _c
}
2025-05-16 20:38:51 +00:00
func ( _c * LiveStateCache_IsNamespaced_Call ) Return ( b bool , err error ) * LiveStateCache_IsNamespaced_Call {
_c . Call . Return ( b , err )
2025-05-15 18:06:03 +00:00
return _c
}
2025-05-16 20:38:51 +00:00
func ( _c * LiveStateCache_IsNamespaced_Call ) RunAndReturn ( run func ( server * v1alpha1 . Cluster , gk schema . GroupKind ) ( bool , error ) ) * LiveStateCache_IsNamespaced_Call {
2025-05-15 18:06:03 +00:00
_c . Call . Return ( run )
return _c
}
2025-05-16 20:38:51 +00:00
// IterateHierarchyV2 provides a mock function for the type LiveStateCache
func ( _mock * LiveStateCache ) IterateHierarchyV2 ( server * v1alpha1 . Cluster , keys [ ] kube . ResourceKey , action func ( child v1alpha1 . ResourceNode , appName string ) bool ) error {
ret := _mock . Called ( server , keys , action )
2024-07-19 15:37:13 +00:00
if len ( ret ) == 0 {
panic ( "no return value specified for IterateHierarchyV2" )
}
var r0 error
2025-05-16 20:38:51 +00:00
if returnFunc , ok := ret . Get ( 0 ) . ( func ( * v1alpha1 . Cluster , [ ] kube . ResourceKey , func ( child v1alpha1 . ResourceNode , appName string ) bool ) error ) ; ok {
r0 = returnFunc ( server , keys , action )
2024-07-19 15:37:13 +00:00
} else {
r0 = ret . Error ( 0 )
}
return r0
}
2025-05-15 18:06:03 +00:00
// LiveStateCache_IterateHierarchyV2_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IterateHierarchyV2'
type LiveStateCache_IterateHierarchyV2_Call struct {
* mock . Call
}
// IterateHierarchyV2 is a helper method to define mock.On call
2025-06-13 19:58:11 +00:00
// - server *v1alpha1.Cluster
// - keys []kube.ResourceKey
// - action func(child v1alpha1.ResourceNode, appName string) bool
2025-05-15 18:06:03 +00:00
func ( _e * LiveStateCache_Expecter ) IterateHierarchyV2 ( server interface { } , keys interface { } , action interface { } ) * LiveStateCache_IterateHierarchyV2_Call {
return & LiveStateCache_IterateHierarchyV2_Call { Call : _e . mock . On ( "IterateHierarchyV2" , server , keys , action ) }
}
2025-05-16 20:38:51 +00:00
func ( _c * LiveStateCache_IterateHierarchyV2_Call ) Run ( run func ( server * v1alpha1 . Cluster , keys [ ] kube . ResourceKey , action func ( child v1alpha1 . ResourceNode , appName string ) bool ) ) * LiveStateCache_IterateHierarchyV2_Call {
2025-05-15 18:06:03 +00:00
_c . Call . Run ( func ( args mock . Arguments ) {
2025-06-13 19:58:11 +00:00
var arg0 * v1alpha1 . Cluster
if args [ 0 ] != nil {
arg0 = args [ 0 ] . ( * v1alpha1 . Cluster )
}
var arg1 [ ] kube . ResourceKey
if args [ 1 ] != nil {
arg1 = args [ 1 ] . ( [ ] kube . ResourceKey )
}
var arg2 func ( child v1alpha1 . ResourceNode , appName string ) bool
if args [ 2 ] != nil {
arg2 = args [ 2 ] . ( func ( child v1alpha1 . ResourceNode , appName string ) bool )
}
run (
arg0 ,
arg1 ,
arg2 ,
)
2025-05-15 18:06:03 +00:00
} )
return _c
}
2025-05-16 20:38:51 +00:00
func ( _c * LiveStateCache_IterateHierarchyV2_Call ) Return ( err error ) * LiveStateCache_IterateHierarchyV2_Call {
_c . Call . Return ( err )
2025-05-15 18:06:03 +00:00
return _c
}
2025-05-16 20:38:51 +00:00
func ( _c * LiveStateCache_IterateHierarchyV2_Call ) RunAndReturn ( run func ( server * v1alpha1 . Cluster , keys [ ] kube . ResourceKey , action func ( child v1alpha1 . ResourceNode , appName string ) bool ) error ) * LiveStateCache_IterateHierarchyV2_Call {
2025-05-15 18:06:03 +00:00
_c . Call . Return ( run )
return _c
}
2025-05-16 20:38:51 +00:00
// IterateResources provides a mock function for the type LiveStateCache
func ( _mock * LiveStateCache ) IterateResources ( server * v1alpha1 . Cluster , callback func ( res * cache . Resource , info * cache0 . ResourceInfo ) ) error {
ret := _mock . Called ( server , callback )
2021-01-11 20:35:47 +00:00
2024-05-23 08:15:15 +00:00
if len ( ret ) == 0 {
panic ( "no return value specified for IterateResources" )
}
2021-01-11 20:35:47 +00:00
var r0 error
2025-05-16 20:38:51 +00:00
if returnFunc , ok := ret . Get ( 0 ) . ( func ( * v1alpha1 . Cluster , func ( res * cache . Resource , info * cache0 . ResourceInfo ) ) error ) ; ok {
r0 = returnFunc ( server , callback )
2021-01-11 20:35:47 +00:00
} else {
r0 = ret . Error ( 0 )
}
return r0
}
2025-05-15 18:06:03 +00:00
// LiveStateCache_IterateResources_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IterateResources'
type LiveStateCache_IterateResources_Call struct {
* mock . Call
}
// IterateResources is a helper method to define mock.On call
2025-06-13 19:58:11 +00:00
// - server *v1alpha1.Cluster
// - callback func(res *cache.Resource, info *cache0.ResourceInfo)
2025-05-15 18:06:03 +00:00
func ( _e * LiveStateCache_Expecter ) IterateResources ( server interface { } , callback interface { } ) * LiveStateCache_IterateResources_Call {
return & LiveStateCache_IterateResources_Call { Call : _e . mock . On ( "IterateResources" , server , callback ) }
}
2025-05-16 20:38:51 +00:00
func ( _c * LiveStateCache_IterateResources_Call ) Run ( run func ( server * v1alpha1 . Cluster , callback func ( res * cache . Resource , info * cache0 . ResourceInfo ) ) ) * LiveStateCache_IterateResources_Call {
2025-05-15 18:06:03 +00:00
_c . Call . Run ( func ( args mock . Arguments ) {
2025-06-13 19:58:11 +00:00
var arg0 * v1alpha1 . Cluster
if args [ 0 ] != nil {
arg0 = args [ 0 ] . ( * v1alpha1 . Cluster )
}
var arg1 func ( res * cache . Resource , info * cache0 . ResourceInfo )
if args [ 1 ] != nil {
arg1 = args [ 1 ] . ( func ( res * cache . Resource , info * cache0 . ResourceInfo ) )
}
run (
arg0 ,
arg1 ,
)
2025-05-15 18:06:03 +00:00
} )
return _c
}
2025-05-16 20:38:51 +00:00
func ( _c * LiveStateCache_IterateResources_Call ) Return ( err error ) * LiveStateCache_IterateResources_Call {
_c . Call . Return ( err )
2025-05-15 18:06:03 +00:00
return _c
}
2025-05-16 20:38:51 +00:00
func ( _c * LiveStateCache_IterateResources_Call ) RunAndReturn ( run func ( server * v1alpha1 . Cluster , callback func ( res * cache . Resource , info * cache0 . ResourceInfo ) ) error ) * LiveStateCache_IterateResources_Call {
2025-05-15 18:06:03 +00:00
_c . Call . Return ( run )
return _c
}
2025-05-16 20:38:51 +00:00
// Run provides a mock function for the type LiveStateCache
func ( _mock * LiveStateCache ) Run ( ctx context . Context ) error {
ret := _mock . Called ( ctx )
2019-06-21 22:59:05 +00:00
2024-05-23 08:15:15 +00:00
if len ( ret ) == 0 {
panic ( "no return value specified for Run" )
}
2019-06-21 22:59:05 +00:00
var r0 error
2025-05-16 20:38:51 +00:00
if returnFunc , ok := ret . Get ( 0 ) . ( func ( context . Context ) error ) ; ok {
r0 = returnFunc ( ctx )
2019-06-21 22:59:05 +00:00
} else {
r0 = ret . Error ( 0 )
}
return r0
2018-12-03 18:27:43 +00:00
}
2024-05-23 08:15:15 +00:00
2025-05-15 18:06:03 +00:00
// LiveStateCache_Run_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Run'
type LiveStateCache_Run_Call struct {
* mock . Call
}
// Run is a helper method to define mock.On call
2025-06-13 19:58:11 +00:00
// - ctx context.Context
2025-05-15 18:06:03 +00:00
func ( _e * LiveStateCache_Expecter ) Run ( ctx interface { } ) * LiveStateCache_Run_Call {
return & LiveStateCache_Run_Call { Call : _e . mock . On ( "Run" , ctx ) }
}
func ( _c * LiveStateCache_Run_Call ) Run ( run func ( ctx context . Context ) ) * LiveStateCache_Run_Call {
_c . Call . Run ( func ( args mock . Arguments ) {
2025-06-13 19:58:11 +00:00
var arg0 context . Context
if args [ 0 ] != nil {
arg0 = args [ 0 ] . ( context . Context )
}
run (
arg0 ,
)
2025-05-15 18:06:03 +00:00
} )
return _c
}
2025-05-16 20:38:51 +00:00
func ( _c * LiveStateCache_Run_Call ) Return ( err error ) * LiveStateCache_Run_Call {
_c . Call . Return ( err )
2025-05-15 18:06:03 +00:00
return _c
}
2025-05-16 20:38:51 +00:00
func ( _c * LiveStateCache_Run_Call ) RunAndReturn ( run func ( ctx context . Context ) error ) * LiveStateCache_Run_Call {
2025-05-15 18:06:03 +00:00
_c . Call . Return ( run )
return _c
}
2025-05-16 20:38:51 +00:00
// UpdateShard provides a mock function for the type LiveStateCache
func ( _mock * LiveStateCache ) UpdateShard ( shard int ) bool {
ret := _mock . Called ( shard )
2025-02-10 03:25:34 +00:00
if len ( ret ) == 0 {
panic ( "no return value specified for UpdateShard" )
}
var r0 bool
2025-05-16 20:38:51 +00:00
if returnFunc , ok := ret . Get ( 0 ) . ( func ( int ) bool ) ; ok {
r0 = returnFunc ( shard )
2025-02-10 03:25:34 +00:00
} else {
r0 = ret . Get ( 0 ) . ( bool )
}
return r0
}
2025-05-15 18:06:03 +00:00
// LiveStateCache_UpdateShard_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateShard'
type LiveStateCache_UpdateShard_Call struct {
* mock . Call
}
// UpdateShard is a helper method to define mock.On call
2025-06-13 19:58:11 +00:00
// - shard int
2025-05-15 18:06:03 +00:00
func ( _e * LiveStateCache_Expecter ) UpdateShard ( shard interface { } ) * LiveStateCache_UpdateShard_Call {
return & LiveStateCache_UpdateShard_Call { Call : _e . mock . On ( "UpdateShard" , shard ) }
}
func ( _c * LiveStateCache_UpdateShard_Call ) Run ( run func ( shard int ) ) * LiveStateCache_UpdateShard_Call {
_c . Call . Run ( func ( args mock . Arguments ) {
2025-06-13 19:58:11 +00:00
var arg0 int
if args [ 0 ] != nil {
arg0 = args [ 0 ] . ( int )
}
run (
arg0 ,
)
2025-05-15 18:06:03 +00:00
} )
return _c
}
2025-05-16 20:38:51 +00:00
func ( _c * LiveStateCache_UpdateShard_Call ) Return ( b bool ) * LiveStateCache_UpdateShard_Call {
_c . Call . Return ( b )
2025-05-15 18:06:03 +00:00
return _c
}
2025-05-16 20:38:51 +00:00
func ( _c * LiveStateCache_UpdateShard_Call ) RunAndReturn ( run func ( shard int ) bool ) * LiveStateCache_UpdateShard_Call {
2025-05-15 18:06:03 +00:00
_c . Call . Return ( run )
return _c
}