Skip to content

Commit

Permalink
Add files to ModuleMetadata (#849)
Browse files Browse the repository at this point in the history
* update terraform-schema and hcl-lang

* add list of filenames to module meta
  • Loading branch information
dbanck authored Apr 6, 2022
1 parent 780aca6 commit 5b56b6a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ require (
github.com/hashicorp/go-uuid v1.0.2
github.com/hashicorp/go-version v1.4.0
github.com/hashicorp/hc-install v0.3.1
github.com/hashicorp/hcl-lang v0.0.0-20220316204834-49ffde67ce68
github.com/hashicorp/hcl-lang v0.0.0-20220406121211-c20527a75592
github.com/hashicorp/hcl/v2 v2.11.1
github.com/hashicorp/terraform-exec v0.16.0
github.com/hashicorp/terraform-json v0.13.0
github.com/hashicorp/terraform-registry-address v0.0.0-20210816115301-cb2034eba045
github.com/hashicorp/terraform-schema v0.0.0-20220316204916-c6585b866d6d
github.com/hashicorp/terraform-schema v0.0.0-20220406123003-d31af6231814
github.com/kylelemons/godebug v1.1.0 // indirect
github.com/mh-cbon/go-fmt-fail v0.0.0-20160815164508-67765b3fbcb5
github.com/mitchellh/cli v1.1.2
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,8 @@ github.com/hashicorp/hc-install v0.3.1 h1:VIjllE6KyAI1A244G8kTaHXy+TL5/XYzvrtFi8
github.com/hashicorp/hc-install v0.3.1/go.mod h1:3LCdWcCDS1gaHC9mhHCGbkYfoY6vdsKohGjugbZdZak=
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
github.com/hashicorp/hcl-lang v0.0.0-20220316204834-49ffde67ce68 h1:CdUL7gJYGdJheCfAmCWNE65wimdo9YWJSqB/+NtfWPc=
github.com/hashicorp/hcl-lang v0.0.0-20220316204834-49ffde67ce68/go.mod h1:oQgcOV8OizFyZfZh3FbQSsQtvtTv8hD23MLAxfn3E+E=
github.com/hashicorp/hcl-lang v0.0.0-20220406121211-c20527a75592 h1:pSTtkCAbU+SLxw6J59ihqFDX5lJ9xR/fhqaOng1kQXY=
github.com/hashicorp/hcl-lang v0.0.0-20220406121211-c20527a75592/go.mod h1:oQgcOV8OizFyZfZh3FbQSsQtvtTv8hD23MLAxfn3E+E=
github.com/hashicorp/hcl/v2 v2.11.1 h1:yTyWcXcm9XB0TEkyU/JCRU6rYy4K+mgLtzn2wlrJbcc=
github.com/hashicorp/hcl/v2 v2.11.1/go.mod h1:FwWsfWEjyV/CMj8s/gqAuiviY72rJ1/oayI9WftqcKg=
github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64=
Expand All @@ -313,8 +313,8 @@ github.com/hashicorp/terraform-json v0.13.0/go.mod h1:y5OdLBCT+rxbwnpxZs9kGL7R9E
github.com/hashicorp/terraform-registry-address v0.0.0-20210412075316-9b2996cce896/go.mod h1:bzBPnUIkI0RxauU8Dqo+2KrZZ28Cf48s8V6IHt3p4co=
github.com/hashicorp/terraform-registry-address v0.0.0-20210816115301-cb2034eba045 h1:R/I8ofvXuPcTNoc//N4ruvaHGZcShI/VuU2iXo875Lo=
github.com/hashicorp/terraform-registry-address v0.0.0-20210816115301-cb2034eba045/go.mod h1:anRyJbe12BZscpFgaeGu9gH12qfdBP094LYFtuAFzd4=
github.com/hashicorp/terraform-schema v0.0.0-20220316204916-c6585b866d6d h1:XLelo71INyUNDHQAWnGwsfAA5Ccj9LqtbaejBUzYKhc=
github.com/hashicorp/terraform-schema v0.0.0-20220316204916-c6585b866d6d/go.mod h1:i0M64K9OfxlLRuFOThK1KRi9+20Y9XbyWpgPaEycbec=
github.com/hashicorp/terraform-schema v0.0.0-20220406123003-d31af6231814 h1:os3GCpT5LVp8QRt4mEFhNWjq8d2NgXuBDmkAum4P5Pk=
github.com/hashicorp/terraform-schema v0.0.0-20220406123003-d31af6231814/go.mod h1:DEt9BSd4/rpgLzj912KK9I6n9YbDZn4zrQVYAiUln88=
github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 h1:HKLsbzeOsfXmKNpr3GiT18XAblV0BjCbzL8KQAMZGa0=
github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734/go.mod h1:kNDNcF7sN4DocDLBkQYz73HGKwN1ANB1blq4lIYLYvg=
github.com/huandu/xstrings v1.3.2 h1:L18LIDzqlW6xN2rEkpdV8+oL/IXWJ1APd+vsdYy4Wdw=
Expand Down
1 change: 1 addition & 0 deletions internal/decoder/module_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ func schemaForModule(mod *state.Module, schemaReader state.SchemaReader, modRead
ProviderRequirements: mod.Meta.ProviderRequirements,
ProviderReferences: mod.Meta.ProviderReferences,
Variables: mod.Meta.Variables,
Filenames: mod.Meta.Filenames,
}

return sm.SchemaForModule(meta)
Expand Down
4 changes: 4 additions & 0 deletions internal/state/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ type ModuleMetadata struct {
ProviderRequirements tfmod.ProviderRequirements
Variables map[string]tfmod.Variable
Outputs map[string]tfmod.Output
Filenames []string
}

func (mm ModuleMetadata) Copy() ModuleMetadata {
newMm := ModuleMetadata{
// version.Constraints is practically immutable once parsed
CoreRequirements: mm.CoreRequirements,
Filenames: mm.Filenames,
}

if mm.Backend != nil {
Expand Down Expand Up @@ -336,6 +338,7 @@ func (s *ModuleStore) ModuleMeta(modPath string) (*tfmod.Meta, error) {
CoreRequirements: mod.Meta.CoreRequirements,
Variables: mod.Meta.Variables,
Outputs: mod.Meta.Outputs,
Filenames: mod.Meta.Filenames,
}, nil
}

Expand Down Expand Up @@ -700,6 +703,7 @@ func (s *ModuleStore) UpdateMetadata(path string, meta *tfmod.Meta, mErr error)
ProviderRequirements: meta.ProviderRequirements,
Variables: meta.Variables,
Outputs: meta.Outputs,
Filenames: meta.Filenames,
}
mod.MetaErr = mErr

Expand Down

0 comments on commit 5b56b6a

Please sign in to comment.