Skip to content

Commit

Permalink
Fix shadowing bug to actually pass the options
Browse files Browse the repository at this point in the history
  • Loading branch information
t0yv0 committed Sep 29, 2023
1 parent db3d355 commit 9ab59aa
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pkg/tfgen/convert_cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,16 +363,14 @@ func (cc *cliConverter) convertPCL(
return "", diagnostics, nil
}

opts := cc.opts
if opts == nil {
if cc.opts == nil {
var opts []pcl.BindOption
opts = append(opts, pcl.AllowMissingProperties)
opts = append(opts, pcl.AllowMissingVariables)
opts = append(opts, pcl.SkipResourceTypechecking)
if cc.pluginHost != nil {
opts = append(opts, pcl.PluginHost(cc.pluginHost))
loader := newLoader(cc.pluginHost)
//loader.BindCurrentPackage(*spec, cc.packageName)
opts = append(opts, pcl.Loader(loader))
}
if cc.packageCache != nil {
Expand All @@ -381,7 +379,7 @@ func (cc *cliConverter) convertPCL(
cc.opts = opts
}

program, programDiags, err := pcl.BindProgram(pulumiParser.Files, opts...)
program, programDiags, err := pcl.BindProgram(pulumiParser.Files, cc.opts...)
if err != nil {
return "", diagnostics, fmt.Errorf("pcl.BindProgram failed: %w", err)
}
Expand Down

0 comments on commit 9ab59aa

Please sign in to comment.