From de64bf7ca4e991dbfc5ad8edbd9fd432e397353f Mon Sep 17 00:00:00 2001 From: Anton Tayanovskyy Date: Wed, 1 Nov 2023 19:15:34 -0400 Subject: [PATCH 1/7] Initial matrix test for labels --- examples/examples_go_test.go | 171 ++++++++++ examples/labels-combinations-go/Pulumi.yaml | 3 + examples/labels-combinations-go/go.mod | 89 +++++ examples/labels-combinations-go/go.sum | 323 ++++++++++++++++++ examples/labels-combinations-go/main.go | 67 ++++ examples/labels-combinations-go/step1/main.go | 67 ++++ 6 files changed, 720 insertions(+) create mode 100644 examples/labels-combinations-go/Pulumi.yaml create mode 100644 examples/labels-combinations-go/go.mod create mode 100644 examples/labels-combinations-go/go.sum create mode 100644 examples/labels-combinations-go/main.go create mode 100644 examples/labels-combinations-go/step1/main.go diff --git a/examples/examples_go_test.go b/examples/examples_go_test.go index e536c4e21d..77f4a8c3a7 100644 --- a/examples/examples_go_test.go +++ b/examples/examples_go_test.go @@ -7,6 +7,7 @@ package examples import ( "context" cryptoRand "crypto/rand" + "encoding/json" "fmt" "math/big" "math/rand" @@ -19,6 +20,8 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/common/workspace" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "os" ) func TestAccBucketGo(t *testing.T) { @@ -179,3 +182,171 @@ func GenerateRandomString(n int) (string, error) { return string(ret), nil } + +func TestLabelsCombinationsGo(t *testing.T) { + type testCase struct { + name string + s1 tagsState + s2 tagsState + } + + testCases := []testCase{ + { + "can add an empty label", + tagsState{ + DefaultTags: map[string]string{}, + ResourceTags: map[string]string{}, + }, + tagsState{ + DefaultTags: map[string]string{}, + ResourceTags: map[string]string{"x": ""}, + }, + }, + { + "convoluted test case found by random-sampling", + tagsState{ + DefaultTags: map[string]string{"x": "", "y": "s"}, + ResourceTags: map[string]string{"x": ""}, + }, + tagsState{ + DefaultTags: map[string]string{"x": ""}, + ResourceTags: map[string]string{"x": "", "y": ""}, + }, + }, + } + + for _, tc := range testCases { + tc := tc + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + tc.s1.validateTransitionTo(t, tc.s2) + }) + } +} + +func TestRandomLabelsCombinationsGo(t *testing.T) { + tagValues := []string{"", "s"} // empty values are conflated with unknowns in TF internals, must test + + tagsValues := []map[string]string{ + nil, + {}, + } + + for _, tag := range tagValues { + m := map[string]string{"x": tag} + tagsValues = append(tagsValues, m) + } + + for _, tag1 := range tagValues { + for _, tag2 := range tagValues { + m := map[string]string{ + "x": tag1, + "y": tag2, + } + tagsValues = append(tagsValues, m) + } + } + + states := []tagsState{} + + for _, tags1 := range tagsValues { + for _, tags2 := range tagsValues { + states = append(states, tagsState{ + DefaultTags: tags1, + ResourceTags: tags2, + }) + } + } + + t.Logf("total state space: %v states", len(states)) + t.Logf("random-sampling 100 state transitions") + + for i := 0; i < 100; i++ { + t.Run(fmt.Sprintf("test-%d", i), func(t *testing.T) { + t.Parallel() + i := rand.Intn(len(states)) + j := rand.Intn(len(states)) + state1, state2 := states[i], states[j] + state1.validateTransitionTo(t, state2) + }) + } +} + +type tagsState struct { + DefaultTags map[string]string `json:"defaultTags"` + ResourceTags map[string]string `json:"resourceTags"` +} + +func (st tagsState) serialize(t *testing.T) string { + bytes, err := json.Marshal(st) + require.NoError(t, err) + return string(bytes) +} + +func (st tagsState) validateTransitionTo(t *testing.T, st2 tagsState) { + t.Logf("state1 = %v", st.serialize(t)) + t.Logf("state2 = %v", st2.serialize(t)) + + baseOpts := integration.ProgramTestOptions{} + if _, envConfigSet := os.LookupEnv("GOOGLE_ZONE"); envConfigSet { + baseOpts = getGoBaseOptions(t) + } + + opts := baseOpts.With(integration.ProgramTestOptions{ + Dir: "labels-combinations-go", + ExtraRuntimeValidation: validateStateResult(1, st, st2), + EditDirs: []integration.EditDir{{ + Dir: filepath.Join("labels-combinations-go", "step1"), + Additive: true, + ExtraRuntimeValidation: validateStateResult(2, st, st2), + }}, + Config: map[string]string{ + "state1": st.serialize(t), + "state2": st2.serialize(t), + }, + Quick: true, + DestroyOnCleanup: true, + }) + + integration.ProgramTest(t, &opts) +} + +func (st tagsState) expectedTags() map[string]string { + r := map[string]string{} + for k, v := range st.DefaultTags { + r[k] = v + } + for k, v := range st.ResourceTags { + r[k] = v + } + return r +} + +func validateStateResult(phase int, st1, st2 tagsState) func( + t *testing.T, + stack integration.RuntimeValidationStackInfo, +) { + var st tagsState + switch phase { + case 1: + st = st1 + default: + st = st2 + } + + return func(t *testing.T, stack integration.RuntimeValidationStackInfo) { + for k, v := range stack.Outputs { + actualTagsJSON := v.(string) + var actualTags map[string]string + err := json.Unmarshal([]byte(actualTagsJSON), &actualTags) + require.NoError(t, err) + t.Logf("phase: %d", phase) + t.Logf("state1: %v", st1.serialize(t)) + if phase == 2 { + t.Logf("state2: %v", st2.serialize(t)) + } + require.Equalf(t, st.expectedTags(), actualTags, "key=%s", k) + t.Logf("key=%s tags are as expected: %v", k, actualTagsJSON) + } + } +} diff --git a/examples/labels-combinations-go/Pulumi.yaml b/examples/labels-combinations-go/Pulumi.yaml new file mode 100644 index 0000000000..3b3d580e0f --- /dev/null +++ b/examples/labels-combinations-go/Pulumi.yaml @@ -0,0 +1,3 @@ +name: labels-combinations-go +description: Testing provider capability to label resources correctly +runtime: go diff --git a/examples/labels-combinations-go/go.mod b/examples/labels-combinations-go/go.mod new file mode 100644 index 0000000000..d59c07b4e9 --- /dev/null +++ b/examples/labels-combinations-go/go.mod @@ -0,0 +1,89 @@ +module github.com/pulumi/pulumi-aws/examples/tags-combinations-go + +go 1.21 + +require ( + github.com/pulumi/pulumi-aws/sdk/v6 v6.6.1 + github.com/pulumi/pulumi-gcp/sdk/v7 v7.0.0-alpha.0 + github.com/pulumi/pulumi/sdk/v3 v3.90.1 +) + +require ( + github.com/Microsoft/go-winio v0.5.2 // indirect + github.com/ProtonMail/go-crypto v0.0.0-20221026131551-cf6655e29de4 // indirect + github.com/acomagu/bufpipe v1.0.3 // indirect + github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da // indirect + github.com/agext/levenshtein v1.2.3 // indirect + github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect + github.com/atotto/clipboard v0.1.4 // indirect + github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect + github.com/blang/semver v3.5.1+incompatible // indirect + github.com/charmbracelet/bubbles v0.16.1 // indirect + github.com/charmbracelet/bubbletea v0.24.2 // indirect + github.com/charmbracelet/lipgloss v0.7.1 // indirect + github.com/cheggaaa/pb v1.0.29 // indirect + github.com/cloudflare/circl v1.3.3 // indirect + github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 // indirect + github.com/djherbis/times v1.5.0 // indirect + github.com/emirpasic/gods v1.18.1 // indirect + github.com/go-git/gcfg v1.5.0 // indirect + github.com/go-git/go-billy/v5 v5.4.0 // indirect + github.com/go-git/go-git/v5 v5.6.0 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang/glog v1.1.0 // indirect + github.com/golang/protobuf v1.5.3 // indirect + github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 // indirect + github.com/hashicorp/errwrap v1.1.0 // indirect + github.com/hashicorp/go-multierror v1.1.1 // indirect + github.com/hashicorp/hcl/v2 v2.17.0 // indirect + github.com/imdario/mergo v0.3.13 // indirect + github.com/inconshreveable/mousetrap v1.1.0 // indirect + github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect + github.com/kevinburke/ssh_config v1.2.0 // indirect + github.com/lucasb-eyer/go-colorful v1.2.0 // indirect + github.com/mattn/go-isatty v0.0.18 // indirect + github.com/mattn/go-localereader v0.0.1 // indirect + github.com/mattn/go-runewidth v0.0.14 // indirect + github.com/mitchellh/go-ps v1.0.0 // indirect + github.com/mitchellh/go-wordwrap v1.0.1 // indirect + github.com/muesli/ansi v0.0.0-20211018074035-2e021307bc4b // indirect + github.com/muesli/cancelreader v0.2.2 // indirect + github.com/muesli/reflow v0.3.0 // indirect + github.com/muesli/termenv v0.15.1 // indirect + github.com/opentracing/basictracer-go v1.1.0 // indirect + github.com/opentracing/opentracing-go v1.2.0 // indirect + github.com/pjbgf/sha1cd v0.3.0 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/pkg/term v1.1.0 // indirect + github.com/pulumi/esc v0.5.6 // indirect + github.com/rivo/uniseg v0.4.4 // indirect + github.com/rogpeppe/go-internal v1.11.0 // indirect + github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 // indirect + github.com/santhosh-tekuri/jsonschema/v5 v5.0.0 // indirect + github.com/sergi/go-diff v1.3.1 // indirect + github.com/skeema/knownhosts v1.1.0 // indirect + github.com/spf13/cast v1.4.1 // indirect + github.com/spf13/cobra v1.7.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/texttheater/golang-levenshtein v1.0.1 // indirect + github.com/tweekmonster/luser v0.0.0-20161003172636-3fa38070dbd7 // indirect + github.com/uber/jaeger-client-go v2.30.0+incompatible // indirect + github.com/uber/jaeger-lib v2.4.1+incompatible // indirect + github.com/xanzy/ssh-agent v0.3.3 // indirect + github.com/zclconf/go-cty v1.13.2 // indirect + go.uber.org/atomic v1.9.0 // indirect + golang.org/x/crypto v0.14.0 // indirect + golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect + golang.org/x/net v0.17.0 // indirect + golang.org/x/sync v0.2.0 // indirect + golang.org/x/sys v0.13.0 // indirect + golang.org/x/term v0.13.0 // indirect + golang.org/x/text v0.13.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20230706204954-ccb25ca9f130 // indirect + google.golang.org/grpc v1.57.0 // indirect + google.golang.org/protobuf v1.31.0 // indirect + gopkg.in/warnings.v0 v0.1.2 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect + lukechampine.com/frand v1.4.2 // indirect + sourcegraph.com/sourcegraph/appdash v0.0.0-20211028080628-e2786a622600 // indirect +) diff --git a/examples/labels-combinations-go/go.sum b/examples/labels-combinations-go/go.sum new file mode 100644 index 0000000000..988a9d0c3d --- /dev/null +++ b/examples/labels-combinations-go/go.sum @@ -0,0 +1,323 @@ +github.com/HdrHistogram/hdrhistogram-go v1.1.2 h1:5IcZpTvzydCQeHzK4Ef/D5rrSqwxob0t8PQPMybUNFM= +github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= +github.com/Microsoft/go-winio v0.5.2 h1:a9IhgEQBCUEk6QCdml9CiJGhAws+YwffDHEMp1VMrpA= +github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= +github.com/ProtonMail/go-crypto v0.0.0-20221026131551-cf6655e29de4 h1:ra2OtmuW0AE5csawV4YXMNGNQQXvLRps3z2Z59OPO+I= +github.com/ProtonMail/go-crypto v0.0.0-20221026131551-cf6655e29de4/go.mod h1:UBYPn8k0D56RtnR8RFQMjmh4KrZzWJ5o7Z9SYjossQ8= +github.com/acomagu/bufpipe v1.0.3 h1:fxAGrHZTgQ9w5QqVItgzwj235/uYZYgbXitB+dLupOk= +github.com/acomagu/bufpipe v1.0.3/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4= +github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da h1:KjTM2ks9d14ZYCvmHS9iAKVt9AyzRSqNU1qabPih5BY= +github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da/go.mod h1:eHEWzANqSiWQsof+nXEI9bUVUyV6F53Fp89EuCh2EAA= +github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7lmo= +github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= +github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8= +github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4= +github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw= +github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo= +github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= +github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= +github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4= +github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= +github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= +github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= +github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= +github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= +github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= +github.com/charmbracelet/bubbles v0.16.1 h1:6uzpAAaT9ZqKssntbvZMlksWHruQLNxg49H5WdeuYSY= +github.com/charmbracelet/bubbles v0.16.1/go.mod h1:2QCp9LFlEsBQMvIYERr7Ww2H2bA7xen1idUDIzm/+Xc= +github.com/charmbracelet/bubbletea v0.24.2 h1:uaQIKx9Ai6Gdh5zpTbGiWpytMU+CfsPp06RaW2cx/SY= +github.com/charmbracelet/bubbletea v0.24.2/go.mod h1:XdrNrV4J8GiyshTtx3DNuYkR1FDaJmO3l2nejekbsgg= +github.com/charmbracelet/lipgloss v0.7.1 h1:17WMwi7N1b1rVWOjMT+rCh7sQkvDU75B2hbZpc5Kc1E= +github.com/charmbracelet/lipgloss v0.7.1/go.mod h1:yG0k3giv8Qj8edTCbbg6AlQ5e8KNWpFujkNawKNhE2c= +github.com/cheggaaa/pb v1.0.29 h1:FckUN5ngEk2LpvuG0fw1GEFx6LtyY2pWI/Z2QgCnEYo= +github.com/cheggaaa/pb v1.0.29/go.mod h1:W40334L7FMC5JKWldsTWbdGjLo0RxUKK73K+TuPxX30= +github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I= +github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs= +github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= +github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 h1:q2hJAaP1k2wIvVRd/hEHD7lacgqrCPS+k8g1MndzfWY= +github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81/go.mod h1:YynlIjWYF8myEu6sdkwKIvGQq+cOckRm6So2avqoYAk= +github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/djherbis/times v1.5.0 h1:79myA211VwPhFTqUk8xehWrsEO+zcIZj0zT8mXPVARU= +github.com/djherbis/times v1.5.0/go.mod h1:5q7FDLvbNg1L/KaBmPcWlVR9NmoKo3+ucqUA3ijQhA0= +github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= +github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= +github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= +github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/gliderlabs/ssh v0.3.5 h1:OcaySEmAQJgyYcArR+gGGTHCyE7nvhEMTlYY+Dp8CpY= +github.com/gliderlabs/ssh v0.3.5/go.mod h1:8XB4KraRrX39qHhT6yxPsHedjA08I/uBVwj4xC+/+z4= +github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4= +github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= +github.com/go-git/go-billy/v5 v5.3.1/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= +github.com/go-git/go-billy/v5 v5.4.0 h1:Vaw7LaSTRJOUric7pe4vnzBSgyuf2KrLsu2Y4ZpQBDE= +github.com/go-git/go-billy/v5 v5.4.0/go.mod h1:vjbugF6Fz7JIflbVpl1hJsGjSHNltrSw45YK/ukIvQg= +github.com/go-git/go-git-fixtures/v4 v4.3.1 h1:y5z6dd3qi8Hl+stezc8p3JxDkoTRqMAlKnXHuzrfjTQ= +github.com/go-git/go-git-fixtures/v4 v4.3.1/go.mod h1:8LHG1a3SRW71ettAD/jW13h8c6AqjVSeL11RAdgaqpo= +github.com/go-git/go-git/v5 v5.6.0 h1:JvBdYfcttd+0kdpuWO7KTu0FYgCf5W0t5VwkWGobaa4= +github.com/go-git/go-git/v5 v5.6.0/go.mod h1:6nmJ0tJ3N4noMV1Omv7rC5FG3/o8Cm51TB4CJp7mRmE= +github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang/glog v1.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE= +github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 h1:MJG/KsmcqMwFAkh8mTnAwhyKoB+sTAnY4CACC110tbU= +github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645/go.mod h1:6iZfnjpejD4L/4DwD7NryNaJyCQdzwWwH2MWhCA90Kw= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= +github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= +github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= +github.com/hashicorp/hcl/v2 v2.17.0 h1:z1XvSUyXd1HP10U4lrLg5e0JMVz6CPaJvAgxM0KNZVY= +github.com/hashicorp/hcl/v2 v2.17.0/go.mod h1:gJyW2PTShkJqQBKpAmPO3yxMxIuoXkOF2TpqXzrQyx4= +github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= +github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= +github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= +github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= +github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= +github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= +github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= +github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= +github.com/matryer/is v1.2.0 h1:92UTHpy8CDwaJ08GqLDzhhuixiBUUD1p3AU6PHddz4A= +github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= +github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= +github.com/mattn/go-isatty v0.0.18 h1:DOKFKCQ7FNG2L1rbrmstDN4QVRdS89Nkh85u68Uwp98= +github.com/mattn/go-isatty v0.0.18/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-localereader v0.0.1 h1:ygSAOl7ZXTx4RdPYinUpg6W99U8jWvWi9Ye2JC/oIi4= +github.com/mattn/go-localereader v0.0.1/go.mod h1:8fBrzywKY7BI3czFoHkuzRoWE9C+EiG4R1k4Cjx5p88= +github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= +github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU= +github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/mitchellh/go-ps v1.0.0 h1:i6ampVEEF4wQFF+bkYfwYgY+F/uYJDktmvLPf7qIgjc= +github.com/mitchellh/go-ps v1.0.0/go.mod h1:J4lOc8z8yJs6vUwklHw2XEIiT4z4C40KtWVN3nvg8Pg= +github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= +github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= +github.com/mmcloughlin/avo v0.5.0/go.mod h1:ChHFdoV7ql95Wi7vuq2YT1bwCJqiWdZrQ1im3VujLYM= +github.com/muesli/ansi v0.0.0-20211018074035-2e021307bc4b h1:1XF24mVaiu7u+CFywTdcDo2ie1pzzhwjt6RHqzpMU34= +github.com/muesli/ansi v0.0.0-20211018074035-2e021307bc4b/go.mod h1:fQuZ0gauxyBcmsdE3ZT4NasjaRdxmbCS0jRHsrWu3Ho= +github.com/muesli/cancelreader v0.2.2 h1:3I4Kt4BQjOR54NavqnDogx/MIoWBFa0StPA8ELUXHmA= +github.com/muesli/cancelreader v0.2.2/go.mod h1:3XuTXfFS2VjM+HTLZY9Ak0l6eUKfijIfMUZ4EgX0QYo= +github.com/muesli/reflow v0.3.0 h1:IFsN6K9NfGtjeggFP+68I4chLZV2yIKsXJFNZ+eWh6s= +github.com/muesli/reflow v0.3.0/go.mod h1:pbwTDkVPibjO2kyvBQRBxTWEEGDGq0FlB1BIKtnHY/8= +github.com/muesli/termenv v0.15.1 h1:UzuTb/+hhlBugQz28rpzey4ZuKcZ03MeKsoG7IJZIxs= +github.com/muesli/termenv v0.15.1/go.mod h1:HeAQPTzpfs016yGtA4g00CsdYnVLJvxsS4ANqrZs2sQ= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/opentracing/basictracer-go v1.1.0 h1:Oa1fTSBvAl8pa3U+IJYqrKm0NALwH9OsgwOqDv4xJW0= +github.com/opentracing/basictracer-go v1.1.0/go.mod h1:V2HZueSJEp879yv285Aap1BS69fQMD+MNP1mRs6mBQc= +github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= +github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= +github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= +github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/term v1.1.0 h1:xIAAdCMh3QIAy+5FrE8Ad8XoDhEU4ufwbaSozViP9kk= +github.com/pkg/term v1.1.0/go.mod h1:E25nymQcrSllhX42Ok8MRm1+hyBdHY0dCeiKZ9jpNGw= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pulumi/esc v0.5.6 h1:4WV3X7OEVcChIwbSG+JxhZDdmq/q7lFPaSjHRYlPwmI= +github.com/pulumi/esc v0.5.6/go.mod h1:wpwNfVS5fV7Kd51j4dJ6FWYlKfxdqyppgp0gtkzqH04= +github.com/pulumi/pulumi-aws/sdk/v6 v6.6.1 h1:P90bdh/pjHhrM5soVleBJ2ydSnkgM42CrRiSPlsiJiw= +github.com/pulumi/pulumi-aws/sdk/v6 v6.6.1/go.mod h1:LpjbjfUmXgtsYv146QHQ8zhGstoNHhwmNuHKQUKP9xw= +github.com/pulumi/pulumi-gcp/sdk/v7 v7.0.0-alpha.0 h1:zMclSCMTKp0R6vHM3fKLCFDK1I2F9/4J10KnPuveIIQ= +github.com/pulumi/pulumi-gcp/sdk/v7 v7.0.0-alpha.0/go.mod h1:3ziblY4baU1PSPydWwKvgZ5dhZNjOPPg3ZocY5CE3UI= +github.com/pulumi/pulumi/sdk/v3 v3.90.1 h1:iT4t57N92WGhEQtg+KVDEmYzgfEyri39eihQzcNmtrM= +github.com/pulumi/pulumi/sdk/v3 v3.90.1/go.mod h1:zYaQQibB2pYKy/uG4c4YkX7lQIBpZ0KsuMaq/3HsIBQ= +github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= +github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= +github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= +github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 h1:OkMGxebDjyw0ULyrTYWeN0UNCCkmCWfjPnIA2W6oviI= +github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06/go.mod h1:+ePHsJ1keEjQtpvf9HHw0f4ZeJ0TLRsxhunSI2hYJSs= +github.com/santhosh-tekuri/jsonschema/v5 v5.0.0 h1:TToq11gyfNlrMFZiYujSekIsPd9AmsA2Bj/iv+s4JHE= +github.com/santhosh-tekuri/jsonschema/v5 v5.0.0/go.mod h1:FKdcjfQW6rpZSnxxUvEA5H/cDPdvJ/SZJQLWWXWGrZ0= +github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= +github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8= +github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I= +github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/skeema/knownhosts v1.1.0 h1:Wvr9V0MxhjRbl3f9nMnKnFfiWTJmtECJ9Njkea3ysW0= +github.com/skeema/knownhosts v1.1.0/go.mod h1:sKFq3RD6/TKZkSWn8boUbDC7Qkgcv+8XXijpFO6roag= +github.com/spf13/cast v1.4.1 h1:s0hze+J0196ZfEMTs80N7UlFt0BDuQ7Q+JDnHiMWKdA= +github.com/spf13/cast v1.4.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= +github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/texttheater/golang-levenshtein v1.0.1 h1:+cRNoVrfiwufQPhoMzB6N0Yf/Mqajr6t1lOv8GyGE2U= +github.com/texttheater/golang-levenshtein v1.0.1/go.mod h1:PYAKrbF5sAiq9wd+H82hs7gNaen0CplQ9uvm6+enD/8= +github.com/tweekmonster/luser v0.0.0-20161003172636-3fa38070dbd7 h1:X9dsIWPuuEJlPX//UmRKophhOKCGXc46RVIGuttks68= +github.com/tweekmonster/luser v0.0.0-20161003172636-3fa38070dbd7/go.mod h1:UxoP3EypF8JfGEjAII8jx1q8rQyDnX8qdTCs/UQBVIE= +github.com/uber/jaeger-client-go v2.30.0+incompatible h1:D6wyKGCecFaSRUpo8lCVbaOOb6ThwMmTEbhRwtKR97o= +github.com/uber/jaeger-client-go v2.30.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= +github.com/uber/jaeger-lib v2.4.1+incompatible h1:td4jdvLcExb4cBISKIpHuGoVXh+dVKhn2Um6rjCsSsg= +github.com/uber/jaeger-lib v2.4.1+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= +github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= +github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +github.com/zclconf/go-cty v1.13.2 h1:4GvrUxe/QUDYuJKAav4EYqdM47/kZa672LwmXFmEKT0= +github.com/zclconf/go-cty v1.13.2/go.mod h1:YKQzy/7pZ7iq2jNFzy5go57xdxdWoLLpaEp4u238AE0= +go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= +go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +golang.org/x/arch v0.1.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220826181053-bd7e27e6170d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= +golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= +golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= +golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= +golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI= +golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200421231249-e086a090c8fd/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220826154423-83b083e8dc8b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= +golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= +golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= +golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220825204002-c680a09ffe64/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.0.0-20220722155259-a9ba230a4035/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= +golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek= +golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230706204954-ccb25ca9f130 h1:2FZP5XuJY9zQyGM5N0rtovnoXjiMUEIUMvw0m9wlpLc= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230706204954-ccb25ca9f130/go.mod h1:8mL13HKkDa+IuJ8yruA3ci0q+0vsUz4m//+ottjwS5o= +google.golang.org/grpc v1.57.0 h1:kfzNeI/klCGD2YPMUlaGNT3pxvYfga7smW3Vth8Zsiw= +google.golang.org/grpc v1.57.0/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= +gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +lukechampine.com/frand v1.4.2 h1:RzFIpOvkMXuPMBb9maa4ND4wjBn71E1Jpf8BzJHMaVw= +lukechampine.com/frand v1.4.2/go.mod h1:4S/TM2ZgrKejMcKMbeLjISpJMO+/eZ1zu3vYX9dtj3s= +pgregory.net/rapid v0.5.5 h1:jkgx1TjbQPD/feRoK+S/mXw9e1uj6WilpHrXJowi6oA= +pgregory.net/rapid v0.5.5/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= +rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= +sourcegraph.com/sourcegraph/appdash v0.0.0-20211028080628-e2786a622600 h1:hfyJ5ku9yFtLVOiSxa3IN+dx5eBQT9mPmKFypAmg8XM= +sourcegraph.com/sourcegraph/appdash v0.0.0-20211028080628-e2786a622600/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= diff --git a/examples/labels-combinations-go/main.go b/examples/labels-combinations-go/main.go new file mode 100644 index 0000000000..3887d9616a --- /dev/null +++ b/examples/labels-combinations-go/main.go @@ -0,0 +1,67 @@ +// Copyright 2016-2023, Pulumi Corporation. All rights reserved. + +package main + +import ( + "encoding/json" + + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi/config" + + "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp" + "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/storage" +) + +type state struct { + DefaultTags map[string]string `json:"defaultTags"` + ResourceTags map[string]string `json:"resourceTags"` +} + +func main() { + pulumi.Run(func(ctx *pulumi.Context) error { + conf := config.New(ctx, "") + tagsState := conf.Require("state1") + + var s state + + err := json.Unmarshal([]byte(tagsState), &s) + if err != nil { + return err + } + + tagsMap := pulumi.StringMap{} + for k, v := range s.ResourceTags { + tagsMap[k] = pulumi.String(v) + } + + defaultTagsMap := pulumi.StringMap{} + for k, v := range s.DefaultTags { + defaultTagsMap[k] = pulumi.String(v) + } + + p, err := gcp.NewProvider(ctx, "prov", &gcp.ProviderArgs{ + DefaultLabels: defaultTagsMap, + }) + if err != nil { + return err + } + + bucket, err := storage.NewBucket(ctx, "demo-bucket", &storage.BucketArgs{ + Location: pulumi.String("US"), + Labels: tagsMap, + }, pulumi.Provider(p)) + if err != nil { + return err + } + + ctx.Export("bucket", bucket.TerraformLabels.ApplyT(func(x interface{}) string { + b, err := json.Marshal(x.(map[string]string)) + if err != nil { + panic(err) + } + return string(b) + })) + + return nil + }) +} diff --git a/examples/labels-combinations-go/step1/main.go b/examples/labels-combinations-go/step1/main.go new file mode 100644 index 0000000000..0b4ff53aba --- /dev/null +++ b/examples/labels-combinations-go/step1/main.go @@ -0,0 +1,67 @@ +// Copyright 2016-2023, Pulumi Corporation. All rights reserved. + +package main + +import ( + "encoding/json" + + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi/config" + + "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp" + "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/storage" +) + +type state struct { + DefaultTags map[string]string `json:"defaultTags"` + ResourceTags map[string]string `json:"resourceTags"` +} + +func main() { + pulumi.Run(func(ctx *pulumi.Context) error { + conf := config.New(ctx, "") + tagsState := conf.Require("state2") + + var s state + + err := json.Unmarshal([]byte(tagsState), &s) + if err != nil { + return err + } + + tagsMap := pulumi.StringMap{} + for k, v := range s.ResourceTags { + tagsMap[k] = pulumi.String(v) + } + + defaultTagsMap := pulumi.StringMap{} + for k, v := range s.DefaultTags { + defaultTagsMap[k] = pulumi.String(v) + } + + p, err := gcp.NewProvider(ctx, "prov", &gcp.ProviderArgs{ + DefaultLabels: defaultTagsMap, + }) + if err != nil { + return err + } + + bucket, err := storage.NewBucket(ctx, "demo-bucket", &storage.BucketArgs{ + Location: pulumi.String("US"), + Labels: tagsMap, + }, pulumi.Provider(p)) + if err != nil { + return err + } + + ctx.Export("bucket", bucket.TerraformLabels.ApplyT(func(x interface{}) string { + b, err := json.Marshal(x.(map[string]string)) + if err != nil { + panic(err) + } + return string(b) + })) + + return nil + }) +} From 3f42517a6b467070eff7ff3faf203e9d0bf0f45a Mon Sep 17 00:00:00 2001 From: Anton Tayanovskyy Date: Wed, 1 Nov 2023 19:37:19 -0400 Subject: [PATCH 2/7] Further fixes --- examples/examples_go_test.go | 101 +++++++++--------- examples/labels-combinations-go/go.mod | 3 +- examples/labels-combinations-go/go.sum | 8 +- examples/labels-combinations-go/main.go | 26 ++--- examples/labels-combinations-go/step1/main.go | 26 ++--- 5 files changed, 82 insertions(+), 82 deletions(-) diff --git a/examples/examples_go_test.go b/examples/examples_go_test.go index 77f4a8c3a7..7e558732a9 100644 --- a/examples/examples_go_test.go +++ b/examples/examples_go_test.go @@ -1,6 +1,4 @@ // Copyright 2016-2017, Pulumi Corporation. All rights reserved. -//go:build go || all -// +build go all package examples @@ -186,31 +184,31 @@ func GenerateRandomString(n int) (string, error) { func TestLabelsCombinationsGo(t *testing.T) { type testCase struct { name string - s1 tagsState - s2 tagsState + s1 labelsState + s2 labelsState } testCases := []testCase{ { "can add an empty label", - tagsState{ - DefaultTags: map[string]string{}, - ResourceTags: map[string]string{}, + labelsState{ + DefaultLabels: map[string]string{}, + Labels: map[string]string{}, }, - tagsState{ - DefaultTags: map[string]string{}, - ResourceTags: map[string]string{"x": ""}, + labelsState{ + DefaultLabels: map[string]string{}, + Labels: map[string]string{"x": ""}, }, }, { "convoluted test case found by random-sampling", - tagsState{ - DefaultTags: map[string]string{"x": "", "y": "s"}, - ResourceTags: map[string]string{"x": ""}, + labelsState{ + DefaultLabels: map[string]string{"x": "", "y": "s"}, + Labels: map[string]string{"x": ""}, }, - tagsState{ - DefaultTags: map[string]string{"x": ""}, - ResourceTags: map[string]string{"x": "", "y": ""}, + labelsState{ + DefaultLabels: map[string]string{"x": ""}, + Labels: map[string]string{"x": "", "y": ""}, }, }, } @@ -225,35 +223,35 @@ func TestLabelsCombinationsGo(t *testing.T) { } func TestRandomLabelsCombinationsGo(t *testing.T) { - tagValues := []string{"", "s"} // empty values are conflated with unknowns in TF internals, must test + labelValues := []string{"", "s"} // empty values are conflated with unknowns in TF internals, must test - tagsValues := []map[string]string{ + labelsValues := []map[string]string{ nil, {}, } - for _, tag := range tagValues { - m := map[string]string{"x": tag} - tagsValues = append(tagsValues, m) + for _, label := range labelValues { + m := map[string]string{"x": label} + labelsValues = append(labelsValues, m) } - for _, tag1 := range tagValues { - for _, tag2 := range tagValues { + for _, label1 := range labelValues { + for _, label2 := range labelValues { m := map[string]string{ - "x": tag1, - "y": tag2, + "x": label1, + "y": label2, } - tagsValues = append(tagsValues, m) + labelsValues = append(labelsValues, m) } } - states := []tagsState{} + states := []labelsState{} - for _, tags1 := range tagsValues { - for _, tags2 := range tagsValues { - states = append(states, tagsState{ - DefaultTags: tags1, - ResourceTags: tags2, + for _, label1 := range labelsValues { + for _, label2 := range labelsValues { + states = append(states, labelsState{ + DefaultLabels: label1, + Labels: label2, }) } } @@ -272,22 +270,29 @@ func TestRandomLabelsCombinationsGo(t *testing.T) { } } -type tagsState struct { - DefaultTags map[string]string `json:"defaultTags"` - ResourceTags map[string]string `json:"resourceTags"` +type labelsState struct { + DefaultLabels map[string]string `json:"defaultLabels"` + Labels map[string]string `json:"labels"` } -func (st tagsState) serialize(t *testing.T) string { +func (st labelsState) serialize(t *testing.T) string { bytes, err := json.Marshal(st) require.NoError(t, err) return string(bytes) } -func (st tagsState) validateTransitionTo(t *testing.T, st2 tagsState) { +func (st labelsState) validateTransitionTo(t *testing.T, st2 labelsState) { t.Logf("state1 = %v", st.serialize(t)) t.Logf("state2 = %v", st2.serialize(t)) - baseOpts := integration.ProgramTestOptions{} + goSdkFolder, err := filepath.Abs(filepath.Join("..", "sdk")) + require.NoError(t, err) + + baseOpts := integration.ProgramTestOptions{ + Dependencies: []string{ + fmt.Sprintf("github.com/pulumi/pulumi-gcp/sdk/v7=%s", goSdkFolder), + }, + } if _, envConfigSet := os.LookupEnv("GOOGLE_ZONE"); envConfigSet { baseOpts = getGoBaseOptions(t) } @@ -311,22 +316,22 @@ func (st tagsState) validateTransitionTo(t *testing.T, st2 tagsState) { integration.ProgramTest(t, &opts) } -func (st tagsState) expectedTags() map[string]string { +func (st labelsState) expectedLabels() map[string]string { r := map[string]string{} - for k, v := range st.DefaultTags { + for k, v := range st.DefaultLabels { r[k] = v } - for k, v := range st.ResourceTags { + for k, v := range st.Labels { r[k] = v } return r } -func validateStateResult(phase int, st1, st2 tagsState) func( +func validateStateResult(phase int, st1, st2 labelsState) func( t *testing.T, stack integration.RuntimeValidationStackInfo, ) { - var st tagsState + var st labelsState switch phase { case 1: st = st1 @@ -336,17 +341,17 @@ func validateStateResult(phase int, st1, st2 tagsState) func( return func(t *testing.T, stack integration.RuntimeValidationStackInfo) { for k, v := range stack.Outputs { - actualTagsJSON := v.(string) - var actualTags map[string]string - err := json.Unmarshal([]byte(actualTagsJSON), &actualTags) + actualLabelsJSON := v.(string) + var actualLabels map[string]string + err := json.Unmarshal([]byte(actualLabelsJSON), &actualLabels) require.NoError(t, err) t.Logf("phase: %d", phase) t.Logf("state1: %v", st1.serialize(t)) if phase == 2 { t.Logf("state2: %v", st2.serialize(t)) } - require.Equalf(t, st.expectedTags(), actualTags, "key=%s", k) - t.Logf("key=%s tags are as expected: %v", k, actualTagsJSON) + require.Equalf(t, st.expectedLabels(), actualLabels, "key=%s", k) + t.Logf("key=%s labels are as expected: %v", k, actualLabelsJSON) } } } diff --git a/examples/labels-combinations-go/go.mod b/examples/labels-combinations-go/go.mod index d59c07b4e9..857fc65d52 100644 --- a/examples/labels-combinations-go/go.mod +++ b/examples/labels-combinations-go/go.mod @@ -3,9 +3,8 @@ module github.com/pulumi/pulumi-aws/examples/tags-combinations-go go 1.21 require ( - github.com/pulumi/pulumi-aws/sdk/v6 v6.6.1 github.com/pulumi/pulumi-gcp/sdk/v7 v7.0.0-alpha.0 - github.com/pulumi/pulumi/sdk/v3 v3.90.1 + github.com/pulumi/pulumi/sdk/v3 v3.91.1 ) require ( diff --git a/examples/labels-combinations-go/go.sum b/examples/labels-combinations-go/go.sum index 988a9d0c3d..a5edcf7181 100644 --- a/examples/labels-combinations-go/go.sum +++ b/examples/labels-combinations-go/go.sum @@ -144,12 +144,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pulumi/esc v0.5.6 h1:4WV3X7OEVcChIwbSG+JxhZDdmq/q7lFPaSjHRYlPwmI= github.com/pulumi/esc v0.5.6/go.mod h1:wpwNfVS5fV7Kd51j4dJ6FWYlKfxdqyppgp0gtkzqH04= -github.com/pulumi/pulumi-aws/sdk/v6 v6.6.1 h1:P90bdh/pjHhrM5soVleBJ2ydSnkgM42CrRiSPlsiJiw= -github.com/pulumi/pulumi-aws/sdk/v6 v6.6.1/go.mod h1:LpjbjfUmXgtsYv146QHQ8zhGstoNHhwmNuHKQUKP9xw= -github.com/pulumi/pulumi-gcp/sdk/v7 v7.0.0-alpha.0 h1:zMclSCMTKp0R6vHM3fKLCFDK1I2F9/4J10KnPuveIIQ= -github.com/pulumi/pulumi-gcp/sdk/v7 v7.0.0-alpha.0/go.mod h1:3ziblY4baU1PSPydWwKvgZ5dhZNjOPPg3ZocY5CE3UI= -github.com/pulumi/pulumi/sdk/v3 v3.90.1 h1:iT4t57N92WGhEQtg+KVDEmYzgfEyri39eihQzcNmtrM= -github.com/pulumi/pulumi/sdk/v3 v3.90.1/go.mod h1:zYaQQibB2pYKy/uG4c4YkX7lQIBpZ0KsuMaq/3HsIBQ= +github.com/pulumi/pulumi/sdk/v3 v3.91.1 h1:6I9GMmHv23X+G6hoduU1XE6hBWSNtB+zcb1MX17YvlA= +github.com/pulumi/pulumi/sdk/v3 v3.91.1/go.mod h1:zYaQQibB2pYKy/uG4c4YkX7lQIBpZ0KsuMaq/3HsIBQ= github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= diff --git a/examples/labels-combinations-go/main.go b/examples/labels-combinations-go/main.go index 3887d9616a..c4d678f83a 100644 --- a/examples/labels-combinations-go/main.go +++ b/examples/labels-combinations-go/main.go @@ -13,34 +13,34 @@ import ( ) type state struct { - DefaultTags map[string]string `json:"defaultTags"` - ResourceTags map[string]string `json:"resourceTags"` + DefaultLabels map[string]string `json:"defaultLabels"` + Labels map[string]string `json:"labels"` } func main() { pulumi.Run(func(ctx *pulumi.Context) error { conf := config.New(ctx, "") - tagsState := conf.Require("state1") + labelsState := conf.Require("state1") var s state - err := json.Unmarshal([]byte(tagsState), &s) + err := json.Unmarshal([]byte(labelsState), &s) if err != nil { return err } - tagsMap := pulumi.StringMap{} - for k, v := range s.ResourceTags { - tagsMap[k] = pulumi.String(v) + labelsMap := pulumi.StringMap{} + for k, v := range s.Labels { + labelsMap[k] = pulumi.String(v) } - defaultTagsMap := pulumi.StringMap{} - for k, v := range s.DefaultTags { - defaultTagsMap[k] = pulumi.String(v) + defaultLabelsMap := pulumi.StringMap{} + for k, v := range s.DefaultLabels { + defaultLabelsMap[k] = pulumi.String(v) } p, err := gcp.NewProvider(ctx, "prov", &gcp.ProviderArgs{ - DefaultLabels: defaultTagsMap, + DefaultLabels: defaultLabelsMap, }) if err != nil { return err @@ -48,13 +48,13 @@ func main() { bucket, err := storage.NewBucket(ctx, "demo-bucket", &storage.BucketArgs{ Location: pulumi.String("US"), - Labels: tagsMap, + Labels: labelsMap, }, pulumi.Provider(p)) if err != nil { return err } - ctx.Export("bucket", bucket.TerraformLabels.ApplyT(func(x interface{}) string { + ctx.Export("bucket", bucket.PulumiLabels.ApplyT(func(x interface{}) string { b, err := json.Marshal(x.(map[string]string)) if err != nil { panic(err) diff --git a/examples/labels-combinations-go/step1/main.go b/examples/labels-combinations-go/step1/main.go index 0b4ff53aba..74f8aeedae 100644 --- a/examples/labels-combinations-go/step1/main.go +++ b/examples/labels-combinations-go/step1/main.go @@ -13,34 +13,34 @@ import ( ) type state struct { - DefaultTags map[string]string `json:"defaultTags"` - ResourceTags map[string]string `json:"resourceTags"` + DefaultLabels map[string]string `json:"defaultLabels"` + Labels map[string]string `json:"labels"` } func main() { pulumi.Run(func(ctx *pulumi.Context) error { conf := config.New(ctx, "") - tagsState := conf.Require("state2") + labelsState := conf.Require("state2") var s state - err := json.Unmarshal([]byte(tagsState), &s) + err := json.Unmarshal([]byte(labelsState), &s) if err != nil { return err } - tagsMap := pulumi.StringMap{} - for k, v := range s.ResourceTags { - tagsMap[k] = pulumi.String(v) + labelsMap := pulumi.StringMap{} + for k, v := range s.Labels { + labelsMap[k] = pulumi.String(v) } - defaultTagsMap := pulumi.StringMap{} - for k, v := range s.DefaultTags { - defaultTagsMap[k] = pulumi.String(v) + defaultLabelsMap := pulumi.StringMap{} + for k, v := range s.DefaultLabels { + defaultLabelsMap[k] = pulumi.String(v) } p, err := gcp.NewProvider(ctx, "prov", &gcp.ProviderArgs{ - DefaultLabels: defaultTagsMap, + DefaultLabels: defaultLabelsMap, }) if err != nil { return err @@ -48,13 +48,13 @@ func main() { bucket, err := storage.NewBucket(ctx, "demo-bucket", &storage.BucketArgs{ Location: pulumi.String("US"), - Labels: tagsMap, + Labels: labelsMap, }, pulumi.Provider(p)) if err != nil { return err } - ctx.Export("bucket", bucket.TerraformLabels.ApplyT(func(x interface{}) string { + ctx.Export("bucket", bucket.PulumiLabels.ApplyT(func(x interface{}) string { b, err := json.Marshal(x.(map[string]string)) if err != nil { panic(err) From 1acde3a644713bec89cf32e2f729eaa31cf8eb7b Mon Sep 17 00:00:00 2001 From: Anton Tayanovskyy Date: Wed, 1 Nov 2023 21:56:33 -0400 Subject: [PATCH 3/7] PR feedback: simplify t.Run Co-authored-by: Ian Wahbe --- examples/examples_go_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/examples_go_test.go b/examples/examples_go_test.go index 7e558732a9..3ed4f77440 100644 --- a/examples/examples_go_test.go +++ b/examples/examples_go_test.go @@ -260,7 +260,7 @@ func TestRandomLabelsCombinationsGo(t *testing.T) { t.Logf("random-sampling 100 state transitions") for i := 0; i < 100; i++ { - t.Run(fmt.Sprintf("test-%d", i), func(t *testing.T) { + t.Run("", func(t *testing.T) { t.Parallel() i := rand.Intn(len(states)) j := rand.Intn(len(states)) From fd30623b1b492d05c850b56a89bffc4cab2084a3 Mon Sep 17 00:00:00 2001 From: Anton Tayanovskyy Date: Wed, 1 Nov 2023 21:57:16 -0400 Subject: [PATCH 4/7] PR feedback: reorder imports --- examples/examples_go_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/examples_go_test.go b/examples/examples_go_test.go index 3ed4f77440..337dfb6a52 100644 --- a/examples/examples_go_test.go +++ b/examples/examples_go_test.go @@ -9,6 +9,7 @@ import ( "fmt" "math/big" "math/rand" + "os" "path/filepath" "testing" @@ -19,7 +20,6 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumi" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "os" ) func TestAccBucketGo(t *testing.T) { From 0b4550af646303f65123c004002dc6fd236b0218 Mon Sep 17 00:00:00 2001 From: Guinevere Saenger Date: Thu, 2 Nov 2023 09:16:34 -0700 Subject: [PATCH 5/7] add two extra tests --- examples/examples_go_test.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/examples/examples_go_test.go b/examples/examples_go_test.go index 337dfb6a52..39385ea9d3 100644 --- a/examples/examples_go_test.go +++ b/examples/examples_go_test.go @@ -211,6 +211,28 @@ func TestLabelsCombinationsGo(t *testing.T) { Labels: map[string]string{"x": "", "y": ""}, }, }, + { + "can add a new default label on Update of existing stack", + labelsState{ + DefaultLabels: map[string]string{}, + Labels: map[string]string{}, + }, + labelsState{ + DefaultLabels: map[string]string{"hello": "goodbye"}, + Labels: map[string]string{}, + }, + }, + { + "no changes means no changes", + labelsState{ + DefaultLabels: map[string]string{}, + Labels: map[string]string{}, + }, + labelsState{ + DefaultLabels: map[string]string{}, + Labels: map[string]string{}, + }, + }, } for _, tc := range testCases { From e4915aa93a12b72e20f237fa4abd521ec17e1896 Mon Sep 17 00:00:00 2001 From: Anton Tayanovskyy Date: Thu, 2 Nov 2023 15:17:08 -0400 Subject: [PATCH 6/7] Revert PR suggestion --- examples/examples_go_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/examples_go_test.go b/examples/examples_go_test.go index 39385ea9d3..ae21fcc577 100644 --- a/examples/examples_go_test.go +++ b/examples/examples_go_test.go @@ -282,7 +282,7 @@ func TestRandomLabelsCombinationsGo(t *testing.T) { t.Logf("random-sampling 100 state transitions") for i := 0; i < 100; i++ { - t.Run("", func(t *testing.T) { + t.Run(fmt.Sprintf("test%d", i), func(t *testing.T) { t.Parallel() i := rand.Intn(len(states)) j := rand.Intn(len(states)) From c5f9cb63de80bed0340587b8791fcf196398031a Mon Sep 17 00:00:00 2001 From: Guinevere Saenger Date: Thu, 2 Nov 2023 14:36:53 -0700 Subject: [PATCH 7/7] Update to bridge at commit ed35c1e07ed1 which can set XSkipDetailedDiffForChanges. Re-add Go build tags to Go test file. --- examples/examples_go_test.go | 2 ++ examples/labels-combinations-go/go.sum | 2 ++ provider/go.mod | 4 ++-- provider/go.sum | 8 ++++---- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/examples/examples_go_test.go b/examples/examples_go_test.go index ae21fcc577..f59bc54b97 100644 --- a/examples/examples_go_test.go +++ b/examples/examples_go_test.go @@ -1,4 +1,6 @@ // Copyright 2016-2017, Pulumi Corporation. All rights reserved. +//go:build go || all +// +build go all package examples diff --git a/examples/labels-combinations-go/go.sum b/examples/labels-combinations-go/go.sum index a5edcf7181..66b1b8f114 100644 --- a/examples/labels-combinations-go/go.sum +++ b/examples/labels-combinations-go/go.sum @@ -144,6 +144,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pulumi/esc v0.5.6 h1:4WV3X7OEVcChIwbSG+JxhZDdmq/q7lFPaSjHRYlPwmI= github.com/pulumi/esc v0.5.6/go.mod h1:wpwNfVS5fV7Kd51j4dJ6FWYlKfxdqyppgp0gtkzqH04= +github.com/pulumi/pulumi-gcp/sdk/v7 v7.0.0-alpha.0 h1:zMclSCMTKp0R6vHM3fKLCFDK1I2F9/4J10KnPuveIIQ= +github.com/pulumi/pulumi-gcp/sdk/v7 v7.0.0-alpha.0/go.mod h1:3ziblY4baU1PSPydWwKvgZ5dhZNjOPPg3ZocY5CE3UI= github.com/pulumi/pulumi/sdk/v3 v3.91.1 h1:6I9GMmHv23X+G6hoduU1XE6hBWSNtB+zcb1MX17YvlA= github.com/pulumi/pulumi/sdk/v3 v3.91.1/go.mod h1:zYaQQibB2pYKy/uG4c4YkX7lQIBpZ0KsuMaq/3HsIBQ= github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= diff --git a/provider/go.mod b/provider/go.mod index 62679078e6..397e597947 100644 --- a/provider/go.mod +++ b/provider/go.mod @@ -5,8 +5,8 @@ go 1.21.0 require ( github.com/hashicorp/terraform-provider-google-beta v0.0.0 github.com/pulumi/providertest v0.0.2 - github.com/pulumi/pulumi-terraform-bridge/pf v0.18.3 - github.com/pulumi/pulumi-terraform-bridge/v3 v3.63.2 + github.com/pulumi/pulumi-terraform-bridge/pf v0.18.4-0.20231102205918-ed35c1e07ed1 + github.com/pulumi/pulumi-terraform-bridge/v3 v3.63.3-0.20231102205918-ed35c1e07ed1 github.com/pulumi/pulumi/pkg/v3 v3.91.1 github.com/pulumi/pulumi/sdk/v3 v3.91.1 github.com/stretchr/testify v1.8.4 diff --git a/provider/go.sum b/provider/go.sum index c899726451..6e8025a491 100644 --- a/provider/go.sum +++ b/provider/go.sum @@ -2209,12 +2209,12 @@ github.com/pulumi/providertest v0.0.2 h1:XtnO603irWnSgfIbz6OK8hffIJ0GIrKRl3tYMJw github.com/pulumi/providertest v0.0.2/go.mod h1:kZYBA14iemv3X4G4xsBKaa72zVbn//IyL5HTYKpLuy0= github.com/pulumi/pulumi-java/pkg v0.9.8 h1:c8mYsalnRXA2Ibgvv6scefOn6mW1Vb0UT0mcDqjsivQ= github.com/pulumi/pulumi-java/pkg v0.9.8/go.mod h1:c6rSw/+q4O0IImgJ9axxoC6QesbPYWBaG5gimbHouUQ= -github.com/pulumi/pulumi-terraform-bridge/pf v0.18.3 h1:Y41ChQl59yNIM7r2oeIAdB3ysV9uHQcIio9yEcqeEdI= -github.com/pulumi/pulumi-terraform-bridge/pf v0.18.3/go.mod h1:apif6z4X21j859e6+gKmw4WoaalaF8TyKMVSa8kgjAI= +github.com/pulumi/pulumi-terraform-bridge/pf v0.18.4-0.20231102205918-ed35c1e07ed1 h1:i74kBnZJDuNkRwtwy935OtM88CUJJ4kGFDa6v2RiGdY= +github.com/pulumi/pulumi-terraform-bridge/pf v0.18.4-0.20231102205918-ed35c1e07ed1/go.mod h1:apif6z4X21j859e6+gKmw4WoaalaF8TyKMVSa8kgjAI= github.com/pulumi/pulumi-terraform-bridge/testing v0.0.1 h1:SCg1gjfY9N4yn8U8peIUYATifjoDABkyR7H9lmefsfc= github.com/pulumi/pulumi-terraform-bridge/testing v0.0.1/go.mod h1:7OeUPH8rpt5ipyj9EFcnXpuzQ8SHL0dyqdfa8nOacdk= -github.com/pulumi/pulumi-terraform-bridge/v3 v3.63.2 h1:6JRJz3Wk7O9OhNFbxCrNvPVQAK+prBm6XBuSlIVqRnU= -github.com/pulumi/pulumi-terraform-bridge/v3 v3.63.2/go.mod h1:ye7JUFqTNbBh6ohcr1KpyXNv+kYFYvZAIqXqts4Ialc= +github.com/pulumi/pulumi-terraform-bridge/v3 v3.63.3-0.20231102205918-ed35c1e07ed1 h1:UGmX6ynqXTXGwRVTO/NCCM0taZ7atWKhFT2N/rLiwX4= +github.com/pulumi/pulumi-terraform-bridge/v3 v3.63.3-0.20231102205918-ed35c1e07ed1/go.mod h1:ye7JUFqTNbBh6ohcr1KpyXNv+kYFYvZAIqXqts4Ialc= github.com/pulumi/pulumi-terraform-bridge/x/muxer v0.0.7-0.20230801203955-5d215c892096 h1:1nzT9XuyTHdcWJboYNMPPdW0B0mQdXYg8Az5tF96MXY= github.com/pulumi/pulumi-terraform-bridge/x/muxer v0.0.7-0.20230801203955-5d215c892096/go.mod h1:1pLAP9kryYta3Xrw99oh7BmxY6PYb+z2m7ENNCJMIRQ= github.com/pulumi/pulumi-yaml v1.2.2 h1:W6BeUBLhDrJ2GSU0em1AUVelG9PBI4ABY61DdhJOO3E=