Skip to content

Commit

Permalink
Bump shell-operator (#507)
Browse files Browse the repository at this point in the history
  • Loading branch information
yalosev authored Sep 26, 2024
1 parent d902195 commit 2aac189
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 14 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/dominikbraun/graph v0.23.0
github.com/ettle/strcase v0.2.0
github.com/flant/kube-client v1.1.0
github.com/flant/shell-operator v1.4.11
github.com/flant/shell-operator v1.4.12
github.com/go-chi/chi/v5 v5.1.0
github.com/go-openapi/loads v0.19.5
github.com/go-openapi/spec v0.19.8
Expand Down
6 changes: 6 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,12 @@ github.com/flant/libjq-go v1.6.3-0.20201126171326-c46a40ff22ee h1:evii83J+/6QGNv
github.com/flant/libjq-go v1.6.3-0.20201126171326-c46a40ff22ee/go.mod h1:f+REaGl/+pZR97rbTcwHEka/MAipoQQ2Mc0iQUj4ak0=
github.com/flant/shell-operator v1.4.11 h1:31HJuLEvAbi7gIIWa3eJelviUL7iYQS6fiBkTSN7jgc=
github.com/flant/shell-operator v1.4.11/go.mod h1:/edae+IoeSilX6CpSrMsdn5eE5/CEwBjZAR5DFPu+hc=
github.com/flant/shell-operator v1.4.12-0.20240926141536-4c47f832ee65 h1:ATz0oGPSAMptjFAR9OIqEcr1QqYpjebMIBQ609dNIT8=
github.com/flant/shell-operator v1.4.12-0.20240926141536-4c47f832ee65/go.mod h1:/edae+IoeSilX6CpSrMsdn5eE5/CEwBjZAR5DFPu+hc=
github.com/flant/shell-operator v1.4.12-0.20240926141852-4fdec1eaf695 h1:LnuBolzKCMc0+RpDw8Q6GmBltEGLsX0fp+bHWQIbqu0=
github.com/flant/shell-operator v1.4.12-0.20240926141852-4fdec1eaf695/go.mod h1:/edae+IoeSilX6CpSrMsdn5eE5/CEwBjZAR5DFPu+hc=
github.com/flant/shell-operator v1.4.12 h1:SsuxBdEclTNUtVBNZGcuSl4A7+H3X0ClrDFf4FVCcjc=
github.com/flant/shell-operator v1.4.12/go.mod h1:/edae+IoeSilX6CpSrMsdn5eE5/CEwBjZAR5DFPu+hc=
github.com/fogleman/gg v1.3.0 h1:/7zJX8F6AaYQc57WQCyN9cAIz+4bCJGO9B+dyW29am8=
github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k=
github.com/foxcpp/go-mockdns v1.0.0 h1:7jBqxd3WDWwi/6WhDvacvH1XsN3rOLXyHM1uhvIx6FI=
Expand Down
4 changes: 2 additions & 2 deletions pkg/module_manager/models/hooks/dependency.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ type executableHook interface {
Execute(configVersion string, bContext []binding_context.BindingContext, moduleSafeName string, configValues, values utils.Values, logLabels map[string]string) (result *kind.HookResult, err error)
RateLimitWait(ctx context.Context) error

WithHookController(ctrl controller.HookController)
GetHookController() controller.HookController
WithHookController(ctrl *controller.HookController)
GetHookController() *controller.HookController
WithTmpDir(tmpDir string)

GetKind() kind.HookKind
Expand Down
4 changes: 2 additions & 2 deletions pkg/module_manager/models/hooks/kind/gohook.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ func (h *GoHook) AddMetadata(meta *go_hook.HookMetadata) {
}

// WithHookController sets dependency "hook controller" for shell-operator
func (h *GoHook) WithHookController(hookController controller.HookController) {
func (h *GoHook) WithHookController(hookController *controller.HookController) {
h.basicHook.HookController = hookController
}

// GetHookController returns HookController
func (h *GoHook) GetHookController() controller.HookController {
func (h *GoHook) GetHookController() *controller.HookController {
return h.basicHook.HookController
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/module_manager/models/hooks/kind/shellhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func (sh *ShellHook) BackportHookConfig(cfg *config.HookConfig) {
}

// WithHookController sets dependency "hook controller" for shell-operator
func (sh *ShellHook) WithHookController(hookController controller.HookController) {
func (sh *ShellHook) WithHookController(hookController *controller.HookController) {
sh.HookController = hookController
}

Expand All @@ -56,7 +56,7 @@ func (sh *ShellHook) GetPath() string {
}

// GetHookController returns HookController
func (sh *ShellHook) GetHookController() controller.HookController {
func (sh *ShellHook) GetHookController() *controller.HookController {
return sh.HookController
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/module_manager/models/hooks/module_hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func (mh *ModuleHook) SynchronizationNeeded() bool {
}

// WithHookController set HookController for shell-operator
func (mh *ModuleHook) WithHookController(ctrl controller.HookController) {
func (mh *ModuleHook) WithHookController(ctrl *controller.HookController) {
mh.executableHook.WithHookController(ctrl)
}

Expand Down
12 changes: 6 additions & 6 deletions pkg/task/hook_metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (

log "github.com/sirupsen/logrus"

. "github.com/flant/shell-operator/pkg/hook/binding_context"
"github.com/flant/shell-operator/pkg/hook/binding_context"
"github.com/flant/shell-operator/pkg/hook/task_metadata"
. "github.com/flant/shell-operator/pkg/hook/types"
"github.com/flant/shell-operator/pkg/hook/types"
"github.com/flant/shell-operator/pkg/task"
)

Expand All @@ -19,8 +19,8 @@ type HookMetadata struct {
HookName string
ModuleName string
Binding string // binding name from configuration
BindingType BindingType
BindingContext []BindingContext
BindingType types.BindingType
BindingContext []binding_context.BindingContext
AllowFailure bool // Task considered as 'ok' if hook failed. False by default. Can be true for some schedule hooks.

DoModuleStartup bool // Execute onStartup and kubernetes@Synchronization hooks for module
Expand All @@ -41,7 +41,7 @@ var (
_ task_metadata.HookNameAccessor = HookMetadata{}
_ task_metadata.BindingContextAccessor = HookMetadata{}
_ task_metadata.MonitorIDAccessor = HookMetadata{}
_ task.MetadataDescriptable = HookMetadata{}
_ task.MetadataDescriptionGetter = HookMetadata{}
)

func HookMetadataAccessor(t task.Task) (meta HookMetadata) {
Expand Down Expand Up @@ -99,7 +99,7 @@ func (hm HookMetadata) GetHookName() string {
return hm.HookName
}

func (hm HookMetadata) GetBindingContext() []BindingContext {
func (hm HookMetadata) GetBindingContext() []binding_context.BindingContext {
return hm.BindingContext
}

Expand Down

0 comments on commit 2aac189

Please sign in to comment.