Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
pkazmierczak committed Aug 4, 2022
1 parent cf3dffa commit 03e6dab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions client/allocrunner/taskrunner/template/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion client/allocrunner/taskrunner/template_hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 03e6dab

Please sign in to comment.