From 03e6dab4142747a0593bd3c043d6fe62aa0d64a3 Mon Sep 17 00:00:00 2001 From: Peter Kazmierczak Date: Thu, 4 Aug 2022 11:22:58 +0200 Subject: [PATCH] wip --- client/allocrunner/taskrunner/template/template.go | 5 +++-- client/allocrunner/taskrunner/template_hook.go | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/client/allocrunner/taskrunner/template/template.go b/client/allocrunner/taskrunner/template/template.go index a19162b77377..53c324fe88cc 100644 --- a/client/allocrunner/taskrunner/template/template.go +++ b/client/allocrunner/taskrunner/template/template.go @@ -109,7 +109,8 @@ type TaskTemplateManagerConfig struct { // NomadToken is the Nomad token or identity claim for the task NomadToken string - Handle interfaces.ScriptExecutor + // ExecHandle is used to execute scripts + ExecHandle interfaces.ScriptExecutor } // Validate validates the configuration. @@ -439,7 +440,7 @@ func (tm *TaskTemplateManager) onTemplateRendered(handledRenders map[string]time case structs.TemplateChangeModeRestart: restart = true case structs.TemplateChangeModeScript: - // do stuff + tm.config.ExecHandle.Exec(time.Minute, "", []string{}) // FIXME: figure out how to pass this case structs.TemplateChangeModeNoop: continue } diff --git a/client/allocrunner/taskrunner/template_hook.go b/client/allocrunner/taskrunner/template_hook.go index 0f634c83284c..b2dfe7be03af 100644 --- a/client/allocrunner/taskrunner/template_hook.go +++ b/client/allocrunner/taskrunner/template_hook.go @@ -133,7 +133,7 @@ func (h *templateHook) newManager() (unblock chan struct{}, err error) { MaxTemplateEventRate: template.DefaultMaxTemplateEventRate, NomadNamespace: h.config.nomadNamespace, NomadToken: h.nomadToken, - Handle: h.config.handle, + ExecHandle: h.config.handle, }) if err != nil { h.logger.Error("failed to create template manager", "error", err)