MCPcopy Index your code
hub / github.com/coder/coder / onlyDataResources

Function onlyDataResources

provisioner/terraform/executor.go:384–399  ·  view source on GitHub ↗
(sm tfjson.StateModule)

Source from the content-addressed store, hash-verified

382}
383
384func onlyDataResources(sm tfjson.StateModule) tfjson.StateModule {
385 filtered := sm
386 filtered.Resources = []*tfjson.StateResource{}
387 for _, r := range sm.Resources {
388 if r.Mode == "data" {
389 filtered.Resources = append(filtered.Resources, r)
390 }
391 }
392
393 filtered.ChildModules = []*tfjson.StateModule{}
394 for _, c := range sm.ChildModules {
395 filteredChild := onlyDataResources(*c)
396 filtered.ChildModules = append(filtered.ChildModules, &filteredChild)
397 }
398 return filtered
399}
400
401// parsePlan must only be called while the lock is held.
402func (e *executor) parsePlan(ctx, killCtx context.Context, planfilePath string) (*tfjson.Plan, error) {

Callers 2

TestOnlyDataResourcesFunction · 0.85
planModulesFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestOnlyDataResourcesFunction · 0.68