aequitas/terraform-provider-transip

Provider crashes with install_flavour defined.

Closed this issue · 4 comments

The new release crashes with:

tack trace from the terraform-provider-transip_v0.1.17 plugin:

panic: interface conversion: interface {} is string, not vps.InstallFlavour

goroutine 39 [running]:
main.resourceVpsCreate(0xc0004dcfc0, {0xe23220?, 0xc0005be1e0})
	github.com/aequitas/terraform-provider-transip/resource_transip_vps.go:153 +0xe65
github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Resource).Apply(0xc00074a3c0, 0xc0000cf270, 0xc0000d6ba0, {0xe23220, 0xc0005be1e0})
	github.com/hashicorp/terraform-plugin-sdk@v1.17.2/helper/schema/resource.go:320 +0x438
github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Provider).Apply(0xc00015d280, 0xc0000ef9b0, 0xe931af?, 0xf?)
	github.com/hashicorp/terraform-plugin-sdk@v1.17.2/helper/schema/provider.go:294 +0x70
github.com/hashicorp/terraform-plugin-sdk/internal/helper/plugin.(*GRPCProviderServer).ApplyResourceChange(0xc000012430, {0xc0004dca10?, 0x4f2206?}, 0xc0004dca10)
	github.com/hashicorp/terraform-plugin-sdk@v1.17.2/internal/helper/plugin/grpc_provider.go:895 +0x805
github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0xe5a900?, 0xc000012430}, {0x10ed650, 0xc00058ae40}, 0xc00011f200, 0x0)
	github.com/hashicorp/terraform-plugin-sdk@v1.17.2/internal/tfplugin5/tfplugin5.pb.go:3305 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0002faa80, {0x10f1be0, 0xc00016ca80}, 0xc0000b6100, 0xc0005311d0, 0x1691720, 0x0)
	google.golang.org/grpc@v1.32.0/server.go:1194 +0xcab
google.golang.org/grpc.(*Server).handleStream(0xc0002faa80, {0x10f1be0, 0xc00016ca80}, 0xc0000b6100, 0x0)
	google.golang.org/grpc@v1.32.0/server.go:1517 +0xa2f
google.golang.org/grpc.(*Server).serveStreams.func1.2()
	google.golang.org/grpc@v1.32.0/server.go:859 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
	google.golang.org/grpc@v1.32.0/server.go:857 +0x28a

This line probably should be changed to installFlavour := d.Get("install_flavour").(string).

installFlavour := d.Get("install_flavour").(vps.InstallFlavour)

Do you have stack trace or error output?

Sorry, pressed enter to soon @aequitas. Added the stack trace to initial message

I pushed a new release, can you check.

@aequitas Works great now, thanks!