@@ -382,68 +382,6 @@ func onlyDataResources(sm tfjson.StateModule) tfjson.StateModule {
382
382
return filtered
383
383
}
384
384
385
- func (e * executor ) logResourceReplacements (ctx context.Context , plan * tfjson.Plan ) {
386
- if plan == nil {
387
- return
388
- }
389
-
390
- if len (plan .ResourceChanges ) == 0 {
391
- return
392
- }
393
- var (
394
- count int
395
- replacements = make (map [string ][]string , len (plan .ResourceChanges ))
396
- )
397
-
398
- for _ , ch := range plan .ResourceChanges {
399
- // No change, no problem!
400
- if ch .Change == nil {
401
- continue
402
- }
403
-
404
- // No-op change, no problem!
405
- if ch .Change .Actions .NoOp () {
406
- continue
407
- }
408
-
409
- // No replacements, no problem!
410
- if len (ch .Change .ReplacePaths ) == 0 {
411
- continue
412
- }
413
-
414
- // Replacing our resources, no problem!
415
- if strings .Index (ch .Type , "coder_" ) == 0 {
416
- continue
417
- }
418
-
419
- for _ , p := range ch .Change .ReplacePaths {
420
- var path string
421
- switch p := p .(type ) {
422
- case []interface {}:
423
- segs := p
424
- list := make ([]string , 0 , len (segs ))
425
- for _ , s := range segs {
426
- list = append (list , fmt .Sprintf ("%v" , s ))
427
- }
428
- path = strings .Join (list , "." )
429
- default :
430
- path = fmt .Sprintf ("%v" , p )
431
- }
432
-
433
- replacements [ch .Address ] = append (replacements [ch .Address ], path )
434
- }
435
-
436
- count ++
437
- }
438
-
439
- if count > 0 {
440
- e .server .logger .Warn (ctx , "plan introduces resource changes" , slog .F ("count" , count ))
441
- for n , p := range replacements {
442
- e .server .logger .Warn (ctx , "resource will be replaced" , slog .F ("name" , n ), slog .F ("replacement_paths" , strings .Join (p , "," )))
443
- }
444
- }
445
- }
446
-
447
385
// planResources must only be called while the lock is held.
448
386
func (e * executor ) planResources (ctx , killCtx context.Context , planfilePath string ) (* State , * tfjson.Plan , error ) {
449
387
ctx , span := e .server .startTrace (ctx , tracing .FuncName ())
@@ -454,8 +392,6 @@ func (e *executor) planResources(ctx, killCtx context.Context, planfilePath stri
454
392
return nil , nil , xerrors .Errorf ("show terraform plan file: %w" , err )
455
393
}
456
394
457
- e .logResourceReplacements (ctx , plan )
458
-
459
395
rawGraph , err := e .graph (ctx , killCtx )
460
396
if err != nil {
461
397
return nil , nil , xerrors .Errorf ("graph: %w" , err )
0 commit comments