From dc9754666f03452afbc5f93b86e251f7aba0108d Mon Sep 17 00:00:00 2001 From: Fraser Waters Date: Tue, 10 Dec 2024 13:38:59 +0000 Subject: [PATCH] Fix ImportBasePath for dynamic bridged providers (#2705) The current code generates an import base path like `github.com/pulumi/pulumi-terraform-provider/sdks/something/v3`. This is a _module_ path (ends with a version number) not a package import path, we always nest our packages one level below the module. The correct import base path should be `github.com/pulumi/pulumi-terraform-provider/sdks/something/v3/something`. --- dynamic/info.go | 1 + dynamic/testdata/TestSchemaGeneration/Backblaze/b2-0.8.9.golden | 2 +- .../TestSchemaGeneration/databricks/databricks-1.50.0.golden | 2 +- .../testdata/TestSchemaGeneration/hashicorp/random-3.3.0.golden | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/dynamic/info.go b/dynamic/info.go index 942d30d6c..16720139b 100644 --- a/dynamic/info.go +++ b/dynamic/info.go @@ -67,6 +67,7 @@ func providerInfo(ctx context.Context, p run.Provider, value parameterize.Value) "github.com/pulumi/pulumi-terraform-provider/sdks/go", p.Name(), tfbridge.GetModuleMajorVersion(p.Version()), + p.Name(), ), RootPackageName: p.Name(), LiftSingleValueMethodReturns: true, diff --git a/dynamic/testdata/TestSchemaGeneration/Backblaze/b2-0.8.9.golden b/dynamic/testdata/TestSchemaGeneration/Backblaze/b2-0.8.9.golden index 878cf7624..f1d362027 100644 --- a/dynamic/testdata/TestSchemaGeneration/Backblaze/b2-0.8.9.golden +++ b/dynamic/testdata/TestSchemaGeneration/Backblaze/b2-0.8.9.golden @@ -14,7 +14,7 @@ "respectSchemaVersion": true }, "go": { - "importBasePath": "github.com/pulumi/pulumi-terraform-provider/sdks/go/b2", + "importBasePath": "github.com/pulumi/pulumi-terraform-provider/sdks/go/b2/b2", "rootPackageName": "b2", "liftSingleValueMethodReturns": true, "generateExtraInputTypes": true, diff --git a/dynamic/testdata/TestSchemaGeneration/databricks/databricks-1.50.0.golden b/dynamic/testdata/TestSchemaGeneration/databricks/databricks-1.50.0.golden index b08cfd8e3..288af648a 100644 --- a/dynamic/testdata/TestSchemaGeneration/databricks/databricks-1.50.0.golden +++ b/dynamic/testdata/TestSchemaGeneration/databricks/databricks-1.50.0.golden @@ -14,7 +14,7 @@ "respectSchemaVersion": true }, "go": { - "importBasePath": "github.com/pulumi/pulumi-terraform-provider/sdks/go/databricks", + "importBasePath": "github.com/pulumi/pulumi-terraform-provider/sdks/go/databricks/databricks", "rootPackageName": "databricks", "liftSingleValueMethodReturns": true, "generateExtraInputTypes": true, diff --git a/dynamic/testdata/TestSchemaGeneration/hashicorp/random-3.3.0.golden b/dynamic/testdata/TestSchemaGeneration/hashicorp/random-3.3.0.golden index 6dd9ea21c..35edcadaa 100644 --- a/dynamic/testdata/TestSchemaGeneration/hashicorp/random-3.3.0.golden +++ b/dynamic/testdata/TestSchemaGeneration/hashicorp/random-3.3.0.golden @@ -14,7 +14,7 @@ "respectSchemaVersion": true }, "go": { - "importBasePath": "github.com/pulumi/pulumi-terraform-provider/sdks/go/random/v3", + "importBasePath": "github.com/pulumi/pulumi-terraform-provider/sdks/go/random/v3/random", "rootPackageName": "random", "liftSingleValueMethodReturns": true, "generateExtraInputTypes": true,