Skip to content

Commit

Permalink
Merge #11553
Browse files Browse the repository at this point in the history
11553: Convert mapper phase 5 r=Frassle a=Frassle

Last part of the new convert mapper work, update terraform-bridge to bring in the new code with support for convert mappers and use it in convert.

Co-authored-by: Fraser Waters <fraser@pulumi.com>
  • Loading branch information
bors[bot] and Frassle committed Dec 7, 2022
2 parents e812f69 + 892f074 commit 854bdcd
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
5 changes: 2 additions & 3 deletions pkg/cmd/pulumi/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,7 @@ func runConvert(
}
defer contract.IgnoreClose(host)
loader := schema.NewPluginLoader(host)
// TODO: Mapper will be used by tfconvert (and others as we add them)
_, err = convert.NewPluginMapper(host, from, mappings)
mapper, err := convert.NewPluginMapper(host, from, mappings)
if err != nil {
return result.FromError(fmt.Errorf("could not create provider mapper: %w", err))
}
Expand All @@ -225,7 +224,7 @@ func runConvert(
return result.FromError(fmt.Errorf("unrecognized source %s", from))
}
} else if from == "tf" {
proj, program, err = tfgen.Eject(cwd, loader)
proj, program, err = tfgen.Eject(cwd, loader, mapper)
if err != nil {
return result.FromError(fmt.Errorf("could not load terraform program: %w", err))
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ require (
github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d
github.com/opentracing/opentracing-go v1.2.0
github.com/pgavlin/goldmark v1.1.33-0.20200616210433-b5eb04559386
github.com/pulumi/pulumi/sdk/v3 v3.48.1-0.20221129095827-e43e98e5a7ab
github.com/pulumi/pulumi/sdk/v3 v3.48.1-0.20221205185749-86e7d56df231
github.com/santhosh-tekuri/jsonschema/v5 v5.0.0
github.com/sergi/go-diff v1.2.0
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
Expand Down Expand Up @@ -72,7 +72,7 @@ require (
github.com/muesli/cancelreader v0.2.2
github.com/natefinch/atomic v1.0.1
github.com/pulumi/pulumi-java/pkg v0.6.0
github.com/pulumi/pulumi-terraform-bridge/v3 v3.33.1-0.20221130185552-52ef9a815fb9
github.com/pulumi/pulumi-terraform-bridge/v3 v3.33.1-0.20221206123933-cdc390c674b1
github.com/pulumi/pulumi-yaml v1.0.3
github.com/rivo/uniseg v0.2.0
github.com/segmentio/encoding v0.3.5
Expand Down
4 changes: 2 additions & 2 deletions pkg/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1527,8 +1527,8 @@ github.com/prometheus/prometheus v0.37.0/go.mod h1:egARUgz+K93zwqsVIAneFlLZefyGO
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
github.com/pulumi/pulumi-java/pkg v0.6.0 h1:haiSQJlhrQIBBcR0r0aQCIF8i69e4znzRnHpaNQUchE=
github.com/pulumi/pulumi-java/pkg v0.6.0/go.mod h1:xSK2B792P8zjwYZTHYapMM1RJdue2BpRFQNYObWO0C8=
github.com/pulumi/pulumi-terraform-bridge/v3 v3.33.1-0.20221130185552-52ef9a815fb9 h1:d5x2w09F3jYUGI+dbkxKh9venuzh7b7osa1mb/aHWBY=
github.com/pulumi/pulumi-terraform-bridge/v3 v3.33.1-0.20221130185552-52ef9a815fb9/go.mod h1:KwuxFDO7k2h3ZH5eTmd/zs3eQ5KlRTliI8vbAIdLcLI=
github.com/pulumi/pulumi-terraform-bridge/v3 v3.33.1-0.20221206123933-cdc390c674b1 h1:zzYNG7f2TDRlqDC5ppwSaLLHBviylfreHYV20++knx0=
github.com/pulumi/pulumi-terraform-bridge/v3 v3.33.1-0.20221206123933-cdc390c674b1/go.mod h1:KzJrUQo9GsWoQ6WDVCbzjnYoHUvhkjo4DjYv5NWfdc0=
github.com/pulumi/pulumi-yaml v1.0.3 h1:JDRQfGcQYxwJETIepa7T3B7wTV7Bk2P7uApmWvQZeL4=
github.com/pulumi/pulumi-yaml v1.0.3/go.mod h1:KLFTyADnoNoPU9djMyRvXymrTH2SCBg9wnXaapuggEA=
github.com/pulumi/ssh-agent v0.5.1 h1:7DT4FcZNHWBAp9BFI+k0+HeBYGWbJvilJ29ra/4FlRM=
Expand Down
2 changes: 1 addition & 1 deletion tests/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require (
github.com/blang/semver v3.5.1+incompatible
github.com/golang/protobuf v1.5.2
github.com/pulumi/pulumi/pkg/v3 v3.34.1
github.com/pulumi/pulumi/sdk/v3 v3.48.1-0.20221129095827-e43e98e5a7ab
github.com/pulumi/pulumi/sdk/v3 v3.48.1-0.20221205185749-86e7d56df231
github.com/stretchr/testify v1.8.0
google.golang.org/grpc v1.49.0
sourcegraph.com/sourcegraph/appdash v0.0.0-20211028080628-e2786a622600
Expand Down

0 comments on commit 854bdcd

Please sign in to comment.