Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
replace patchvalues with interface
Browse files Browse the repository at this point in the history
Signed-off-by: Pavel Okhlopkov <[email protected]>
Pavel Okhlopkov committed Dec 9, 2024
1 parent 5592f5b commit e1d6fdd
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions pkg/module_manager/go_hook/go_hook.go
Original file line number Diff line number Diff line change
@@ -7,10 +7,12 @@ import (
"time"

"github.com/deckhouse/deckhouse/pkg/log"
"github.com/tidwall/gjson"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"

"github.com/flant/addon-operator/pkg/module_manager/go_hook/metrics"
"github.com/flant/addon-operator/pkg/utils"
objectpatch "github.com/flant/shell-operator/pkg/kube/object_patch"
"github.com/flant/shell-operator/pkg/kube_events_manager/types"
)
@@ -88,10 +90,21 @@ type PatchCollector interface {
Operations() []objectpatch.Operation
}

type PatchableValuesCollector interface {
ArrayCount(path string) (int, error)
Exists(path string) bool
Get(path string) gjson.Result
GetOk(path string) (gjson.Result, bool)
GetPatches() []*utils.ValuesPatchOperation
GetRaw(path string) interface{}
Remove(path string)
Set(path string, value interface{})
}

type HookInput struct {
Snapshots Snapshots
Values *PatchableValues
ConfigValues *PatchableValues
Values PatchableValuesCollector
ConfigValues PatchableValuesCollector
MetricsCollector MetricsCollector
PatchCollector PatchCollector
Logger Logger

0 comments on commit e1d6fdd

Please sign in to comment.