From 3b424072f74b790456da5e3a2bd6353701508e6b Mon Sep 17 00:00:00 2001 From: Gareth George Date: Thu, 23 Jan 2025 20:39:59 -0800 Subject: [PATCH] fix: hooks fail to populate a non-nil Plan variable for system tasks --- internal/orchestrator/taskrunnerimpl.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/orchestrator/taskrunnerimpl.go b/internal/orchestrator/taskrunnerimpl.go index 8a6ddb85..202360a0 100644 --- a/internal/orchestrator/taskrunnerimpl.go +++ b/internal/orchestrator/taskrunnerimpl.go @@ -103,9 +103,10 @@ func (t *taskRunnerImpl) ExecuteHooks(ctx context.Context, events []v1.Hook_Cond if planID != "" { plan, _ = t.findPlan() vars.Plan = plan - } else { + } + if vars.Plan == nil { vars.Plan = &v1.Plan{ - Id: tasks.PlanForUnassociatedOperations, + Id: t.t.PlanID(), // make a fake plan that conveys only the ID, e.g. for unassociated operations OR system plan. } }