From 383da4893bd161e3f3e4578d688e63dfaa14a39b Mon Sep 17 00:00:00 2001 From: uturunku1 Date: Thu, 13 Jan 2022 16:37:29 -0500 Subject: [PATCH] use new enum string for task stages --- internal/cloud/backend_plan.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/cloud/backend_plan.go b/internal/cloud/backend_plan.go index ad24f8525..32b35a413 100644 --- a/internal/cloud/backend_plan.go +++ b/internal/cloud/backend_plan.go @@ -372,7 +372,7 @@ in order to capture the filesystem context the remote workspace expects: Run: r, } - if stageID := getTaskStageIDByName(r.TaskStages, "pre_apply"); stageID != nil { + if stageID := getTaskStageIDByName(r.TaskStages, tfe.PreApply); stageID != nil { err = b.runTasks(integration, integration.BeginOutput("Run Tasks (pre-apply)"), *stageID) if err != nil { return r, err @@ -383,9 +383,9 @@ in order to capture the filesystem context the remote workspace expects: return r, nil } -func getTaskStageIDByName(stages []*tfe.TaskStage, name string) *string { +func getTaskStageIDByName(stages []*tfe.TaskStage, stageName tfe.Stage) *string { for _, stage := range stages { - if stage.Stage == name { + if stage.Stage == stageName { return &stage.ID } }