diff --git a/internal/cloud/backend_apply.go b/internal/cloud/backend_apply.go index b52719593..74d167673 100644 --- a/internal/cloud/backend_apply.go +++ b/internal/cloud/backend_apply.go @@ -42,7 +42,7 @@ func (b *Cloud) opApply(stopCtx, cancelCtx context.Context, op *backend.Operatio return nil, diags.Err() } - if op.Parallelism != defaultParallelism { + if b.ContextOpts != nil && b.ContextOpts.Parallelism != defaultParallelism { diags = diags.Append(tfdiags.Sourceless( tfdiags.Error, "Custom parallelism values are currently not supported", diff --git a/internal/cloud/backend_apply_test.go b/internal/cloud/backend_apply_test.go index 99d74c1cc..629074e0a 100644 --- a/internal/cloud/backend_apply_test.go +++ b/internal/cloud/backend_apply_test.go @@ -46,7 +46,6 @@ func testOperationApplyWithTimeout(t *testing.T, configDir string, timeout time. return &backend.Operation{ ConfigDir: configDir, ConfigLoader: configLoader, - Parallelism: defaultParallelism, PlanRefresh: true, StateLocker: clistate.NewLocker(timeout, stateLockerView), Type: backend.OperationTypeApply, @@ -223,7 +222,10 @@ func TestCloud_applyWithParallelism(t *testing.T) { op, configCleanup, done := testOperationApply(t, "./testdata/apply") defer configCleanup() - op.Parallelism = 3 + if b.ContextOpts == nil { + b.ContextOpts = &terraform.ContextOpts{} + } + b.ContextOpts.Parallelism = 3 op.Workspace = backend.DefaultStateName run, err := b.Operation(context.Background(), op) diff --git a/internal/cloud/backend_plan.go b/internal/cloud/backend_plan.go index 3e3916b36..693210d4f 100644 --- a/internal/cloud/backend_plan.go +++ b/internal/cloud/backend_plan.go @@ -38,7 +38,7 @@ func (b *Cloud) opPlan(stopCtx, cancelCtx context.Context, op *backend.Operation return nil, diags.Err() } - if op.Parallelism != defaultParallelism { + if b.ContextOpts != nil && b.ContextOpts.Parallelism != defaultParallelism { diags = diags.Append(tfdiags.Sourceless( tfdiags.Error, "Custom parallelism values are currently not supported", diff --git a/internal/cloud/backend_plan_test.go b/internal/cloud/backend_plan_test.go index a0a7ced71..1dcfdeb07 100644 --- a/internal/cloud/backend_plan_test.go +++ b/internal/cloud/backend_plan_test.go @@ -44,7 +44,6 @@ func testOperationPlanWithTimeout(t *testing.T, configDir string, timeout time.D return &backend.Operation{ ConfigDir: configDir, ConfigLoader: configLoader, - Parallelism: defaultParallelism, PlanRefresh: true, StateLocker: clistate.NewLocker(timeout, stateLockerView), Type: backend.OperationTypePlan, @@ -198,7 +197,10 @@ func TestCloud_planWithParallelism(t *testing.T) { op, configCleanup, done := testOperationPlan(t, "./testdata/plan") defer configCleanup() - op.Parallelism = 3 + if b.ContextOpts == nil { + b.ContextOpts = &terraform.ContextOpts{} + } + b.ContextOpts.Parallelism = 3 op.Workspace = backend.DefaultStateName run, err := b.Operation(context.Background(), op)