From e279463d022e395492d29bbf7fb172fe4bb0393d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petar=20Cvitanovi=C4=87?= <72022639+petar-cvit@users.noreply.github.com> Date: Thu, 10 Oct 2024 13:28:17 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=AD=20k8s=20client=20mock=20(#623)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * remove unused merthods * k8s client mock --- cyclops-ctrl/.gitignore | 2 + cyclops-ctrl/.mockery.yaml | 13 + cyclops-ctrl/Makefile | 10 + cyclops-ctrl/go.mod | 5 +- cyclops-ctrl/go.sum | 1 + cyclops-ctrl/internal/controller/cluster.go | 4 +- cyclops-ctrl/internal/controller/modules.go | 4 +- .../internal/controller/sse/server.go | 4 +- cyclops-ctrl/internal/controller/templates.go | 4 +- cyclops-ctrl/internal/handler/handler.go | 4 +- .../modulecontroller/module_controller.go | 6 +- .../internal/template/render/render.go | 4 +- cyclops-ctrl/pkg/cluster/k8sclient/client.go | 49 + .../pkg/cluster/k8sclient/resources.go | 5 +- cyclops-ctrl/pkg/mocks/IKubernetesClient.go | 2056 +++++++++++++++++ 15 files changed, 2153 insertions(+), 18 deletions(-) create mode 100644 cyclops-ctrl/.mockery.yaml create mode 100644 cyclops-ctrl/pkg/mocks/IKubernetesClient.go diff --git a/cyclops-ctrl/.gitignore b/cyclops-ctrl/.gitignore index ba077a40..94040519 100644 --- a/cyclops-ctrl/.gitignore +++ b/cyclops-ctrl/.gitignore @@ -1 +1,3 @@ bin +cover.out +cover.html diff --git a/cyclops-ctrl/.mockery.yaml b/cyclops-ctrl/.mockery.yaml new file mode 100644 index 00000000..4e2015c5 --- /dev/null +++ b/cyclops-ctrl/.mockery.yaml @@ -0,0 +1,13 @@ +quiet: False +disable-version-string: True +with-expecter: True +mockname: "{{.InterfaceName}}" +filename: "{{.MockName}}.go" +outpkg: mocks +dir: mocks +packages: + github.com/cyclops-ui/cyclops/cyclops-ctrl/pkg/cluster/k8sclient: + interfaces: + IKubernetesClient: + config: + dir: pkg/mocks diff --git a/cyclops-ctrl/Makefile b/cyclops-ctrl/Makefile index 5082d7fc..f261fdd2 100644 --- a/cyclops-ctrl/Makefile +++ b/cyclops-ctrl/Makefile @@ -166,3 +166,13 @@ group-imports: unit-test: go test -v -tags musl,dynamic ./... + +coverage: + go test -v -coverprofile cover.out ./... + go tool cover -html cover.out -o cover.html + open cover.html + +mockery: + GOBIN=$(LOCALBIN) go install github.com/vektra/mockery/v2@latest + ./bin/mockery + diff --git a/cyclops-ctrl/go.mod b/cyclops-ctrl/go.mod index 7d15f2dd..d814e8b8 100644 --- a/cyclops-ctrl/go.mod +++ b/cyclops-ctrl/go.mod @@ -19,6 +19,7 @@ require ( github.com/pkg/errors v0.9.1 github.com/posthog/posthog-go v0.0.0-20240315130956-036dfa9f3555 github.com/prometheus/client_golang v1.16.0 + github.com/stretchr/testify v1.8.4 gopkg.in/yaml.v2 v2.4.0 gopkg.in/yaml.v3 v3.0.1 helm.sh/helm/v3 v3.15.3 @@ -27,6 +28,7 @@ require ( k8s.io/apimachinery v0.30.1 k8s.io/client-go v0.30.1 sigs.k8s.io/controller-runtime v0.18.4 + sigs.k8s.io/yaml v1.4.0 ) require ( @@ -104,6 +106,7 @@ require ( github.com/opencontainers/image-spec v1.1.0-rc6 // indirect github.com/pelletier/go-toml/v2 v2.0.8 // indirect github.com/pjbgf/sha1cd v0.3.0 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_model v0.4.0 // indirect github.com/prometheus/common v0.44.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect @@ -113,6 +116,7 @@ require ( github.com/skeema/knownhosts v1.2.1 // indirect github.com/spf13/cast v1.5.0 // indirect github.com/spf13/pflag v1.0.5 // indirect + github.com/stretchr/objx v0.5.0 // indirect github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/ugorji/go/codec v1.2.11 // indirect github.com/xanzy/ssh-agent v0.3.3 // indirect @@ -151,5 +155,4 @@ require ( oras.land/oras-go v1.2.5 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect - sigs.k8s.io/yaml v1.4.0 // indirect ) diff --git a/cyclops-ctrl/go.sum b/cyclops-ctrl/go.sum index 7cce19f6..c9320104 100644 --- a/cyclops-ctrl/go.sum +++ b/cyclops-ctrl/go.sum @@ -327,6 +327,7 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= diff --git a/cyclops-ctrl/internal/controller/cluster.go b/cyclops-ctrl/internal/controller/cluster.go index 8b80317f..460960b2 100644 --- a/cyclops-ctrl/internal/controller/cluster.go +++ b/cyclops-ctrl/internal/controller/cluster.go @@ -13,10 +13,10 @@ import ( ) type Cluster struct { - kubernetesClient *k8sclient.KubernetesClient + kubernetesClient k8sclient.IKubernetesClient } -func NewClusterController(kubernetes *k8sclient.KubernetesClient) *Cluster { +func NewClusterController(kubernetes k8sclient.IKubernetesClient) *Cluster { return &Cluster{ kubernetesClient: kubernetes, } diff --git a/cyclops-ctrl/internal/controller/modules.go b/cyclops-ctrl/internal/controller/modules.go index dc23debe..47218635 100644 --- a/cyclops-ctrl/internal/controller/modules.go +++ b/cyclops-ctrl/internal/controller/modules.go @@ -24,7 +24,7 @@ import ( ) type Modules struct { - kubernetesClient *k8sclient.KubernetesClient + kubernetesClient k8sclient.IKubernetesClient templatesRepo *template.Repo renderer *render.Renderer telemetryClient telemetry.Client @@ -33,7 +33,7 @@ type Modules struct { func NewModulesController( templatesRepo *template.Repo, - kubernetes *k8sclient.KubernetesClient, + kubernetes k8sclient.IKubernetesClient, renderer *render.Renderer, telemetryClient telemetry.Client, monitor prometheus.Monitor, diff --git a/cyclops-ctrl/internal/controller/sse/server.go b/cyclops-ctrl/internal/controller/sse/server.go index ca9ee71d..efe63612 100644 --- a/cyclops-ctrl/internal/controller/sse/server.go +++ b/cyclops-ctrl/internal/controller/sse/server.go @@ -7,11 +7,11 @@ import ( ) type Server struct { - k8sClient *k8sclient.KubernetesClient + k8sClient k8sclient.IKubernetesClient } // Initialize event and Start procnteessing requests -func NewServer(k8sClient *k8sclient.KubernetesClient) *Server { +func NewServer(k8sClient k8sclient.IKubernetesClient) *Server { server := &Server{ k8sClient: k8sClient, } diff --git a/cyclops-ctrl/internal/controller/templates.go b/cyclops-ctrl/internal/controller/templates.go index e2189a11..be3c23da 100644 --- a/cyclops-ctrl/internal/controller/templates.go +++ b/cyclops-ctrl/internal/controller/templates.go @@ -19,13 +19,13 @@ import ( type Templates struct { templatesRepo *template.Repo - kubernetesClient *k8sclient.KubernetesClient + kubernetesClient k8sclient.IKubernetesClient telemetryClient telemetry.Client } func NewTemplatesController( templatesRepo *template.Repo, - kubernetes *k8sclient.KubernetesClient, + kubernetes k8sclient.IKubernetesClient, telemetryClient telemetry.Client, ) *Templates { return &Templates{ diff --git a/cyclops-ctrl/internal/handler/handler.go b/cyclops-ctrl/internal/handler/handler.go index 89c59091..7fd1bbae 100644 --- a/cyclops-ctrl/internal/handler/handler.go +++ b/cyclops-ctrl/internal/handler/handler.go @@ -17,7 +17,7 @@ type Handler struct { router *gin.Engine templatesRepo *templaterepo.Repo - k8sClient *k8sclient.KubernetesClient + k8sClient k8sclient.IKubernetesClient renderer *render.Renderer telemetryClient telemetry.Client @@ -26,7 +26,7 @@ type Handler struct { func New( templatesRepo *templaterepo.Repo, - kubernetesClient *k8sclient.KubernetesClient, + kubernetesClient k8sclient.IKubernetesClient, renderer *render.Renderer, telemetryClient telemetry.Client, monitor prometheus.Monitor, diff --git a/cyclops-ctrl/internal/modulecontroller/module_controller.go b/cyclops-ctrl/internal/modulecontroller/module_controller.go index c25dcbd8..5de6f8ad 100644 --- a/cyclops-ctrl/internal/modulecontroller/module_controller.go +++ b/cyclops-ctrl/internal/modulecontroller/module_controller.go @@ -51,7 +51,7 @@ type ModuleReconciler struct { Scheme *runtime.Scheme templatesRepo *templaterepo.Repo - kubernetesClient *k8sclient.KubernetesClient + kubernetesClient k8sclient.IKubernetesClient renderer *render.Renderer telemetryClient telemetry.Client @@ -63,7 +63,7 @@ func NewModuleReconciler( client client.Client, scheme *runtime.Scheme, templatesRepo *templaterepo.Repo, - kubernetesClient *k8sclient.KubernetesClient, + kubernetesClient k8sclient.IKubernetesClient, renderer *render.Renderer, telemetryClient telemetry.Client, monitor prometheus.Monitor, @@ -226,7 +226,7 @@ func (r *ModuleReconciler) moduleToResources(template *models.Template, module * } func (r *ModuleReconciler) generateResources( - kClient *k8sclient.KubernetesClient, + kClient k8sclient.IKubernetesClient, module cyclopsv1alpha1.Module, moduleTemplate *models.Template, ) ([]string, []cyclopsv1alpha1.GroupVersionResource, error) { diff --git a/cyclops-ctrl/internal/template/render/render.go b/cyclops-ctrl/internal/template/render/render.go index 055f6bc2..2966882b 100644 --- a/cyclops-ctrl/internal/template/render/render.go +++ b/cyclops-ctrl/internal/template/render/render.go @@ -16,10 +16,10 @@ import ( ) type Renderer struct { - k8sClient *k8sclient.KubernetesClient + k8sClient k8sclient.IKubernetesClient } -func NewRenderer(kubernetesClient *k8sclient.KubernetesClient) *Renderer { +func NewRenderer(kubernetesClient k8sclient.IKubernetesClient) *Renderer { return &Renderer{ k8sClient: kubernetesClient, } diff --git a/cyclops-ctrl/pkg/cluster/k8sclient/client.go b/cyclops-ctrl/pkg/cluster/k8sclient/client.go index 02de709c..54cc96ed 100644 --- a/cyclops-ctrl/pkg/cluster/k8sclient/client.go +++ b/cyclops-ctrl/pkg/cluster/k8sclient/client.go @@ -1,12 +1,21 @@ package k8sclient import ( + "context" + + apiv1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/version" + "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/discovery" "k8s.io/client-go/dynamic" "k8s.io/client-go/kubernetes" ctrl "sigs.k8s.io/controller-runtime" + cyclopsv1alpha1 "github.com/cyclops-ui/cyclops/cyclops-ctrl/api/v1alpha1" "github.com/cyclops-ui/cyclops/cyclops-ctrl/api/v1alpha1/client" + "github.com/cyclops-ui/cyclops/cyclops-ctrl/internal/models/dto" ) const ( @@ -53,3 +62,43 @@ func createLocalClient() (*KubernetesClient, error) { moduleset: moduleSet, }, nil } + +type IKubernetesClient interface { + GetStreamedPodLogs(ctx context.Context, namespace, container, name string, logCount *int64, logChan chan<- string) error + GetPodLogs(namespace, container, name string, numLogs *int64) ([]string, error) + GetDeploymentLogs(namespace, container, deployment string, numLogs *int64) ([]string, error) + GetStatefulSetsLogs(namespace, container, name string, numLogs *int64) ([]string, error) + ListModules() ([]cyclopsv1alpha1.Module, error) + CreateModule(module cyclopsv1alpha1.Module) error + UpdateModule(module *cyclopsv1alpha1.Module) error + UpdateModuleStatus(module *cyclopsv1alpha1.Module) (*cyclopsv1alpha1.Module, error) + DeleteModule(name string) error + GetModule(name string) (*cyclopsv1alpha1.Module, error) + GetResourcesForModule(name string) ([]dto.Resource, error) + GetWorkloadsForModule(name string) ([]dto.Resource, error) + GetDeletedResources([]dto.Resource, string, string) ([]dto.Resource, error) + GetModuleResourcesHealth(name string) (string, error) + GVKtoAPIResourceName(gv schema.GroupVersion, kind string) (string, error) + VersionInfo() (*version.Info, error) + RestartDeployment(name, namespace string) error + RestartStatefulSet(name, namespace string) error + RestartDaemonSet(name, namespace string) error + GetManifest(group, version, kind, name, namespace string, includeManagedFields bool) (string, error) + Restart(group, version, kind, name, namespace string) error + GetResource(group, version, kind, name, namespace string) (any, error) + Delete(resource dto.Resource) error + CreateDynamic(cyclopsv1alpha1.GroupVersionResource, *unstructured.Unstructured, string) error + ApplyCRD(obj *unstructured.Unstructured) error + ListNodes() ([]apiv1.Node, error) + GetNode(name string) (*apiv1.Node, error) + GetPodsForNode(nodeName string) ([]apiv1.Pod, error) + ListNamespaces() ([]string, error) + WatchResource(group, version, resource, name, namespace string) (watch.Interface, error) + WatchKubernetesResources(gvrs []ResourceWatchSpec, stopCh chan struct{}) (chan *unstructured.Unstructured, error) + ListTemplateAuthRules() ([]cyclopsv1alpha1.TemplateAuthRule, error) + GetTemplateAuthRuleSecret(name, key string) (string, error) + ListTemplateStore() ([]cyclopsv1alpha1.TemplateStore, error) + CreateTemplateStore(ts *cyclopsv1alpha1.TemplateStore) error + UpdateTemplateStore(ts *cyclopsv1alpha1.TemplateStore) error + DeleteTemplateStore(name string) error +} diff --git a/cyclops-ctrl/pkg/cluster/k8sclient/resources.go b/cyclops-ctrl/pkg/cluster/k8sclient/resources.go index 2dff53d4..8f22c1f2 100644 --- a/cyclops-ctrl/pkg/cluster/k8sclient/resources.go +++ b/cyclops-ctrl/pkg/cluster/k8sclient/resources.go @@ -3,11 +3,11 @@ package k8sclient import ( "context" "fmt" - "github.com/cyclops-ui/cyclops/cyclops-ctrl/api/v1alpha1" - "github.com/pkg/errors" "strings" "time" + "github.com/pkg/errors" + "gopkg.in/yaml.v2" apiv1 "k8s.io/api/core/v1" @@ -20,6 +20,7 @@ import ( "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/tools/cache" + "github.com/cyclops-ui/cyclops/cyclops-ctrl/api/v1alpha1" "github.com/cyclops-ui/cyclops/cyclops-ctrl/internal/models/dto" ) diff --git a/cyclops-ctrl/pkg/mocks/IKubernetesClient.go b/cyclops-ctrl/pkg/mocks/IKubernetesClient.go new file mode 100644 index 00000000..4fd65a26 --- /dev/null +++ b/cyclops-ctrl/pkg/mocks/IKubernetesClient.go @@ -0,0 +1,2056 @@ +// Code generated by mockery. DO NOT EDIT. + +package mocks + +import ( + context "context" + + dto "github.com/cyclops-ui/cyclops/cyclops-ctrl/internal/models/dto" + k8sclient "github.com/cyclops-ui/cyclops/cyclops-ctrl/pkg/cluster/k8sclient" + + mock "github.com/stretchr/testify/mock" + + schema "k8s.io/apimachinery/pkg/runtime/schema" + + unstructured "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + + v1 "k8s.io/api/core/v1" + + v1alpha1 "github.com/cyclops-ui/cyclops/cyclops-ctrl/api/v1alpha1" + + version "k8s.io/apimachinery/pkg/version" + + watch "k8s.io/apimachinery/pkg/watch" +) + +// IKubernetesClient is an autogenerated mock type for the IKubernetesClient type +type IKubernetesClient struct { + mock.Mock +} + +type IKubernetesClient_Expecter struct { + mock *mock.Mock +} + +func (_m *IKubernetesClient) EXPECT() *IKubernetesClient_Expecter { + return &IKubernetesClient_Expecter{mock: &_m.Mock} +} + +// ApplyCRD provides a mock function with given fields: obj +func (_m *IKubernetesClient) ApplyCRD(obj *unstructured.Unstructured) error { + ret := _m.Called(obj) + + if len(ret) == 0 { + panic("no return value specified for ApplyCRD") + } + + var r0 error + if rf, ok := ret.Get(0).(func(*unstructured.Unstructured) error); ok { + r0 = rf(obj) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// IKubernetesClient_ApplyCRD_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ApplyCRD' +type IKubernetesClient_ApplyCRD_Call struct { + *mock.Call +} + +// ApplyCRD is a helper method to define mock.On call +// - obj *unstructured.Unstructured +func (_e *IKubernetesClient_Expecter) ApplyCRD(obj interface{}) *IKubernetesClient_ApplyCRD_Call { + return &IKubernetesClient_ApplyCRD_Call{Call: _e.mock.On("ApplyCRD", obj)} +} + +func (_c *IKubernetesClient_ApplyCRD_Call) Run(run func(obj *unstructured.Unstructured)) *IKubernetesClient_ApplyCRD_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*unstructured.Unstructured)) + }) + return _c +} + +func (_c *IKubernetesClient_ApplyCRD_Call) Return(_a0 error) *IKubernetesClient_ApplyCRD_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *IKubernetesClient_ApplyCRD_Call) RunAndReturn(run func(*unstructured.Unstructured) error) *IKubernetesClient_ApplyCRD_Call { + _c.Call.Return(run) + return _c +} + +// CreateDynamic provides a mock function with given fields: _a0, _a1, _a2 +func (_m *IKubernetesClient) CreateDynamic(_a0 v1alpha1.GroupVersionResource, _a1 *unstructured.Unstructured, _a2 string) error { + ret := _m.Called(_a0, _a1, _a2) + + if len(ret) == 0 { + panic("no return value specified for CreateDynamic") + } + + var r0 error + if rf, ok := ret.Get(0).(func(v1alpha1.GroupVersionResource, *unstructured.Unstructured, string) error); ok { + r0 = rf(_a0, _a1, _a2) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// IKubernetesClient_CreateDynamic_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateDynamic' +type IKubernetesClient_CreateDynamic_Call struct { + *mock.Call +} + +// CreateDynamic is a helper method to define mock.On call +// - _a0 v1alpha1.GroupVersionResource +// - _a1 *unstructured.Unstructured +// - _a2 string +func (_e *IKubernetesClient_Expecter) CreateDynamic(_a0 interface{}, _a1 interface{}, _a2 interface{}) *IKubernetesClient_CreateDynamic_Call { + return &IKubernetesClient_CreateDynamic_Call{Call: _e.mock.On("CreateDynamic", _a0, _a1, _a2)} +} + +func (_c *IKubernetesClient_CreateDynamic_Call) Run(run func(_a0 v1alpha1.GroupVersionResource, _a1 *unstructured.Unstructured, _a2 string)) *IKubernetesClient_CreateDynamic_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(v1alpha1.GroupVersionResource), args[1].(*unstructured.Unstructured), args[2].(string)) + }) + return _c +} + +func (_c *IKubernetesClient_CreateDynamic_Call) Return(_a0 error) *IKubernetesClient_CreateDynamic_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *IKubernetesClient_CreateDynamic_Call) RunAndReturn(run func(v1alpha1.GroupVersionResource, *unstructured.Unstructured, string) error) *IKubernetesClient_CreateDynamic_Call { + _c.Call.Return(run) + return _c +} + +// CreateModule provides a mock function with given fields: module +func (_m *IKubernetesClient) CreateModule(module v1alpha1.Module) error { + ret := _m.Called(module) + + if len(ret) == 0 { + panic("no return value specified for CreateModule") + } + + var r0 error + if rf, ok := ret.Get(0).(func(v1alpha1.Module) error); ok { + r0 = rf(module) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// IKubernetesClient_CreateModule_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateModule' +type IKubernetesClient_CreateModule_Call struct { + *mock.Call +} + +// CreateModule is a helper method to define mock.On call +// - module v1alpha1.Module +func (_e *IKubernetesClient_Expecter) CreateModule(module interface{}) *IKubernetesClient_CreateModule_Call { + return &IKubernetesClient_CreateModule_Call{Call: _e.mock.On("CreateModule", module)} +} + +func (_c *IKubernetesClient_CreateModule_Call) Run(run func(module v1alpha1.Module)) *IKubernetesClient_CreateModule_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(v1alpha1.Module)) + }) + return _c +} + +func (_c *IKubernetesClient_CreateModule_Call) Return(_a0 error) *IKubernetesClient_CreateModule_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *IKubernetesClient_CreateModule_Call) RunAndReturn(run func(v1alpha1.Module) error) *IKubernetesClient_CreateModule_Call { + _c.Call.Return(run) + return _c +} + +// CreateTemplateStore provides a mock function with given fields: ts +func (_m *IKubernetesClient) CreateTemplateStore(ts *v1alpha1.TemplateStore) error { + ret := _m.Called(ts) + + if len(ret) == 0 { + panic("no return value specified for CreateTemplateStore") + } + + var r0 error + if rf, ok := ret.Get(0).(func(*v1alpha1.TemplateStore) error); ok { + r0 = rf(ts) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// IKubernetesClient_CreateTemplateStore_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateTemplateStore' +type IKubernetesClient_CreateTemplateStore_Call struct { + *mock.Call +} + +// CreateTemplateStore is a helper method to define mock.On call +// - ts *v1alpha1.TemplateStore +func (_e *IKubernetesClient_Expecter) CreateTemplateStore(ts interface{}) *IKubernetesClient_CreateTemplateStore_Call { + return &IKubernetesClient_CreateTemplateStore_Call{Call: _e.mock.On("CreateTemplateStore", ts)} +} + +func (_c *IKubernetesClient_CreateTemplateStore_Call) Run(run func(ts *v1alpha1.TemplateStore)) *IKubernetesClient_CreateTemplateStore_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*v1alpha1.TemplateStore)) + }) + return _c +} + +func (_c *IKubernetesClient_CreateTemplateStore_Call) Return(_a0 error) *IKubernetesClient_CreateTemplateStore_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *IKubernetesClient_CreateTemplateStore_Call) RunAndReturn(run func(*v1alpha1.TemplateStore) error) *IKubernetesClient_CreateTemplateStore_Call { + _c.Call.Return(run) + return _c +} + +// Delete provides a mock function with given fields: resource +func (_m *IKubernetesClient) Delete(resource dto.Resource) error { + ret := _m.Called(resource) + + if len(ret) == 0 { + panic("no return value specified for Delete") + } + + var r0 error + if rf, ok := ret.Get(0).(func(dto.Resource) error); ok { + r0 = rf(resource) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// IKubernetesClient_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' +type IKubernetesClient_Delete_Call struct { + *mock.Call +} + +// Delete is a helper method to define mock.On call +// - resource dto.Resource +func (_e *IKubernetesClient_Expecter) Delete(resource interface{}) *IKubernetesClient_Delete_Call { + return &IKubernetesClient_Delete_Call{Call: _e.mock.On("Delete", resource)} +} + +func (_c *IKubernetesClient_Delete_Call) Run(run func(resource dto.Resource)) *IKubernetesClient_Delete_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(dto.Resource)) + }) + return _c +} + +func (_c *IKubernetesClient_Delete_Call) Return(_a0 error) *IKubernetesClient_Delete_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *IKubernetesClient_Delete_Call) RunAndReturn(run func(dto.Resource) error) *IKubernetesClient_Delete_Call { + _c.Call.Return(run) + return _c +} + +// DeleteModule provides a mock function with given fields: name +func (_m *IKubernetesClient) DeleteModule(name string) error { + ret := _m.Called(name) + + if len(ret) == 0 { + panic("no return value specified for DeleteModule") + } + + var r0 error + if rf, ok := ret.Get(0).(func(string) error); ok { + r0 = rf(name) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// IKubernetesClient_DeleteModule_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteModule' +type IKubernetesClient_DeleteModule_Call struct { + *mock.Call +} + +// DeleteModule is a helper method to define mock.On call +// - name string +func (_e *IKubernetesClient_Expecter) DeleteModule(name interface{}) *IKubernetesClient_DeleteModule_Call { + return &IKubernetesClient_DeleteModule_Call{Call: _e.mock.On("DeleteModule", name)} +} + +func (_c *IKubernetesClient_DeleteModule_Call) Run(run func(name string)) *IKubernetesClient_DeleteModule_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *IKubernetesClient_DeleteModule_Call) Return(_a0 error) *IKubernetesClient_DeleteModule_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *IKubernetesClient_DeleteModule_Call) RunAndReturn(run func(string) error) *IKubernetesClient_DeleteModule_Call { + _c.Call.Return(run) + return _c +} + +// DeleteTemplateStore provides a mock function with given fields: name +func (_m *IKubernetesClient) DeleteTemplateStore(name string) error { + ret := _m.Called(name) + + if len(ret) == 0 { + panic("no return value specified for DeleteTemplateStore") + } + + var r0 error + if rf, ok := ret.Get(0).(func(string) error); ok { + r0 = rf(name) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// IKubernetesClient_DeleteTemplateStore_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteTemplateStore' +type IKubernetesClient_DeleteTemplateStore_Call struct { + *mock.Call +} + +// DeleteTemplateStore is a helper method to define mock.On call +// - name string +func (_e *IKubernetesClient_Expecter) DeleteTemplateStore(name interface{}) *IKubernetesClient_DeleteTemplateStore_Call { + return &IKubernetesClient_DeleteTemplateStore_Call{Call: _e.mock.On("DeleteTemplateStore", name)} +} + +func (_c *IKubernetesClient_DeleteTemplateStore_Call) Run(run func(name string)) *IKubernetesClient_DeleteTemplateStore_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *IKubernetesClient_DeleteTemplateStore_Call) Return(_a0 error) *IKubernetesClient_DeleteTemplateStore_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *IKubernetesClient_DeleteTemplateStore_Call) RunAndReturn(run func(string) error) *IKubernetesClient_DeleteTemplateStore_Call { + _c.Call.Return(run) + return _c +} + +// GVKtoAPIResourceName provides a mock function with given fields: gv, kind +func (_m *IKubernetesClient) GVKtoAPIResourceName(gv schema.GroupVersion, kind string) (string, error) { + ret := _m.Called(gv, kind) + + if len(ret) == 0 { + panic("no return value specified for GVKtoAPIResourceName") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(schema.GroupVersion, string) (string, error)); ok { + return rf(gv, kind) + } + if rf, ok := ret.Get(0).(func(schema.GroupVersion, string) string); ok { + r0 = rf(gv, kind) + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func(schema.GroupVersion, string) error); ok { + r1 = rf(gv, kind) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// IKubernetesClient_GVKtoAPIResourceName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GVKtoAPIResourceName' +type IKubernetesClient_GVKtoAPIResourceName_Call struct { + *mock.Call +} + +// GVKtoAPIResourceName is a helper method to define mock.On call +// - gv schema.GroupVersion +// - kind string +func (_e *IKubernetesClient_Expecter) GVKtoAPIResourceName(gv interface{}, kind interface{}) *IKubernetesClient_GVKtoAPIResourceName_Call { + return &IKubernetesClient_GVKtoAPIResourceName_Call{Call: _e.mock.On("GVKtoAPIResourceName", gv, kind)} +} + +func (_c *IKubernetesClient_GVKtoAPIResourceName_Call) Run(run func(gv schema.GroupVersion, kind string)) *IKubernetesClient_GVKtoAPIResourceName_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(schema.GroupVersion), args[1].(string)) + }) + return _c +} + +func (_c *IKubernetesClient_GVKtoAPIResourceName_Call) Return(_a0 string, _a1 error) *IKubernetesClient_GVKtoAPIResourceName_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *IKubernetesClient_GVKtoAPIResourceName_Call) RunAndReturn(run func(schema.GroupVersion, string) (string, error)) *IKubernetesClient_GVKtoAPIResourceName_Call { + _c.Call.Return(run) + return _c +} + +// GetDeletedResources provides a mock function with given fields: _a0, _a1, _a2 +func (_m *IKubernetesClient) GetDeletedResources(_a0 []dto.Resource, _a1 string, _a2 string) ([]dto.Resource, error) { + ret := _m.Called(_a0, _a1, _a2) + + if len(ret) == 0 { + panic("no return value specified for GetDeletedResources") + } + + var r0 []dto.Resource + var r1 error + if rf, ok := ret.Get(0).(func([]dto.Resource, string, string) ([]dto.Resource, error)); ok { + return rf(_a0, _a1, _a2) + } + if rf, ok := ret.Get(0).(func([]dto.Resource, string, string) []dto.Resource); ok { + r0 = rf(_a0, _a1, _a2) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]dto.Resource) + } + } + + if rf, ok := ret.Get(1).(func([]dto.Resource, string, string) error); ok { + r1 = rf(_a0, _a1, _a2) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// IKubernetesClient_GetDeletedResources_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDeletedResources' +type IKubernetesClient_GetDeletedResources_Call struct { + *mock.Call +} + +// GetDeletedResources is a helper method to define mock.On call +// - _a0 []dto.Resource +// - _a1 string +// - _a2 string +func (_e *IKubernetesClient_Expecter) GetDeletedResources(_a0 interface{}, _a1 interface{}, _a2 interface{}) *IKubernetesClient_GetDeletedResources_Call { + return &IKubernetesClient_GetDeletedResources_Call{Call: _e.mock.On("GetDeletedResources", _a0, _a1, _a2)} +} + +func (_c *IKubernetesClient_GetDeletedResources_Call) Run(run func(_a0 []dto.Resource, _a1 string, _a2 string)) *IKubernetesClient_GetDeletedResources_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]dto.Resource), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *IKubernetesClient_GetDeletedResources_Call) Return(_a0 []dto.Resource, _a1 error) *IKubernetesClient_GetDeletedResources_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *IKubernetesClient_GetDeletedResources_Call) RunAndReturn(run func([]dto.Resource, string, string) ([]dto.Resource, error)) *IKubernetesClient_GetDeletedResources_Call { + _c.Call.Return(run) + return _c +} + +// GetDeploymentLogs provides a mock function with given fields: namespace, container, deployment, numLogs +func (_m *IKubernetesClient) GetDeploymentLogs(namespace string, container string, deployment string, numLogs *int64) ([]string, error) { + ret := _m.Called(namespace, container, deployment, numLogs) + + if len(ret) == 0 { + panic("no return value specified for GetDeploymentLogs") + } + + var r0 []string + var r1 error + if rf, ok := ret.Get(0).(func(string, string, string, *int64) ([]string, error)); ok { + return rf(namespace, container, deployment, numLogs) + } + if rf, ok := ret.Get(0).(func(string, string, string, *int64) []string); ok { + r0 = rf(namespace, container, deployment, numLogs) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]string) + } + } + + if rf, ok := ret.Get(1).(func(string, string, string, *int64) error); ok { + r1 = rf(namespace, container, deployment, numLogs) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// IKubernetesClient_GetDeploymentLogs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDeploymentLogs' +type IKubernetesClient_GetDeploymentLogs_Call struct { + *mock.Call +} + +// GetDeploymentLogs is a helper method to define mock.On call +// - namespace string +// - container string +// - deployment string +// - numLogs *int64 +func (_e *IKubernetesClient_Expecter) GetDeploymentLogs(namespace interface{}, container interface{}, deployment interface{}, numLogs interface{}) *IKubernetesClient_GetDeploymentLogs_Call { + return &IKubernetesClient_GetDeploymentLogs_Call{Call: _e.mock.On("GetDeploymentLogs", namespace, container, deployment, numLogs)} +} + +func (_c *IKubernetesClient_GetDeploymentLogs_Call) Run(run func(namespace string, container string, deployment string, numLogs *int64)) *IKubernetesClient_GetDeploymentLogs_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string), args[2].(string), args[3].(*int64)) + }) + return _c +} + +func (_c *IKubernetesClient_GetDeploymentLogs_Call) Return(_a0 []string, _a1 error) *IKubernetesClient_GetDeploymentLogs_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *IKubernetesClient_GetDeploymentLogs_Call) RunAndReturn(run func(string, string, string, *int64) ([]string, error)) *IKubernetesClient_GetDeploymentLogs_Call { + _c.Call.Return(run) + return _c +} + +// GetManifest provides a mock function with given fields: group, _a1, kind, name, namespace, includeManagedFields +func (_m *IKubernetesClient) GetManifest(group string, _a1 string, kind string, name string, namespace string, includeManagedFields bool) (string, error) { + ret := _m.Called(group, _a1, kind, name, namespace, includeManagedFields) + + if len(ret) == 0 { + panic("no return value specified for GetManifest") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(string, string, string, string, string, bool) (string, error)); ok { + return rf(group, _a1, kind, name, namespace, includeManagedFields) + } + if rf, ok := ret.Get(0).(func(string, string, string, string, string, bool) string); ok { + r0 = rf(group, _a1, kind, name, namespace, includeManagedFields) + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func(string, string, string, string, string, bool) error); ok { + r1 = rf(group, _a1, kind, name, namespace, includeManagedFields) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// IKubernetesClient_GetManifest_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetManifest' +type IKubernetesClient_GetManifest_Call struct { + *mock.Call +} + +// GetManifest is a helper method to define mock.On call +// - group string +// - _a1 string +// - kind string +// - name string +// - namespace string +// - includeManagedFields bool +func (_e *IKubernetesClient_Expecter) GetManifest(group interface{}, _a1 interface{}, kind interface{}, name interface{}, namespace interface{}, includeManagedFields interface{}) *IKubernetesClient_GetManifest_Call { + return &IKubernetesClient_GetManifest_Call{Call: _e.mock.On("GetManifest", group, _a1, kind, name, namespace, includeManagedFields)} +} + +func (_c *IKubernetesClient_GetManifest_Call) Run(run func(group string, _a1 string, kind string, name string, namespace string, includeManagedFields bool)) *IKubernetesClient_GetManifest_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string), args[2].(string), args[3].(string), args[4].(string), args[5].(bool)) + }) + return _c +} + +func (_c *IKubernetesClient_GetManifest_Call) Return(_a0 string, _a1 error) *IKubernetesClient_GetManifest_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *IKubernetesClient_GetManifest_Call) RunAndReturn(run func(string, string, string, string, string, bool) (string, error)) *IKubernetesClient_GetManifest_Call { + _c.Call.Return(run) + return _c +} + +// GetModule provides a mock function with given fields: name +func (_m *IKubernetesClient) GetModule(name string) (*v1alpha1.Module, error) { + ret := _m.Called(name) + + if len(ret) == 0 { + panic("no return value specified for GetModule") + } + + var r0 *v1alpha1.Module + var r1 error + if rf, ok := ret.Get(0).(func(string) (*v1alpha1.Module, error)); ok { + return rf(name) + } + if rf, ok := ret.Get(0).(func(string) *v1alpha1.Module); ok { + r0 = rf(name) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*v1alpha1.Module) + } + } + + if rf, ok := ret.Get(1).(func(string) error); ok { + r1 = rf(name) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// IKubernetesClient_GetModule_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetModule' +type IKubernetesClient_GetModule_Call struct { + *mock.Call +} + +// GetModule is a helper method to define mock.On call +// - name string +func (_e *IKubernetesClient_Expecter) GetModule(name interface{}) *IKubernetesClient_GetModule_Call { + return &IKubernetesClient_GetModule_Call{Call: _e.mock.On("GetModule", name)} +} + +func (_c *IKubernetesClient_GetModule_Call) Run(run func(name string)) *IKubernetesClient_GetModule_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *IKubernetesClient_GetModule_Call) Return(_a0 *v1alpha1.Module, _a1 error) *IKubernetesClient_GetModule_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *IKubernetesClient_GetModule_Call) RunAndReturn(run func(string) (*v1alpha1.Module, error)) *IKubernetesClient_GetModule_Call { + _c.Call.Return(run) + return _c +} + +// GetModuleResourcesHealth provides a mock function with given fields: name +func (_m *IKubernetesClient) GetModuleResourcesHealth(name string) (string, error) { + ret := _m.Called(name) + + if len(ret) == 0 { + panic("no return value specified for GetModuleResourcesHealth") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(string) (string, error)); ok { + return rf(name) + } + if rf, ok := ret.Get(0).(func(string) string); ok { + r0 = rf(name) + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func(string) error); ok { + r1 = rf(name) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// IKubernetesClient_GetModuleResourcesHealth_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetModuleResourcesHealth' +type IKubernetesClient_GetModuleResourcesHealth_Call struct { + *mock.Call +} + +// GetModuleResourcesHealth is a helper method to define mock.On call +// - name string +func (_e *IKubernetesClient_Expecter) GetModuleResourcesHealth(name interface{}) *IKubernetesClient_GetModuleResourcesHealth_Call { + return &IKubernetesClient_GetModuleResourcesHealth_Call{Call: _e.mock.On("GetModuleResourcesHealth", name)} +} + +func (_c *IKubernetesClient_GetModuleResourcesHealth_Call) Run(run func(name string)) *IKubernetesClient_GetModuleResourcesHealth_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *IKubernetesClient_GetModuleResourcesHealth_Call) Return(_a0 string, _a1 error) *IKubernetesClient_GetModuleResourcesHealth_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *IKubernetesClient_GetModuleResourcesHealth_Call) RunAndReturn(run func(string) (string, error)) *IKubernetesClient_GetModuleResourcesHealth_Call { + _c.Call.Return(run) + return _c +} + +// GetNode provides a mock function with given fields: name +func (_m *IKubernetesClient) GetNode(name string) (*v1.Node, error) { + ret := _m.Called(name) + + if len(ret) == 0 { + panic("no return value specified for GetNode") + } + + var r0 *v1.Node + var r1 error + if rf, ok := ret.Get(0).(func(string) (*v1.Node, error)); ok { + return rf(name) + } + if rf, ok := ret.Get(0).(func(string) *v1.Node); ok { + r0 = rf(name) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*v1.Node) + } + } + + if rf, ok := ret.Get(1).(func(string) error); ok { + r1 = rf(name) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// IKubernetesClient_GetNode_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetNode' +type IKubernetesClient_GetNode_Call struct { + *mock.Call +} + +// GetNode is a helper method to define mock.On call +// - name string +func (_e *IKubernetesClient_Expecter) GetNode(name interface{}) *IKubernetesClient_GetNode_Call { + return &IKubernetesClient_GetNode_Call{Call: _e.mock.On("GetNode", name)} +} + +func (_c *IKubernetesClient_GetNode_Call) Run(run func(name string)) *IKubernetesClient_GetNode_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *IKubernetesClient_GetNode_Call) Return(_a0 *v1.Node, _a1 error) *IKubernetesClient_GetNode_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *IKubernetesClient_GetNode_Call) RunAndReturn(run func(string) (*v1.Node, error)) *IKubernetesClient_GetNode_Call { + _c.Call.Return(run) + return _c +} + +// GetPodLogs provides a mock function with given fields: namespace, container, name, numLogs +func (_m *IKubernetesClient) GetPodLogs(namespace string, container string, name string, numLogs *int64) ([]string, error) { + ret := _m.Called(namespace, container, name, numLogs) + + if len(ret) == 0 { + panic("no return value specified for GetPodLogs") + } + + var r0 []string + var r1 error + if rf, ok := ret.Get(0).(func(string, string, string, *int64) ([]string, error)); ok { + return rf(namespace, container, name, numLogs) + } + if rf, ok := ret.Get(0).(func(string, string, string, *int64) []string); ok { + r0 = rf(namespace, container, name, numLogs) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]string) + } + } + + if rf, ok := ret.Get(1).(func(string, string, string, *int64) error); ok { + r1 = rf(namespace, container, name, numLogs) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// IKubernetesClient_GetPodLogs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPodLogs' +type IKubernetesClient_GetPodLogs_Call struct { + *mock.Call +} + +// GetPodLogs is a helper method to define mock.On call +// - namespace string +// - container string +// - name string +// - numLogs *int64 +func (_e *IKubernetesClient_Expecter) GetPodLogs(namespace interface{}, container interface{}, name interface{}, numLogs interface{}) *IKubernetesClient_GetPodLogs_Call { + return &IKubernetesClient_GetPodLogs_Call{Call: _e.mock.On("GetPodLogs", namespace, container, name, numLogs)} +} + +func (_c *IKubernetesClient_GetPodLogs_Call) Run(run func(namespace string, container string, name string, numLogs *int64)) *IKubernetesClient_GetPodLogs_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string), args[2].(string), args[3].(*int64)) + }) + return _c +} + +func (_c *IKubernetesClient_GetPodLogs_Call) Return(_a0 []string, _a1 error) *IKubernetesClient_GetPodLogs_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *IKubernetesClient_GetPodLogs_Call) RunAndReturn(run func(string, string, string, *int64) ([]string, error)) *IKubernetesClient_GetPodLogs_Call { + _c.Call.Return(run) + return _c +} + +// GetPodsForNode provides a mock function with given fields: nodeName +func (_m *IKubernetesClient) GetPodsForNode(nodeName string) ([]v1.Pod, error) { + ret := _m.Called(nodeName) + + if len(ret) == 0 { + panic("no return value specified for GetPodsForNode") + } + + var r0 []v1.Pod + var r1 error + if rf, ok := ret.Get(0).(func(string) ([]v1.Pod, error)); ok { + return rf(nodeName) + } + if rf, ok := ret.Get(0).(func(string) []v1.Pod); ok { + r0 = rf(nodeName) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]v1.Pod) + } + } + + if rf, ok := ret.Get(1).(func(string) error); ok { + r1 = rf(nodeName) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// IKubernetesClient_GetPodsForNode_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPodsForNode' +type IKubernetesClient_GetPodsForNode_Call struct { + *mock.Call +} + +// GetPodsForNode is a helper method to define mock.On call +// - nodeName string +func (_e *IKubernetesClient_Expecter) GetPodsForNode(nodeName interface{}) *IKubernetesClient_GetPodsForNode_Call { + return &IKubernetesClient_GetPodsForNode_Call{Call: _e.mock.On("GetPodsForNode", nodeName)} +} + +func (_c *IKubernetesClient_GetPodsForNode_Call) Run(run func(nodeName string)) *IKubernetesClient_GetPodsForNode_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *IKubernetesClient_GetPodsForNode_Call) Return(_a0 []v1.Pod, _a1 error) *IKubernetesClient_GetPodsForNode_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *IKubernetesClient_GetPodsForNode_Call) RunAndReturn(run func(string) ([]v1.Pod, error)) *IKubernetesClient_GetPodsForNode_Call { + _c.Call.Return(run) + return _c +} + +// GetResource provides a mock function with given fields: group, _a1, kind, name, namespace +func (_m *IKubernetesClient) GetResource(group string, _a1 string, kind string, name string, namespace string) (any, error) { + ret := _m.Called(group, _a1, kind, name, namespace) + + if len(ret) == 0 { + panic("no return value specified for GetResource") + } + + var r0 any + var r1 error + if rf, ok := ret.Get(0).(func(string, string, string, string, string) (any, error)); ok { + return rf(group, _a1, kind, name, namespace) + } + if rf, ok := ret.Get(0).(func(string, string, string, string, string) any); ok { + r0 = rf(group, _a1, kind, name, namespace) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(any) + } + } + + if rf, ok := ret.Get(1).(func(string, string, string, string, string) error); ok { + r1 = rf(group, _a1, kind, name, namespace) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// IKubernetesClient_GetResource_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetResource' +type IKubernetesClient_GetResource_Call struct { + *mock.Call +} + +// GetResource is a helper method to define mock.On call +// - group string +// - _a1 string +// - kind string +// - name string +// - namespace string +func (_e *IKubernetesClient_Expecter) GetResource(group interface{}, _a1 interface{}, kind interface{}, name interface{}, namespace interface{}) *IKubernetesClient_GetResource_Call { + return &IKubernetesClient_GetResource_Call{Call: _e.mock.On("GetResource", group, _a1, kind, name, namespace)} +} + +func (_c *IKubernetesClient_GetResource_Call) Run(run func(group string, _a1 string, kind string, name string, namespace string)) *IKubernetesClient_GetResource_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string), args[2].(string), args[3].(string), args[4].(string)) + }) + return _c +} + +func (_c *IKubernetesClient_GetResource_Call) Return(_a0 any, _a1 error) *IKubernetesClient_GetResource_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *IKubernetesClient_GetResource_Call) RunAndReturn(run func(string, string, string, string, string) (any, error)) *IKubernetesClient_GetResource_Call { + _c.Call.Return(run) + return _c +} + +// GetResourcesForModule provides a mock function with given fields: name +func (_m *IKubernetesClient) GetResourcesForModule(name string) ([]dto.Resource, error) { + ret := _m.Called(name) + + if len(ret) == 0 { + panic("no return value specified for GetResourcesForModule") + } + + var r0 []dto.Resource + var r1 error + if rf, ok := ret.Get(0).(func(string) ([]dto.Resource, error)); ok { + return rf(name) + } + if rf, ok := ret.Get(0).(func(string) []dto.Resource); ok { + r0 = rf(name) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]dto.Resource) + } + } + + if rf, ok := ret.Get(1).(func(string) error); ok { + r1 = rf(name) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// IKubernetesClient_GetResourcesForModule_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetResourcesForModule' +type IKubernetesClient_GetResourcesForModule_Call struct { + *mock.Call +} + +// GetResourcesForModule is a helper method to define mock.On call +// - name string +func (_e *IKubernetesClient_Expecter) GetResourcesForModule(name interface{}) *IKubernetesClient_GetResourcesForModule_Call { + return &IKubernetesClient_GetResourcesForModule_Call{Call: _e.mock.On("GetResourcesForModule", name)} +} + +func (_c *IKubernetesClient_GetResourcesForModule_Call) Run(run func(name string)) *IKubernetesClient_GetResourcesForModule_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *IKubernetesClient_GetResourcesForModule_Call) Return(_a0 []dto.Resource, _a1 error) *IKubernetesClient_GetResourcesForModule_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *IKubernetesClient_GetResourcesForModule_Call) RunAndReturn(run func(string) ([]dto.Resource, error)) *IKubernetesClient_GetResourcesForModule_Call { + _c.Call.Return(run) + return _c +} + +// GetStatefulSetsLogs provides a mock function with given fields: namespace, container, name, numLogs +func (_m *IKubernetesClient) GetStatefulSetsLogs(namespace string, container string, name string, numLogs *int64) ([]string, error) { + ret := _m.Called(namespace, container, name, numLogs) + + if len(ret) == 0 { + panic("no return value specified for GetStatefulSetsLogs") + } + + var r0 []string + var r1 error + if rf, ok := ret.Get(0).(func(string, string, string, *int64) ([]string, error)); ok { + return rf(namespace, container, name, numLogs) + } + if rf, ok := ret.Get(0).(func(string, string, string, *int64) []string); ok { + r0 = rf(namespace, container, name, numLogs) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]string) + } + } + + if rf, ok := ret.Get(1).(func(string, string, string, *int64) error); ok { + r1 = rf(namespace, container, name, numLogs) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// IKubernetesClient_GetStatefulSetsLogs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetStatefulSetsLogs' +type IKubernetesClient_GetStatefulSetsLogs_Call struct { + *mock.Call +} + +// GetStatefulSetsLogs is a helper method to define mock.On call +// - namespace string +// - container string +// - name string +// - numLogs *int64 +func (_e *IKubernetesClient_Expecter) GetStatefulSetsLogs(namespace interface{}, container interface{}, name interface{}, numLogs interface{}) *IKubernetesClient_GetStatefulSetsLogs_Call { + return &IKubernetesClient_GetStatefulSetsLogs_Call{Call: _e.mock.On("GetStatefulSetsLogs", namespace, container, name, numLogs)} +} + +func (_c *IKubernetesClient_GetStatefulSetsLogs_Call) Run(run func(namespace string, container string, name string, numLogs *int64)) *IKubernetesClient_GetStatefulSetsLogs_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string), args[2].(string), args[3].(*int64)) + }) + return _c +} + +func (_c *IKubernetesClient_GetStatefulSetsLogs_Call) Return(_a0 []string, _a1 error) *IKubernetesClient_GetStatefulSetsLogs_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *IKubernetesClient_GetStatefulSetsLogs_Call) RunAndReturn(run func(string, string, string, *int64) ([]string, error)) *IKubernetesClient_GetStatefulSetsLogs_Call { + _c.Call.Return(run) + return _c +} + +// GetStreamedPodLogs provides a mock function with given fields: ctx, namespace, container, name, logCount, logChan +func (_m *IKubernetesClient) GetStreamedPodLogs(ctx context.Context, namespace string, container string, name string, logCount *int64, logChan chan<- string) error { + ret := _m.Called(ctx, namespace, container, name, logCount, logChan) + + if len(ret) == 0 { + panic("no return value specified for GetStreamedPodLogs") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, *int64, chan<- string) error); ok { + r0 = rf(ctx, namespace, container, name, logCount, logChan) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// IKubernetesClient_GetStreamedPodLogs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetStreamedPodLogs' +type IKubernetesClient_GetStreamedPodLogs_Call struct { + *mock.Call +} + +// GetStreamedPodLogs is a helper method to define mock.On call +// - ctx context.Context +// - namespace string +// - container string +// - name string +// - logCount *int64 +// - logChan chan<- string +func (_e *IKubernetesClient_Expecter) GetStreamedPodLogs(ctx interface{}, namespace interface{}, container interface{}, name interface{}, logCount interface{}, logChan interface{}) *IKubernetesClient_GetStreamedPodLogs_Call { + return &IKubernetesClient_GetStreamedPodLogs_Call{Call: _e.mock.On("GetStreamedPodLogs", ctx, namespace, container, name, logCount, logChan)} +} + +func (_c *IKubernetesClient_GetStreamedPodLogs_Call) Run(run func(ctx context.Context, namespace string, container string, name string, logCount *int64, logChan chan<- string)) *IKubernetesClient_GetStreamedPodLogs_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(string), args[4].(*int64), args[5].(chan<- string)) + }) + return _c +} + +func (_c *IKubernetesClient_GetStreamedPodLogs_Call) Return(_a0 error) *IKubernetesClient_GetStreamedPodLogs_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *IKubernetesClient_GetStreamedPodLogs_Call) RunAndReturn(run func(context.Context, string, string, string, *int64, chan<- string) error) *IKubernetesClient_GetStreamedPodLogs_Call { + _c.Call.Return(run) + return _c +} + +// GetTemplateAuthRuleSecret provides a mock function with given fields: name, key +func (_m *IKubernetesClient) GetTemplateAuthRuleSecret(name string, key string) (string, error) { + ret := _m.Called(name, key) + + if len(ret) == 0 { + panic("no return value specified for GetTemplateAuthRuleSecret") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(string, string) (string, error)); ok { + return rf(name, key) + } + if rf, ok := ret.Get(0).(func(string, string) string); ok { + r0 = rf(name, key) + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func(string, string) error); ok { + r1 = rf(name, key) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// IKubernetesClient_GetTemplateAuthRuleSecret_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTemplateAuthRuleSecret' +type IKubernetesClient_GetTemplateAuthRuleSecret_Call struct { + *mock.Call +} + +// GetTemplateAuthRuleSecret is a helper method to define mock.On call +// - name string +// - key string +func (_e *IKubernetesClient_Expecter) GetTemplateAuthRuleSecret(name interface{}, key interface{}) *IKubernetesClient_GetTemplateAuthRuleSecret_Call { + return &IKubernetesClient_GetTemplateAuthRuleSecret_Call{Call: _e.mock.On("GetTemplateAuthRuleSecret", name, key)} +} + +func (_c *IKubernetesClient_GetTemplateAuthRuleSecret_Call) Run(run func(name string, key string)) *IKubernetesClient_GetTemplateAuthRuleSecret_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string)) + }) + return _c +} + +func (_c *IKubernetesClient_GetTemplateAuthRuleSecret_Call) Return(_a0 string, _a1 error) *IKubernetesClient_GetTemplateAuthRuleSecret_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *IKubernetesClient_GetTemplateAuthRuleSecret_Call) RunAndReturn(run func(string, string) (string, error)) *IKubernetesClient_GetTemplateAuthRuleSecret_Call { + _c.Call.Return(run) + return _c +} + +// GetWorkloadsForModule provides a mock function with given fields: name +func (_m *IKubernetesClient) GetWorkloadsForModule(name string) ([]dto.Resource, error) { + ret := _m.Called(name) + + if len(ret) == 0 { + panic("no return value specified for GetWorkloadsForModule") + } + + var r0 []dto.Resource + var r1 error + if rf, ok := ret.Get(0).(func(string) ([]dto.Resource, error)); ok { + return rf(name) + } + if rf, ok := ret.Get(0).(func(string) []dto.Resource); ok { + r0 = rf(name) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]dto.Resource) + } + } + + if rf, ok := ret.Get(1).(func(string) error); ok { + r1 = rf(name) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// IKubernetesClient_GetWorkloadsForModule_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetWorkloadsForModule' +type IKubernetesClient_GetWorkloadsForModule_Call struct { + *mock.Call +} + +// GetWorkloadsForModule is a helper method to define mock.On call +// - name string +func (_e *IKubernetesClient_Expecter) GetWorkloadsForModule(name interface{}) *IKubernetesClient_GetWorkloadsForModule_Call { + return &IKubernetesClient_GetWorkloadsForModule_Call{Call: _e.mock.On("GetWorkloadsForModule", name)} +} + +func (_c *IKubernetesClient_GetWorkloadsForModule_Call) Run(run func(name string)) *IKubernetesClient_GetWorkloadsForModule_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *IKubernetesClient_GetWorkloadsForModule_Call) Return(_a0 []dto.Resource, _a1 error) *IKubernetesClient_GetWorkloadsForModule_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *IKubernetesClient_GetWorkloadsForModule_Call) RunAndReturn(run func(string) ([]dto.Resource, error)) *IKubernetesClient_GetWorkloadsForModule_Call { + _c.Call.Return(run) + return _c +} + +// ListModules provides a mock function with given fields: +func (_m *IKubernetesClient) ListModules() ([]v1alpha1.Module, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for ListModules") + } + + var r0 []v1alpha1.Module + var r1 error + if rf, ok := ret.Get(0).(func() ([]v1alpha1.Module, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() []v1alpha1.Module); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]v1alpha1.Module) + } + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// IKubernetesClient_ListModules_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListModules' +type IKubernetesClient_ListModules_Call struct { + *mock.Call +} + +// ListModules is a helper method to define mock.On call +func (_e *IKubernetesClient_Expecter) ListModules() *IKubernetesClient_ListModules_Call { + return &IKubernetesClient_ListModules_Call{Call: _e.mock.On("ListModules")} +} + +func (_c *IKubernetesClient_ListModules_Call) Run(run func()) *IKubernetesClient_ListModules_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *IKubernetesClient_ListModules_Call) Return(_a0 []v1alpha1.Module, _a1 error) *IKubernetesClient_ListModules_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *IKubernetesClient_ListModules_Call) RunAndReturn(run func() ([]v1alpha1.Module, error)) *IKubernetesClient_ListModules_Call { + _c.Call.Return(run) + return _c +} + +// ListNamespaces provides a mock function with given fields: +func (_m *IKubernetesClient) ListNamespaces() ([]string, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for ListNamespaces") + } + + var r0 []string + var r1 error + if rf, ok := ret.Get(0).(func() ([]string, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() []string); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]string) + } + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// IKubernetesClient_ListNamespaces_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListNamespaces' +type IKubernetesClient_ListNamespaces_Call struct { + *mock.Call +} + +// ListNamespaces is a helper method to define mock.On call +func (_e *IKubernetesClient_Expecter) ListNamespaces() *IKubernetesClient_ListNamespaces_Call { + return &IKubernetesClient_ListNamespaces_Call{Call: _e.mock.On("ListNamespaces")} +} + +func (_c *IKubernetesClient_ListNamespaces_Call) Run(run func()) *IKubernetesClient_ListNamespaces_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *IKubernetesClient_ListNamespaces_Call) Return(_a0 []string, _a1 error) *IKubernetesClient_ListNamespaces_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *IKubernetesClient_ListNamespaces_Call) RunAndReturn(run func() ([]string, error)) *IKubernetesClient_ListNamespaces_Call { + _c.Call.Return(run) + return _c +} + +// ListNodes provides a mock function with given fields: +func (_m *IKubernetesClient) ListNodes() ([]v1.Node, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for ListNodes") + } + + var r0 []v1.Node + var r1 error + if rf, ok := ret.Get(0).(func() ([]v1.Node, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() []v1.Node); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]v1.Node) + } + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// IKubernetesClient_ListNodes_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListNodes' +type IKubernetesClient_ListNodes_Call struct { + *mock.Call +} + +// ListNodes is a helper method to define mock.On call +func (_e *IKubernetesClient_Expecter) ListNodes() *IKubernetesClient_ListNodes_Call { + return &IKubernetesClient_ListNodes_Call{Call: _e.mock.On("ListNodes")} +} + +func (_c *IKubernetesClient_ListNodes_Call) Run(run func()) *IKubernetesClient_ListNodes_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *IKubernetesClient_ListNodes_Call) Return(_a0 []v1.Node, _a1 error) *IKubernetesClient_ListNodes_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *IKubernetesClient_ListNodes_Call) RunAndReturn(run func() ([]v1.Node, error)) *IKubernetesClient_ListNodes_Call { + _c.Call.Return(run) + return _c +} + +// ListTemplateAuthRules provides a mock function with given fields: +func (_m *IKubernetesClient) ListTemplateAuthRules() ([]v1alpha1.TemplateAuthRule, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for ListTemplateAuthRules") + } + + var r0 []v1alpha1.TemplateAuthRule + var r1 error + if rf, ok := ret.Get(0).(func() ([]v1alpha1.TemplateAuthRule, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() []v1alpha1.TemplateAuthRule); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]v1alpha1.TemplateAuthRule) + } + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// IKubernetesClient_ListTemplateAuthRules_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListTemplateAuthRules' +type IKubernetesClient_ListTemplateAuthRules_Call struct { + *mock.Call +} + +// ListTemplateAuthRules is a helper method to define mock.On call +func (_e *IKubernetesClient_Expecter) ListTemplateAuthRules() *IKubernetesClient_ListTemplateAuthRules_Call { + return &IKubernetesClient_ListTemplateAuthRules_Call{Call: _e.mock.On("ListTemplateAuthRules")} +} + +func (_c *IKubernetesClient_ListTemplateAuthRules_Call) Run(run func()) *IKubernetesClient_ListTemplateAuthRules_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *IKubernetesClient_ListTemplateAuthRules_Call) Return(_a0 []v1alpha1.TemplateAuthRule, _a1 error) *IKubernetesClient_ListTemplateAuthRules_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *IKubernetesClient_ListTemplateAuthRules_Call) RunAndReturn(run func() ([]v1alpha1.TemplateAuthRule, error)) *IKubernetesClient_ListTemplateAuthRules_Call { + _c.Call.Return(run) + return _c +} + +// ListTemplateStore provides a mock function with given fields: +func (_m *IKubernetesClient) ListTemplateStore() ([]v1alpha1.TemplateStore, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for ListTemplateStore") + } + + var r0 []v1alpha1.TemplateStore + var r1 error + if rf, ok := ret.Get(0).(func() ([]v1alpha1.TemplateStore, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() []v1alpha1.TemplateStore); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]v1alpha1.TemplateStore) + } + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// IKubernetesClient_ListTemplateStore_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListTemplateStore' +type IKubernetesClient_ListTemplateStore_Call struct { + *mock.Call +} + +// ListTemplateStore is a helper method to define mock.On call +func (_e *IKubernetesClient_Expecter) ListTemplateStore() *IKubernetesClient_ListTemplateStore_Call { + return &IKubernetesClient_ListTemplateStore_Call{Call: _e.mock.On("ListTemplateStore")} +} + +func (_c *IKubernetesClient_ListTemplateStore_Call) Run(run func()) *IKubernetesClient_ListTemplateStore_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *IKubernetesClient_ListTemplateStore_Call) Return(_a0 []v1alpha1.TemplateStore, _a1 error) *IKubernetesClient_ListTemplateStore_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *IKubernetesClient_ListTemplateStore_Call) RunAndReturn(run func() ([]v1alpha1.TemplateStore, error)) *IKubernetesClient_ListTemplateStore_Call { + _c.Call.Return(run) + return _c +} + +// Restart provides a mock function with given fields: group, _a1, kind, name, namespace +func (_m *IKubernetesClient) Restart(group string, _a1 string, kind string, name string, namespace string) error { + ret := _m.Called(group, _a1, kind, name, namespace) + + if len(ret) == 0 { + panic("no return value specified for Restart") + } + + var r0 error + if rf, ok := ret.Get(0).(func(string, string, string, string, string) error); ok { + r0 = rf(group, _a1, kind, name, namespace) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// IKubernetesClient_Restart_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Restart' +type IKubernetesClient_Restart_Call struct { + *mock.Call +} + +// Restart is a helper method to define mock.On call +// - group string +// - _a1 string +// - kind string +// - name string +// - namespace string +func (_e *IKubernetesClient_Expecter) Restart(group interface{}, _a1 interface{}, kind interface{}, name interface{}, namespace interface{}) *IKubernetesClient_Restart_Call { + return &IKubernetesClient_Restart_Call{Call: _e.mock.On("Restart", group, _a1, kind, name, namespace)} +} + +func (_c *IKubernetesClient_Restart_Call) Run(run func(group string, _a1 string, kind string, name string, namespace string)) *IKubernetesClient_Restart_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string), args[2].(string), args[3].(string), args[4].(string)) + }) + return _c +} + +func (_c *IKubernetesClient_Restart_Call) Return(_a0 error) *IKubernetesClient_Restart_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *IKubernetesClient_Restart_Call) RunAndReturn(run func(string, string, string, string, string) error) *IKubernetesClient_Restart_Call { + _c.Call.Return(run) + return _c +} + +// RestartDaemonSet provides a mock function with given fields: name, namespace +func (_m *IKubernetesClient) RestartDaemonSet(name string, namespace string) error { + ret := _m.Called(name, namespace) + + if len(ret) == 0 { + panic("no return value specified for RestartDaemonSet") + } + + var r0 error + if rf, ok := ret.Get(0).(func(string, string) error); ok { + r0 = rf(name, namespace) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// IKubernetesClient_RestartDaemonSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RestartDaemonSet' +type IKubernetesClient_RestartDaemonSet_Call struct { + *mock.Call +} + +// RestartDaemonSet is a helper method to define mock.On call +// - name string +// - namespace string +func (_e *IKubernetesClient_Expecter) RestartDaemonSet(name interface{}, namespace interface{}) *IKubernetesClient_RestartDaemonSet_Call { + return &IKubernetesClient_RestartDaemonSet_Call{Call: _e.mock.On("RestartDaemonSet", name, namespace)} +} + +func (_c *IKubernetesClient_RestartDaemonSet_Call) Run(run func(name string, namespace string)) *IKubernetesClient_RestartDaemonSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string)) + }) + return _c +} + +func (_c *IKubernetesClient_RestartDaemonSet_Call) Return(_a0 error) *IKubernetesClient_RestartDaemonSet_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *IKubernetesClient_RestartDaemonSet_Call) RunAndReturn(run func(string, string) error) *IKubernetesClient_RestartDaemonSet_Call { + _c.Call.Return(run) + return _c +} + +// RestartDeployment provides a mock function with given fields: name, namespace +func (_m *IKubernetesClient) RestartDeployment(name string, namespace string) error { + ret := _m.Called(name, namespace) + + if len(ret) == 0 { + panic("no return value specified for RestartDeployment") + } + + var r0 error + if rf, ok := ret.Get(0).(func(string, string) error); ok { + r0 = rf(name, namespace) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// IKubernetesClient_RestartDeployment_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RestartDeployment' +type IKubernetesClient_RestartDeployment_Call struct { + *mock.Call +} + +// RestartDeployment is a helper method to define mock.On call +// - name string +// - namespace string +func (_e *IKubernetesClient_Expecter) RestartDeployment(name interface{}, namespace interface{}) *IKubernetesClient_RestartDeployment_Call { + return &IKubernetesClient_RestartDeployment_Call{Call: _e.mock.On("RestartDeployment", name, namespace)} +} + +func (_c *IKubernetesClient_RestartDeployment_Call) Run(run func(name string, namespace string)) *IKubernetesClient_RestartDeployment_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string)) + }) + return _c +} + +func (_c *IKubernetesClient_RestartDeployment_Call) Return(_a0 error) *IKubernetesClient_RestartDeployment_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *IKubernetesClient_RestartDeployment_Call) RunAndReturn(run func(string, string) error) *IKubernetesClient_RestartDeployment_Call { + _c.Call.Return(run) + return _c +} + +// RestartStatefulSet provides a mock function with given fields: name, namespace +func (_m *IKubernetesClient) RestartStatefulSet(name string, namespace string) error { + ret := _m.Called(name, namespace) + + if len(ret) == 0 { + panic("no return value specified for RestartStatefulSet") + } + + var r0 error + if rf, ok := ret.Get(0).(func(string, string) error); ok { + r0 = rf(name, namespace) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// IKubernetesClient_RestartStatefulSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RestartStatefulSet' +type IKubernetesClient_RestartStatefulSet_Call struct { + *mock.Call +} + +// RestartStatefulSet is a helper method to define mock.On call +// - name string +// - namespace string +func (_e *IKubernetesClient_Expecter) RestartStatefulSet(name interface{}, namespace interface{}) *IKubernetesClient_RestartStatefulSet_Call { + return &IKubernetesClient_RestartStatefulSet_Call{Call: _e.mock.On("RestartStatefulSet", name, namespace)} +} + +func (_c *IKubernetesClient_RestartStatefulSet_Call) Run(run func(name string, namespace string)) *IKubernetesClient_RestartStatefulSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string)) + }) + return _c +} + +func (_c *IKubernetesClient_RestartStatefulSet_Call) Return(_a0 error) *IKubernetesClient_RestartStatefulSet_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *IKubernetesClient_RestartStatefulSet_Call) RunAndReturn(run func(string, string) error) *IKubernetesClient_RestartStatefulSet_Call { + _c.Call.Return(run) + return _c +} + +// UpdateModule provides a mock function with given fields: module +func (_m *IKubernetesClient) UpdateModule(module *v1alpha1.Module) error { + ret := _m.Called(module) + + if len(ret) == 0 { + panic("no return value specified for UpdateModule") + } + + var r0 error + if rf, ok := ret.Get(0).(func(*v1alpha1.Module) error); ok { + r0 = rf(module) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// IKubernetesClient_UpdateModule_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateModule' +type IKubernetesClient_UpdateModule_Call struct { + *mock.Call +} + +// UpdateModule is a helper method to define mock.On call +// - module *v1alpha1.Module +func (_e *IKubernetesClient_Expecter) UpdateModule(module interface{}) *IKubernetesClient_UpdateModule_Call { + return &IKubernetesClient_UpdateModule_Call{Call: _e.mock.On("UpdateModule", module)} +} + +func (_c *IKubernetesClient_UpdateModule_Call) Run(run func(module *v1alpha1.Module)) *IKubernetesClient_UpdateModule_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*v1alpha1.Module)) + }) + return _c +} + +func (_c *IKubernetesClient_UpdateModule_Call) Return(_a0 error) *IKubernetesClient_UpdateModule_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *IKubernetesClient_UpdateModule_Call) RunAndReturn(run func(*v1alpha1.Module) error) *IKubernetesClient_UpdateModule_Call { + _c.Call.Return(run) + return _c +} + +// UpdateModuleStatus provides a mock function with given fields: module +func (_m *IKubernetesClient) UpdateModuleStatus(module *v1alpha1.Module) (*v1alpha1.Module, error) { + ret := _m.Called(module) + + if len(ret) == 0 { + panic("no return value specified for UpdateModuleStatus") + } + + var r0 *v1alpha1.Module + var r1 error + if rf, ok := ret.Get(0).(func(*v1alpha1.Module) (*v1alpha1.Module, error)); ok { + return rf(module) + } + if rf, ok := ret.Get(0).(func(*v1alpha1.Module) *v1alpha1.Module); ok { + r0 = rf(module) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*v1alpha1.Module) + } + } + + if rf, ok := ret.Get(1).(func(*v1alpha1.Module) error); ok { + r1 = rf(module) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// IKubernetesClient_UpdateModuleStatus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateModuleStatus' +type IKubernetesClient_UpdateModuleStatus_Call struct { + *mock.Call +} + +// UpdateModuleStatus is a helper method to define mock.On call +// - module *v1alpha1.Module +func (_e *IKubernetesClient_Expecter) UpdateModuleStatus(module interface{}) *IKubernetesClient_UpdateModuleStatus_Call { + return &IKubernetesClient_UpdateModuleStatus_Call{Call: _e.mock.On("UpdateModuleStatus", module)} +} + +func (_c *IKubernetesClient_UpdateModuleStatus_Call) Run(run func(module *v1alpha1.Module)) *IKubernetesClient_UpdateModuleStatus_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*v1alpha1.Module)) + }) + return _c +} + +func (_c *IKubernetesClient_UpdateModuleStatus_Call) Return(_a0 *v1alpha1.Module, _a1 error) *IKubernetesClient_UpdateModuleStatus_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *IKubernetesClient_UpdateModuleStatus_Call) RunAndReturn(run func(*v1alpha1.Module) (*v1alpha1.Module, error)) *IKubernetesClient_UpdateModuleStatus_Call { + _c.Call.Return(run) + return _c +} + +// UpdateTemplateStore provides a mock function with given fields: ts +func (_m *IKubernetesClient) UpdateTemplateStore(ts *v1alpha1.TemplateStore) error { + ret := _m.Called(ts) + + if len(ret) == 0 { + panic("no return value specified for UpdateTemplateStore") + } + + var r0 error + if rf, ok := ret.Get(0).(func(*v1alpha1.TemplateStore) error); ok { + r0 = rf(ts) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// IKubernetesClient_UpdateTemplateStore_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateTemplateStore' +type IKubernetesClient_UpdateTemplateStore_Call struct { + *mock.Call +} + +// UpdateTemplateStore is a helper method to define mock.On call +// - ts *v1alpha1.TemplateStore +func (_e *IKubernetesClient_Expecter) UpdateTemplateStore(ts interface{}) *IKubernetesClient_UpdateTemplateStore_Call { + return &IKubernetesClient_UpdateTemplateStore_Call{Call: _e.mock.On("UpdateTemplateStore", ts)} +} + +func (_c *IKubernetesClient_UpdateTemplateStore_Call) Run(run func(ts *v1alpha1.TemplateStore)) *IKubernetesClient_UpdateTemplateStore_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*v1alpha1.TemplateStore)) + }) + return _c +} + +func (_c *IKubernetesClient_UpdateTemplateStore_Call) Return(_a0 error) *IKubernetesClient_UpdateTemplateStore_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *IKubernetesClient_UpdateTemplateStore_Call) RunAndReturn(run func(*v1alpha1.TemplateStore) error) *IKubernetesClient_UpdateTemplateStore_Call { + _c.Call.Return(run) + return _c +} + +// VersionInfo provides a mock function with given fields: +func (_m *IKubernetesClient) VersionInfo() (*version.Info, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for VersionInfo") + } + + var r0 *version.Info + var r1 error + if rf, ok := ret.Get(0).(func() (*version.Info, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() *version.Info); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*version.Info) + } + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// IKubernetesClient_VersionInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'VersionInfo' +type IKubernetesClient_VersionInfo_Call struct { + *mock.Call +} + +// VersionInfo is a helper method to define mock.On call +func (_e *IKubernetesClient_Expecter) VersionInfo() *IKubernetesClient_VersionInfo_Call { + return &IKubernetesClient_VersionInfo_Call{Call: _e.mock.On("VersionInfo")} +} + +func (_c *IKubernetesClient_VersionInfo_Call) Run(run func()) *IKubernetesClient_VersionInfo_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *IKubernetesClient_VersionInfo_Call) Return(_a0 *version.Info, _a1 error) *IKubernetesClient_VersionInfo_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *IKubernetesClient_VersionInfo_Call) RunAndReturn(run func() (*version.Info, error)) *IKubernetesClient_VersionInfo_Call { + _c.Call.Return(run) + return _c +} + +// WatchKubernetesResources provides a mock function with given fields: gvrs, stopCh +func (_m *IKubernetesClient) WatchKubernetesResources(gvrs []k8sclient.ResourceWatchSpec, stopCh chan struct{}) (chan *unstructured.Unstructured, error) { + ret := _m.Called(gvrs, stopCh) + + if len(ret) == 0 { + panic("no return value specified for WatchKubernetesResources") + } + + var r0 chan *unstructured.Unstructured + var r1 error + if rf, ok := ret.Get(0).(func([]k8sclient.ResourceWatchSpec, chan struct{}) (chan *unstructured.Unstructured, error)); ok { + return rf(gvrs, stopCh) + } + if rf, ok := ret.Get(0).(func([]k8sclient.ResourceWatchSpec, chan struct{}) chan *unstructured.Unstructured); ok { + r0 = rf(gvrs, stopCh) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(chan *unstructured.Unstructured) + } + } + + if rf, ok := ret.Get(1).(func([]k8sclient.ResourceWatchSpec, chan struct{}) error); ok { + r1 = rf(gvrs, stopCh) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// IKubernetesClient_WatchKubernetesResources_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchKubernetesResources' +type IKubernetesClient_WatchKubernetesResources_Call struct { + *mock.Call +} + +// WatchKubernetesResources is a helper method to define mock.On call +// - gvrs []k8sclient.ResourceWatchSpec +// - stopCh chan struct{} +func (_e *IKubernetesClient_Expecter) WatchKubernetesResources(gvrs interface{}, stopCh interface{}) *IKubernetesClient_WatchKubernetesResources_Call { + return &IKubernetesClient_WatchKubernetesResources_Call{Call: _e.mock.On("WatchKubernetesResources", gvrs, stopCh)} +} + +func (_c *IKubernetesClient_WatchKubernetesResources_Call) Run(run func(gvrs []k8sclient.ResourceWatchSpec, stopCh chan struct{})) *IKubernetesClient_WatchKubernetesResources_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]k8sclient.ResourceWatchSpec), args[1].(chan struct{})) + }) + return _c +} + +func (_c *IKubernetesClient_WatchKubernetesResources_Call) Return(_a0 chan *unstructured.Unstructured, _a1 error) *IKubernetesClient_WatchKubernetesResources_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *IKubernetesClient_WatchKubernetesResources_Call) RunAndReturn(run func([]k8sclient.ResourceWatchSpec, chan struct{}) (chan *unstructured.Unstructured, error)) *IKubernetesClient_WatchKubernetesResources_Call { + _c.Call.Return(run) + return _c +} + +// WatchResource provides a mock function with given fields: group, _a1, resource, name, namespace +func (_m *IKubernetesClient) WatchResource(group string, _a1 string, resource string, name string, namespace string) (watch.Interface, error) { + ret := _m.Called(group, _a1, resource, name, namespace) + + if len(ret) == 0 { + panic("no return value specified for WatchResource") + } + + var r0 watch.Interface + var r1 error + if rf, ok := ret.Get(0).(func(string, string, string, string, string) (watch.Interface, error)); ok { + return rf(group, _a1, resource, name, namespace) + } + if rf, ok := ret.Get(0).(func(string, string, string, string, string) watch.Interface); ok { + r0 = rf(group, _a1, resource, name, namespace) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(watch.Interface) + } + } + + if rf, ok := ret.Get(1).(func(string, string, string, string, string) error); ok { + r1 = rf(group, _a1, resource, name, namespace) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// IKubernetesClient_WatchResource_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchResource' +type IKubernetesClient_WatchResource_Call struct { + *mock.Call +} + +// WatchResource is a helper method to define mock.On call +// - group string +// - _a1 string +// - resource string +// - name string +// - namespace string +func (_e *IKubernetesClient_Expecter) WatchResource(group interface{}, _a1 interface{}, resource interface{}, name interface{}, namespace interface{}) *IKubernetesClient_WatchResource_Call { + return &IKubernetesClient_WatchResource_Call{Call: _e.mock.On("WatchResource", group, _a1, resource, name, namespace)} +} + +func (_c *IKubernetesClient_WatchResource_Call) Run(run func(group string, _a1 string, resource string, name string, namespace string)) *IKubernetesClient_WatchResource_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string), args[2].(string), args[3].(string), args[4].(string)) + }) + return _c +} + +func (_c *IKubernetesClient_WatchResource_Call) Return(_a0 watch.Interface, _a1 error) *IKubernetesClient_WatchResource_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *IKubernetesClient_WatchResource_Call) RunAndReturn(run func(string, string, string, string, string) (watch.Interface, error)) *IKubernetesClient_WatchResource_Call { + _c.Call.Return(run) + return _c +} + +// NewIKubernetesClient creates a new instance of IKubernetesClient. 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 NewIKubernetesClient(t interface { + mock.TestingT + Cleanup(func()) +}) *IKubernetesClient { + mock := &IKubernetesClient{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +}