Skip to content

Commit cd4dec7

Browse files
committed
fix: Avoid duplicated warnings
1 parent e329cf2 commit cd4dec7

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

internal/backend/local/backend_plan.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ func (b *Local) opPlan(
7777
}
7878

7979
// Get our context
80+
// first diagnostic
8081
lr, configSnap, opState, ctxDiags := b.localRun(op)
8182
diags = diags.Append(ctxDiags)
8283
if ctxDiags.HasErrors() {
@@ -105,6 +106,7 @@ func (b *Local) opPlan(
105106
defer logging.PanicHandler()
106107
defer close(doneCh)
107108
log.Printf("[INFO] backend/local: plan calling Plan")
109+
// second diagnostic
108110
plan, planDiags = lr.Core.Plan(lr.Config, lr.InputState, lr.PlanOpts)
109111
}()
110112

@@ -120,7 +122,7 @@ func (b *Local) opPlan(
120122
// NOTE: We intentionally don't stop here on errors because we always want
121123
// to try to present a partial plan report and, if the user chose to,
122124
// generate a partial saved plan file for external analysis.
123-
diags = diags.Append(planDiags)
125+
diags = planDiags
124126

125127
// Even if there are errors we need to handle anything that may be
126128
// contained within the plan, so only exit if there is no data at all.

internal/terraform/node_resource_plan_partialexp.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ func (n *nodePlannablePartialExpandedResource) managedResourceExecute(ctx EvalCo
201201
}
202202

203203
unmarkedConfigVal, _ := configVal.UnmarkDeep()
204+
log.Printf("[TRACE] Validating partially expanded config for %q", n.addr)
204205
validateResp := provider.ValidateResourceConfig(
205206
providers.ValidateResourceConfigRequest{
206207
TypeName: n.addr.Resource().Type,

internal/terraform/node_resource_validate.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ package terraform
55

66
import (
77
"fmt"
8+
"log"
89
"strings"
910

1011
"github.com/hashicorp/hcl/v2"
@@ -390,6 +391,7 @@ func (n *NodeValidatableResource) validateResource(ctx EvalContext) tfdiags.Diag
390391

391392
// Use unmarked value for validate request
392393
unmarkedConfigVal, _ := configVal.UnmarkDeep()
394+
log.Printf("[TRACE] Validating config for %q", n.Addr)
393395
req := providers.ValidateResourceConfigRequest{
394396
TypeName: n.Config.Type,
395397
Config: unmarkedConfigVal,

0 commit comments

Comments
 (0)