Update cloudplugin type casting to simplify adding future versions

This commit is contained in:
Brandon Croft 2023-07-21 10:15:58 -06:00
parent 2c3d134705
commit 9bb566dcdb
No known key found for this signature in database
GPG Key ID: B01E32423322EB9D

View File

@ -69,7 +69,13 @@ func (c *CloudCommand) proxy(args []string, stdout, stderr io.Writer) int {
}
// Proxy the request
cloud1 := raw.(cloudplugin.Cloud1)
// Note: future changes will need to determine the type of raw when
// multiple versions are possible.
cloud1, ok := raw.(cloudplugin.Cloud1)
if !ok {
c.Ui.Error("If more than one cloudplugin versions are available, they need to be added to the cloud command. This is a bug in terraform.")
return ExitRPCError
}
return cloud1.Execute(args, stdout, stderr)
}