pulumi/pkg
Justin Van Patten 414ef7e9d0
[programgen/go] Don't change imported resource names (#8353)
When importing a resource in Go, we change resource names with hyphens to snake_case. This happens because we introduced a change that converts the resource name to a valid Go identifier so it can be used as a local variable. But we were also using this converted name as the string resource name, which causes problems with import: the imported resource in the state file has the original resource name, but the generated program uses the converted name, causing Pulumi to delete and recreate the resource when adopting the generated import code.

This change fixes the issue by maintaining the original resource name, and only using the converted name for variables.
2021-11-04 09:28:48 -07:00
..
backend [cli] Emit JSON events for updates via --json flag (#8275) 2021-10-26 16:21:27 -07:00
cmd/pulumi [cli] Emit JSON events for updates via --json flag (#8275) 2021-10-26 16:21:27 -07:00
codegen [programgen/go] Don't change imported resource names (#8353) 2021-11-04 09:28:48 -07:00
engine [engine/test] Add a repro for #7786. (#8097) 2021-09-29 16:05:45 -07:00
graph [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
operations [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
resource Clarify error message language (#8188) 2021-10-11 15:21:58 -07:00
secrets [cli] Prevent regression in loading passphrase secrets provider from state (#6976) 2021-05-06 14:40:44 +01:00
testing/integration [cli] Emit JSON events for updates via --json flag (#8275) 2021-10-26 16:21:27 -07:00
util [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
version duplicate version to ensure linking is properly handled 2020-03-19 12:49:34 -07:00
go.mod Fix cmdutil.PrintTable to handle ansi escapes and non-byte glyphs (#8344) 2021-11-04 10:06:20 +00:00
go.sum Fix cmdutil.PrintTable to handle ansi escapes and non-byte glyphs (#8344) 2021-11-04 10:06:20 +00:00