fix: hooks fail to populate a non-nil Plan variable for system tasks

This commit is contained in:
Gareth George
2025-01-23 20:40:03 -08:00
parent 3294e0a3d9
commit 3b424072f7
+3 -2
View File
@@ -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.
}
}