Files
41536738c8 refactor(cd): hard-fork - rename CRD API group argoproj.io -> deploy.hanzo.ai (#1)
* feat(api): hard-fork CRD API group argoproj.io -> deploy.hanzo.ai

Hanzo CD hard-fork, phase 1.1. Single source of truth is
pkg/apis/application/register.go's Group constant (Application/AppProject/
ApplicationSet all derive their FullName from it); every other Go call-site
that hardcoded the literal group string is updated to match: the 3 generated
informer GVRs, the app-of-apps nested-Application detector in types.go, the
resource-tree Application-kind cache populator, the 3 NotFound error
constructors in server/application, and the applicationset-controller's
leader-election Lease name/ID (kept in lockstep across Go source + RBAC
resourceNames, or leader election would get RBAC-denied on startup).

CRD YAMLs (application/appproject/applicationset) and every RBAC apiGroups
rule that actually governs our 3 CRDs are repointed to deploy.hanzo.ai, across
both manifests/base/* (namespaced Roles) and manifests/cluster-rbac/* (cluster
scope). Two adjacent things that share the "argoproj.io" string but are NOT
ours are deliberately left untouched: gitops-engine's health-check dispatch
for Argo Workflows' `Workflow` kind, and argocd-server-clusterrole's second
apiGroups block granting read on Argo Workflows' `workflows` resource — both
belong to a separate, unrelated Argoproj-family project we are not forking.

Also untouched, per explicit scope: annotation/label keys (argocd.argoproj.io/*)
and finalizers (*.argoproj.io) that track already-applied live resources, and
argocd-cm.yaml's resource.customizations.ignoreResourceUpdates keys (a narrow
app-of-apps diffing nicety, not build- or RBAC-relevant).

CGO_ENABLED=0 go build ./... verified green.

* ci: wire canonical hanzo.yml + cicd.yml (Hanzo CD image build)

Phase 1.3. Follows the same one-way pattern every hanzo/lux/zoo repo uses:
hanzo.yml declares the image (root Dockerfile -> ghcr.io/hanzoai/deploy) and a
fast go-build sanity test (the multi-stage Dockerfile build is the slow, real
gate); cicd.yml is the ~10-line trigger shim importing hanzoai/ci's reusable
build workflow on the arc pool, secrets from KMS only.

No `deploy:` block yet, matching the hanzoai/cms build-only-first-cutover
pattern: this repo's own live hanzo-cd namespace runs the whole Hanzo fleet's
GitOps, so the prod image/CRD swap is a deliberate separate action (see the
[HELD] universe PR), never an automatic rollout on merge. Every PR/push still
builds and pushes an immutable ghcr.io/hanzoai/deploy:sha-<7>-amd64 image.

* feat(ui): rebrand Argo CD -> Hanzo CD (title, favicon, logo, sidebar)

Phase 1.2. User-facing "Argo CD"/"ArgoCD" text replaced with "Hanzo CD"
across the login page, help modal, settings screens, version-info panel,
sync-options warning, fullscreen-logs title, app.tsx page titles, and
index.html's <title>/noscript text (dropped the now-wrong upstream CLI
doc link rather than invent a hanzo.ai URL that doesn't exist).

Logo/favicon assets replaced with the canonical Hanzo mark (never
hand-drawn, copied from ~/work/hanzo/logo/dist): the two real usages of
Argo's logo collapse onto one Hanzo glyph (mono + white variants) at the
same 5 call sites (login icon + footer, login.scss $logoPath/
$logoNegativePath, sidebar text-logo), preserving the existing CSS
invert() filters so both the light login panel and dark sidebar still
render correctly. Old argologo.svg/argo_o.svg/argo.png deleted (no
longer referenced). favicon-{16x16,32x32}.png added at
ui/src/assets/favicon/ (index.html's links to that path were previously
dead - the directory didn't exist in this checkout). package.json name
argo-cd-ui -> hanzo-cd-ui.

Left alone, deliberately: the two Kubernetes resource-kind icon sets
under ui/src/assets/images/resources/ (unrelated to branding), and
upstream doc/project links (argoproj.io, argo-cd.readthedocs.io) since
we have no equivalent hanzo.ai docs to point to yet - except the login
footer logo's outbound link, which now points to hanzo.ai instead of
argoproj.io (a Hanzo-branded mark linking to the upstream project it
was forked from read as an obvious leftover).

* feat(module): rename Go module github.com/argoproj/argo-cd/v3 -> github.com/hanzoai/deploy

Phase 2. No version suffix on the new path (org policy: never publish our
own Go modules above v1.x.x / with a v2+ suffix) — this fork starts a fresh
v0/v1 module identity rather than carrying the v3 the upstream fork point
had reached.

Mechanical, symmetric rewrite: 704 .go files (import statements only; two
disjoint substitutions applied specific-first so the nested gitops-engine
module path never double-matches), plus go.mod (module line, the
gitops-engine require+replace pair, version reset to v0.0.0-... since a
suffix-less path can't carry a v3 semver), gitops-engine/go.mod, Makefile
(ldflags PACKAGE + 2 TEST_MODULE filters), .golangci.yaml, .goreleaser.yaml,
.mockery.yaml (+ gitops-engine's), Procfile, the codegen/proto generation
scripts (hack/generate-proto.sh, update-codegen.sh, update-openapi.sh), and
20 .proto files' go_package options. Also one OpenTelemetry tracer name
string in gitops-engine/pkg/sync/sync_context.go (a cosmestic label, not an
import, but worth keeping consistent).

CGO_ENABLED=0 go build ./... verified green for both the root module and
the nested gitops-engine module; go vet clean on both; go mod tidy run
(network available) to reconcile go.sum, dependency set unchanged.

Left alone, deliberately: doc-only mentions (docs/snyk/*.html scan reports,
gitops-engine/README.md), a comment-only reference in
.github/workflows/release.yaml, and one Renovate bot config line — none are
build- or codegen-load-bearing. Also left alone: comments citing upstream
GitHub issue URLs (github.com/argoproj/argo-cd/issues/NNNNN) and a handful
of test fixtures using "https://github.com/argoproj/argo-cd.git" as a
representative example repo URL — both are accurate historical/test-data
references, not stale self-references.

---------

Co-authored-by: Hanzo Dev <[email protected]>
2026-07-29 18:27:58 -07:00

695 lines
22 KiB
Go
Generated

// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify
package mocks
import (
"context"
"github.com/hanzoai/deploy/gitops-engine/pkg/cache"
"github.com/hanzoai/deploy/gitops-engine/pkg/utils/kube"
cache0 "github.com/hanzoai/deploy/controller/cache"
"github.com/hanzoai/deploy/pkg/apis/application/v1alpha1"
mock "github.com/stretchr/testify/mock"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime/schema"
)
// 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)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// LiveStateCache is an autogenerated mock type for the LiveStateCache type
type LiveStateCache struct {
mock.Mock
}
type LiveStateCache_Expecter struct {
mock *mock.Mock
}
func (_m *LiveStateCache) EXPECT() *LiveStateCache_Expecter {
return &LiveStateCache_Expecter{mock: &_m.Mock}
}
// GetClusterCache provides a mock function for the type LiveStateCache
func (_mock *LiveStateCache) GetClusterCache(server *v1alpha1.Cluster) (cache.ClusterCache, error) {
ret := _mock.Called(server)
if len(ret) == 0 {
panic("no return value specified for GetClusterCache")
}
var r0 cache.ClusterCache
var r1 error
if returnFunc, ok := ret.Get(0).(func(*v1alpha1.Cluster) (cache.ClusterCache, error)); ok {
return returnFunc(server)
}
if returnFunc, ok := ret.Get(0).(func(*v1alpha1.Cluster) cache.ClusterCache); ok {
r0 = returnFunc(server)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(cache.ClusterCache)
}
}
if returnFunc, ok := ret.Get(1).(func(*v1alpha1.Cluster) error); ok {
r1 = returnFunc(server)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// 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
// - server *v1alpha1.Cluster
func (_e *LiveStateCache_Expecter) GetClusterCache(server any) *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) {
var arg0 *v1alpha1.Cluster
if args[0] != nil {
arg0 = args[0].(*v1alpha1.Cluster)
}
run(
arg0,
)
})
return _c
}
func (_c *LiveStateCache_GetClusterCache_Call) Return(clusterCache cache.ClusterCache, err error) *LiveStateCache_GetClusterCache_Call {
_c.Call.Return(clusterCache, err)
return _c
}
func (_c *LiveStateCache_GetClusterCache_Call) RunAndReturn(run func(server *v1alpha1.Cluster) (cache.ClusterCache, error)) *LiveStateCache_GetClusterCache_Call {
_c.Call.Return(run)
return _c
}
// GetClustersInfo provides a mock function for the type LiveStateCache
func (_mock *LiveStateCache) GetClustersInfo() []cache.ClusterInfo {
ret := _mock.Called()
if len(ret) == 0 {
panic("no return value specified for GetClustersInfo")
}
var r0 []cache.ClusterInfo
if returnFunc, ok := ret.Get(0).(func() []cache.ClusterInfo); ok {
r0 = returnFunc()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]cache.ClusterInfo)
}
}
return r0
}
// 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
}
func (_c *LiveStateCache_GetClustersInfo_Call) Return(clusterInfos []cache.ClusterInfo) *LiveStateCache_GetClustersInfo_Call {
_c.Call.Return(clusterInfos)
return _c
}
func (_c *LiveStateCache_GetClustersInfo_Call) RunAndReturn(run func() []cache.ClusterInfo) *LiveStateCache_GetClustersInfo_Call {
_c.Call.Return(run)
return _c
}
// 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)
if len(ret) == 0 {
panic("no return value specified for GetManagedLiveObjs")
}
var r0 map[kube.ResourceKey]*unstructured.Unstructured
var r1 error
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)
}
if returnFunc, ok := ret.Get(0).(func(*v1alpha1.Cluster, *v1alpha1.Application, []*unstructured.Unstructured) map[kube.ResourceKey]*unstructured.Unstructured); ok {
r0 = returnFunc(destCluster, a, targetObjs)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(map[kube.ResourceKey]*unstructured.Unstructured)
}
}
if returnFunc, ok := ret.Get(1).(func(*v1alpha1.Cluster, *v1alpha1.Application, []*unstructured.Unstructured) error); ok {
r1 = returnFunc(destCluster, a, targetObjs)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// 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
// - destCluster *v1alpha1.Cluster
// - a *v1alpha1.Application
// - targetObjs []*unstructured.Unstructured
func (_e *LiveStateCache_Expecter) GetManagedLiveObjs(destCluster any, a any, targetObjs any) *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) {
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,
)
})
return _c
}
func (_c *LiveStateCache_GetManagedLiveObjs_Call) Return(resourceKeyToUnstructured map[kube.ResourceKey]*unstructured.Unstructured, err error) *LiveStateCache_GetManagedLiveObjs_Call {
_c.Call.Return(resourceKeyToUnstructured, err)
return _c
}
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 {
_c.Call.Return(run)
return _c
}
// 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)
if len(ret) == 0 {
panic("no return value specified for GetNamespaceTopLevelResources")
}
var r0 map[kube.ResourceKey]v1alpha1.ResourceNode
var r1 error
if returnFunc, ok := ret.Get(0).(func(*v1alpha1.Cluster, string) (map[kube.ResourceKey]v1alpha1.ResourceNode, error)); ok {
return returnFunc(server, namespace)
}
if returnFunc, ok := ret.Get(0).(func(*v1alpha1.Cluster, string) map[kube.ResourceKey]v1alpha1.ResourceNode); ok {
r0 = returnFunc(server, namespace)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(map[kube.ResourceKey]v1alpha1.ResourceNode)
}
}
if returnFunc, ok := ret.Get(1).(func(*v1alpha1.Cluster, string) error); ok {
r1 = returnFunc(server, namespace)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// 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
// - server *v1alpha1.Cluster
// - namespace string
func (_e *LiveStateCache_Expecter) GetNamespaceTopLevelResources(server any, namespace any) *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) {
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,
)
})
return _c
}
func (_c *LiveStateCache_GetNamespaceTopLevelResources_Call) Return(resourceKeyToResourceNode map[kube.ResourceKey]v1alpha1.ResourceNode, err error) *LiveStateCache_GetNamespaceTopLevelResources_Call {
_c.Call.Return(resourceKeyToResourceNode, err)
return _c
}
func (_c *LiveStateCache_GetNamespaceTopLevelResources_Call) RunAndReturn(run func(server *v1alpha1.Cluster, namespace string) (map[kube.ResourceKey]v1alpha1.ResourceNode, error)) *LiveStateCache_GetNamespaceTopLevelResources_Call {
_c.Call.Return(run)
return _c
}
// GetVersionsInfo provides a mock function for the type LiveStateCache
func (_mock *LiveStateCache) GetVersionsInfo(server *v1alpha1.Cluster) (string, []kube.APIResourceInfo, error) {
ret := _mock.Called(server)
if len(ret) == 0 {
panic("no return value specified for GetVersionsInfo")
}
var r0 string
var r1 []kube.APIResourceInfo
var r2 error
if returnFunc, ok := ret.Get(0).(func(*v1alpha1.Cluster) (string, []kube.APIResourceInfo, error)); ok {
return returnFunc(server)
}
if returnFunc, ok := ret.Get(0).(func(*v1alpha1.Cluster) string); ok {
r0 = returnFunc(server)
} else {
r0 = ret.Get(0).(string)
}
if returnFunc, ok := ret.Get(1).(func(*v1alpha1.Cluster) []kube.APIResourceInfo); ok {
r1 = returnFunc(server)
} else {
if ret.Get(1) != nil {
r1 = ret.Get(1).([]kube.APIResourceInfo)
}
}
if returnFunc, ok := ret.Get(2).(func(*v1alpha1.Cluster) error); ok {
r2 = returnFunc(server)
} else {
r2 = ret.Error(2)
}
return r0, r1, r2
}
// 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
// - server *v1alpha1.Cluster
func (_e *LiveStateCache_Expecter) GetVersionsInfo(server any) *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) {
var arg0 *v1alpha1.Cluster
if args[0] != nil {
arg0 = args[0].(*v1alpha1.Cluster)
}
run(
arg0,
)
})
return _c
}
func (_c *LiveStateCache_GetVersionsInfo_Call) Return(s string, aPIResourceInfos []kube.APIResourceInfo, err error) *LiveStateCache_GetVersionsInfo_Call {
_c.Call.Return(s, aPIResourceInfos, err)
return _c
}
func (_c *LiveStateCache_GetVersionsInfo_Call) RunAndReturn(run func(server *v1alpha1.Cluster) (string, []kube.APIResourceInfo, error)) *LiveStateCache_GetVersionsInfo_Call {
_c.Call.Return(run)
return _c
}
// Init provides a mock function for the type LiveStateCache
func (_mock *LiveStateCache) Init() error {
ret := _mock.Called()
if len(ret) == 0 {
panic("no return value specified for Init")
}
var r0 error
if returnFunc, ok := ret.Get(0).(func() error); ok {
r0 = returnFunc()
} else {
r0 = ret.Error(0)
}
return r0
}
// 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
}
func (_c *LiveStateCache_Init_Call) Return(err error) *LiveStateCache_Init_Call {
_c.Call.Return(err)
return _c
}
func (_c *LiveStateCache_Init_Call) RunAndReturn(run func() error) *LiveStateCache_Init_Call {
_c.Call.Return(run)
return _c
}
// 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)
if len(ret) == 0 {
panic("no return value specified for IsNamespaced")
}
var r0 bool
var r1 error
if returnFunc, ok := ret.Get(0).(func(*v1alpha1.Cluster, schema.GroupKind) (bool, error)); ok {
return returnFunc(server, gk)
}
if returnFunc, ok := ret.Get(0).(func(*v1alpha1.Cluster, schema.GroupKind) bool); ok {
r0 = returnFunc(server, gk)
} else {
r0 = ret.Get(0).(bool)
}
if returnFunc, ok := ret.Get(1).(func(*v1alpha1.Cluster, schema.GroupKind) error); ok {
r1 = returnFunc(server, gk)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// 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
// - server *v1alpha1.Cluster
// - gk schema.GroupKind
func (_e *LiveStateCache_Expecter) IsNamespaced(server any, gk any) *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) {
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,
)
})
return _c
}
func (_c *LiveStateCache_IsNamespaced_Call) Return(b bool, err error) *LiveStateCache_IsNamespaced_Call {
_c.Call.Return(b, err)
return _c
}
func (_c *LiveStateCache_IsNamespaced_Call) RunAndReturn(run func(server *v1alpha1.Cluster, gk schema.GroupKind) (bool, error)) *LiveStateCache_IsNamespaced_Call {
_c.Call.Return(run)
return _c
}
// 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)
if len(ret) == 0 {
panic("no return value specified for IterateHierarchyV2")
}
var r0 error
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)
} else {
r0 = ret.Error(0)
}
return r0
}
// 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
// - server *v1alpha1.Cluster
// - keys []kube.ResourceKey
// - action func(child v1alpha1.ResourceNode, appName string) bool
func (_e *LiveStateCache_Expecter) IterateHierarchyV2(server any, keys any, action any) *LiveStateCache_IterateHierarchyV2_Call {
return &LiveStateCache_IterateHierarchyV2_Call{Call: _e.mock.On("IterateHierarchyV2", server, keys, action)}
}
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 {
_c.Call.Run(func(args mock.Arguments) {
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,
)
})
return _c
}
func (_c *LiveStateCache_IterateHierarchyV2_Call) Return(err error) *LiveStateCache_IterateHierarchyV2_Call {
_c.Call.Return(err)
return _c
}
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 {
_c.Call.Return(run)
return _c
}
// 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)
if len(ret) == 0 {
panic("no return value specified for IterateResources")
}
var r0 error
if returnFunc, ok := ret.Get(0).(func(*v1alpha1.Cluster, func(res *cache.Resource, info *cache0.ResourceInfo)) error); ok {
r0 = returnFunc(server, callback)
} else {
r0 = ret.Error(0)
}
return r0
}
// 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
// - server *v1alpha1.Cluster
// - callback func(res *cache.Resource, info *cache0.ResourceInfo)
func (_e *LiveStateCache_Expecter) IterateResources(server any, callback any) *LiveStateCache_IterateResources_Call {
return &LiveStateCache_IterateResources_Call{Call: _e.mock.On("IterateResources", server, callback)}
}
func (_c *LiveStateCache_IterateResources_Call) Run(run func(server *v1alpha1.Cluster, callback func(res *cache.Resource, info *cache0.ResourceInfo))) *LiveStateCache_IterateResources_Call {
_c.Call.Run(func(args mock.Arguments) {
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,
)
})
return _c
}
func (_c *LiveStateCache_IterateResources_Call) Return(err error) *LiveStateCache_IterateResources_Call {
_c.Call.Return(err)
return _c
}
func (_c *LiveStateCache_IterateResources_Call) RunAndReturn(run func(server *v1alpha1.Cluster, callback func(res *cache.Resource, info *cache0.ResourceInfo)) error) *LiveStateCache_IterateResources_Call {
_c.Call.Return(run)
return _c
}
// Run provides a mock function for the type LiveStateCache
func (_mock *LiveStateCache) Run(ctx context.Context) error {
ret := _mock.Called(ctx)
if len(ret) == 0 {
panic("no return value specified for Run")
}
var r0 error
if returnFunc, ok := ret.Get(0).(func(context.Context) error); ok {
r0 = returnFunc(ctx)
} else {
r0 = ret.Error(0)
}
return r0
}
// 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
// - ctx context.Context
func (_e *LiveStateCache_Expecter) Run(ctx any) *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) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
run(
arg0,
)
})
return _c
}
func (_c *LiveStateCache_Run_Call) Return(err error) *LiveStateCache_Run_Call {
_c.Call.Return(err)
return _c
}
func (_c *LiveStateCache_Run_Call) RunAndReturn(run func(ctx context.Context) error) *LiveStateCache_Run_Call {
_c.Call.Return(run)
return _c
}
// UpdateShard provides a mock function for the type LiveStateCache
func (_mock *LiveStateCache) UpdateShard(shard int) bool {
ret := _mock.Called(shard)
if len(ret) == 0 {
panic("no return value specified for UpdateShard")
}
var r0 bool
if returnFunc, ok := ret.Get(0).(func(int) bool); ok {
r0 = returnFunc(shard)
} else {
r0 = ret.Get(0).(bool)
}
return r0
}
// 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
// - shard int
func (_e *LiveStateCache_Expecter) UpdateShard(shard any) *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) {
var arg0 int
if args[0] != nil {
arg0 = args[0].(int)
}
run(
arg0,
)
})
return _c
}
func (_c *LiveStateCache_UpdateShard_Call) Return(b bool) *LiveStateCache_UpdateShard_Call {
_c.Call.Return(b)
return _c
}
func (_c *LiveStateCache_UpdateShard_Call) RunAndReturn(run func(shard int) bool) *LiveStateCache_UpdateShard_Call {
_c.Call.Return(run)
return _c
}