sparse-intern-71089
07/25/2023, 5:59 PMenough-garden-22763
07/25/2023, 6:06 PMenough-garden-22763
07/25/2023, 6:06 PMenough-garden-22763
07/25/2023, 6:06 PMhappy-napkin-59884
07/25/2023, 6:11 PMhappy-napkin-59884
07/25/2023, 6:14 PMtry to propagate the replace into your go.mod and see if it buildsdo you mean this?
require <http://github.com/pulumi/terraform-plugin-sdk/v2|github.com/pulumi/terraform-plugin-sdk/v2> v2.0.0-20220824175045-450992f2f5b9
go mod tidy
<http://github.com/semdatex/pulumi-harvester/provider|github.com/semdatex/pulumi-harvester/provider> imports
<http://github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge|github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge> tested by
<http://github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge.test|github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge.test> imports
<http://github.com/hashicorp/terraform-plugin-sdk/helper/schema|github.com/hashicorp/terraform-plugin-sdk/helper/schema>: <http://github.com/pulumi/terraform-plugin-sdk/v2@v2.0.0-20220824175045-450992f2f5b9|github.com/pulumi/terraform-plugin-sdk/v2@v2.0.0-20220824175045-450992f2f5b9>: parsing go.mod:
module declares its path as: <http://github.com/hashicorp/terraform-plugin-sdk/v2|github.com/hashicorp/terraform-plugin-sdk/v2>
but was required as: <http://github.com/pulumi/terraform-plugin-sdk/v2|github.com/pulumi/terraform-plugin-sdk/v2>
happy-napkin-59884
07/25/2023, 6:24 PMreplace <http://github.com/hashicorp/terraform-plugin-sdk/v2|github.com/hashicorp/terraform-plugin-sdk/v2> => <http://github.com/pulumi/terraform-plugin-sdk/v2|github.com/pulumi/terraform-plugin-sdk/v2> v2.0.0-20230710100801-03a71d0fca3d
did the trick.
```happy-napkin-59884
07/25/2023, 6:25 PMmake tfgen
[ -x /opt/homebrew/bin/pulumi ] || curl -fsSL <https://get.pulumi.com> | sh
pulumi plugin install resource random 4.3.1
(cd provider && go build -o /Users/gsuess/SemDatex/pulumi/harvester/bin/pulumi-tfgen-harvester -ldflags "-X <http://github.com/semdatex/pulumi-harvester/provider/pkg/version.Version=0.0.1-alpha.1688662856+041f43bc.dirty|github.com/semdatex/pulumi-harvester/provider/pkg/version.Version=0.0.1-alpha.1688662856+041f43bc.dirty>" <http://github.com/semdatex/pulumi-harvester/provider/cmd/pulumi-tfgen-harvester)|github.com/semdatex/pulumi-harvester/provider/cmd/pulumi-tfgen-harvester)>
# <http://github.com/semdatex/pulumi-harvester/provider|github.com/semdatex/pulumi-harvester/provider>
./resources.go:49:27: undefined: harvester
./resources.go:155:8: prov.MustApplyAutoAliasing undefined (type tfbridge.ProviderInfo has no field or method MustApplyAutoAliasing)
make: *** [tfgen] Error 1
At least i believe i have reached the next error down the line.big-architect-71258
07/25/2023, 6:45 PMhappy-napkin-59884
07/25/2023, 9:18 PM{
"terraform_provider_name": "harvester",
"terraform_provider_org": "harvester",
"terraform_provider_source": "<http://github.com/harvester/terraform-provider-harvester|github.com/harvester/terraform-provider-harvester>",
"terraform_provider_version_or_commit": "0.6.2",
"terraform_provider_module": "<http://github.com/harvester/terraform-provider-harvester|github.com/harvester/terraform-provider-harvester>",
"terraform_provider_package_name": "harvester",
"terraform_sdk_version": "2",
"provider": "pulumi-harvester",
"provider_display_name": "Harvester",
"provider_github_organization": "semdatex",
"provider_publisher": "semdatex",
"provider_homepage": "<https://github.com/semdatex/pulumi-harvester>",
"provider_logoUrl": "<https://www.rancher.com/assets/img/brand-guidelines/project-logos/harvester/logo-horizontal-harvester.svg>",
"provider_description": "A Pulumi package for creating and managing Harvester resources",
"provider_category": "infrastructure",
"provider_download_url": "<github://api.github.com/semdatex/pulumi-harvester>",
"provider_javascript_package": "@semdatex/pulumi-harvester",
"provider_dotnet_rootnamespace": "semdatex",
"provider_python_package": "pulumiverse_harvester",
"provider_java_base_package": "com.semdatex",
"go_version": "1.19.8",
"create_github_workflows": "yes",
"skip_go_mod_tidy": "no",
"skip_git_init": "yes"
}
happy-napkin-59884
07/25/2023, 9:19 PMConnected.
ERROR: provider name MUST NOT start with terraform-provider-
ERROR: Stopping generation because pre_gen_project hook script didn't exit successfully
Hook script failed (exit status: 1)
Disconnected from container.
happy-napkin-59884
07/25/2023, 9:28 PMhappy-napkin-59884
07/26/2023, 6:53 AMbig-architect-71258
07/26/2023, 10:17 AMreplace
section from the go.mod
in the provider repo to both go.mod files in the Pulumi provider. Hope that helpsbig-architect-71258
07/26/2023, 10:19 AMgo work sync
in the top level Pulumi provider repo. Orgo mod tidy
in the provider/shim
and provider
directories.
Don't do a go work sync
😄big-architect-71258
07/26/2023, 10:29 AM(cd provider && go build -o /tmp/pulumi-harvester/bin/pulumi-tfgen-harvester -ldflags "-X <http://github.com/pulumiverse/pulumi-harvester/provider/pkg/version.Version=0.0.1-alpha.1690366080+03ad08d4|github.com/pulumiverse/pulumi-harvester/provider/pkg/version.Version=0.0.1-alpha.1690366080+03ad08d4>" <http://github.com/pulumiverse/pulumi-harvester/provider/cmd/pulumi-tfgen-harvester)|github.com/pulumiverse/pulumi-harvester/provider/cmd/pulumi-tfgen-harvester)>
# <http://github.com/harvester/terraform-provider-harvester/internal/provider/virtualmachine|github.com/harvester/terraform-provider-harvester/internal/provider/virtualmachine>
/home/vagrant/go/pkg/mod/github.com/harvester/terraform-provider-harvester@v0.6.2/internal/provider/virtualmachine/resource_virtualmachine_constructor.go:204:48: cannot use uint(bootOrder) (value of type uint) as int value in argument to vmBuilder.Disk
/home/vagrant/go/pkg/mod/github.com/harvester/terraform-provider-harvester@v0.6.2/internal/provider/virtualmachine/resource_virtualmachine_constructor.go:294:15: vmBuilder.Input undefined (type *"<http://github.com/harvester/harvester/pkg/builder|github.com/harvester/harvester/pkg/builder>".VMBuilder has no field or method Input)
/home/vagrant/go/pkg/mod/github.com/harvester/terraform-provider-harvester@v0.6.2/internal/provider/virtualmachine/schema_virtualmachine_input.go:20:22: undefined: builder.InputTypeTablet
/home/vagrant/go/pkg/mod/github.com/harvester/terraform-provider-harvester@v0.6.2/internal/provider/virtualmachine/schema_virtualmachine_input.go:22:13: undefined: builder.InputTypeTablet
/home/vagrant/go/pkg/mod/github.com/harvester/terraform-provider-harvester@v0.6.2/internal/provider/virtualmachine/schema_virtualmachine_input.go:28:22: undefined: builder.InputBusUSB
/home/vagrant/go/pkg/mod/github.com/harvester/terraform-provider-harvester@v0.6.2/internal/provider/virtualmachine/schema_virtualmachine_input.go:30:13: undefined: builder.InputBusUSB
/home/vagrant/go/pkg/mod/github.com/harvester/terraform-provider-harvester@v0.6.2/internal/provider/virtualmachine/schema_virtualmachine_input.go:31:13: undefined: builder.InputBusVirtio
happy-napkin-59884
07/26/2023, 4:00 PM$ go mod tidy
go: finding module for package [<http://github.com/harvester/terraform-provider-harvester/shim|github.com/harvester/terraform-provider-harvester/shim>](<http://github.com/harvester/terraform-provider-harvester/shim>)
[<http://github.com/semdatex/pulumi-harvester/provider|github.com/semdatex/pulumi-harvester/provider>](<http://github.com/semdatex/pulumi-harvester/provider>) imports
[<http://github.com/harvester/terraform-provider-harvester/shim|github.com/harvester/terraform-provider-harvester/shim>](<http://github.com/harvester/terraform-provider-harvester/shim>): module [<http://github.com/harvester/terraform-provider-harvester@latest|github.com/harvester/terraform-provider-harvester@latest>](<http://github.com/harvester/terraform-provider-harvester@latest>) found (v0.6.2), but does not contain package [<http://github.com/harvester/terraform-provider-harvester/shim|github.com/harvester/terraform-provider-harvester/shim>](<http://github.com/harvester/terraform-provider-harvester/shim>)
big-architect-71258
07/26/2023, 4:45 PMhappy-napkin-59884
07/26/2023, 5:07 PMhappy-napkin-59884
07/26/2023, 5:12 PMhappy-napkin-59884
07/26/2023, 5:13 PMhappy-napkin-59884
07/26/2023, 5:32 PMhappy-napkin-59884
07/26/2023, 5:32 PMhappy-napkin-59884
07/26/2023, 5:53 PMgo mod tidy
in shim package.happy-napkin-59884
07/26/2023, 5:53 PMhappy-napkin-59884
07/26/2023, 5:53 PMhappy-napkin-59884
07/26/2023, 5:59 PMbig-architect-71258
07/26/2023, 6:01 PMreplace
statements. You can go one by one and copy each single replace statement from the TF provider go.mod
into both go.mod
files in the provider
and provider/shim
folder. Or you simply copy all the replace statements into those two files. You can have more than one replace
block in a go.mod
file. So you need not to squeeze the `replace`statements from the TF provider into the existing ones in the go.mod
files. Just copy and paste the complete replace
block from the TF provider.happy-napkin-59884
07/26/2023, 6:03 PMbig-architect-71258
07/26/2023, 6:03 PMbig-architect-71258
07/26/2023, 6:04 PMhappy-napkin-59884
07/26/2023, 6:06 PMhappy-napkin-59884
07/26/2023, 7:01 PM# [<http://github.com/harvester/terraform-provider-harvester/internal/provider/virtualmachine|github.com/harvester/terraform-provider-harvester/internal/provider/virtualmachine>](<http://github.com/harvester/terraform-provider-harvester/internal/provider/virtualmachine>)
/home/cookiecutter/go/pkg/mod/github.com/harvester/terraform-provider-harvester@v0.6.2/internal/provider/virtualmachine/resource_virtualmachine_constructor.go:204:48: cannot use uint(bootOrder) (value of type uint) as type int in argument to vmBuilder.Disk
/home/cookiecutter/go/pkg/mod/github.com/harvester/terraform-provider-harvester@v0.6.2/internal/provider/virtualmachine/resource_virtualmachine_constructor.go:294:15: vmBuilder.Input undefined (type *builder.VMBuilder has no field or method Input)
/home/cookiecutter/go/pkg/mod/github.com/harvester/terraform-provider-harvester@v0.6.2/internal/provider/virtualmachine/schema_virtualmachine_input.go:20:22: undefined: builder.InputTypeTablet
/home/cookiecutter/go/pkg/mod/github.com/harvester/terraform-provider-harvester@v0.6.2/internal/provider/virtualmachine/schema_virtualmachine_input.go:22:13: undefined: builder.InputTypeTablet
/home/cookiecutter/go/pkg/mod/github.com/harvester/terraform-provider-harvester@v0.6.2/internal/provider/virtualmachine/schema_virtualmachine_input.go:28:22: undefined: builder.InputBusUSB
/home/cookiecutter/go/pkg/mod/github.com/harvester/terraform-provider-harvester@v0.6.2/internal/provider/virtualmachine/schema_virtualmachine_input.go:30:13: undefined: builder.InputBusUSB
/home/cookiecutter/go/pkg/mod/github.com/harvester/terraform-provider-harvester@v0.6.2/internal/provider/virtualmachine/schema_virtualmachine_input.go:31:13: undefined: builder.InputBusVirtio