From 0081910d2668c4202af02f2633b0de753b9404d6 Mon Sep 17 00:00:00 2001 From: Justin Van Patten Date: Sun, 25 Jun 2023 23:20:14 -0700 Subject: [PATCH 1/6] [tests] Add integration test for explicit providers for packaged components Add integration tests for passing an explicit provider for a packaged component. The Go test already passes. The Node and Python tests fail. --- .../go/Pulumi.yaml | 5 + .../go/go.mod | 68 +++ .../go/go.sum | 400 ++++++++++++++++++ .../go/main.go | 110 +++++ .../nodejs/.gitignore | 3 + .../nodejs/Pulumi.yaml | 5 + .../nodejs/index.ts | 40 ++ .../nodejs/package.json | 10 + .../python/.gitignore | 5 + .../python/Pulumi.yaml | 5 + .../python/__main__.py | 44 ++ .../python/requirements.txt | 0 .../testcomponent-go/.gitignore | 2 + .../testcomponent-go/PulumiPlugin.yaml | 1 + .../testcomponent-go/main.go | 196 +++++++++ tests/integration/integration_go_test.go | 6 + tests/integration/integration_nodejs_test.go | 6 + tests/integration/integration_python_test.go | 8 + tests/integration/integration_util_test.go | 20 + 19 files changed, 934 insertions(+) create mode 100644 tests/integration/construct_component_provider_explicit/go/Pulumi.yaml create mode 100644 tests/integration/construct_component_provider_explicit/go/go.mod create mode 100644 tests/integration/construct_component_provider_explicit/go/go.sum create mode 100644 tests/integration/construct_component_provider_explicit/go/main.go create mode 100644 tests/integration/construct_component_provider_explicit/nodejs/.gitignore create mode 100644 tests/integration/construct_component_provider_explicit/nodejs/Pulumi.yaml create mode 100644 tests/integration/construct_component_provider_explicit/nodejs/index.ts create mode 100644 tests/integration/construct_component_provider_explicit/nodejs/package.json create mode 100644 tests/integration/construct_component_provider_explicit/python/.gitignore create mode 100644 tests/integration/construct_component_provider_explicit/python/Pulumi.yaml create mode 100644 tests/integration/construct_component_provider_explicit/python/__main__.py create mode 100644 tests/integration/construct_component_provider_explicit/python/requirements.txt create mode 100644 tests/integration/construct_component_provider_explicit/testcomponent-go/.gitignore create mode 100644 tests/integration/construct_component_provider_explicit/testcomponent-go/PulumiPlugin.yaml create mode 100644 tests/integration/construct_component_provider_explicit/testcomponent-go/main.go diff --git a/tests/integration/construct_component_provider_explicit/go/Pulumi.yaml b/tests/integration/construct_component_provider_explicit/go/Pulumi.yaml new file mode 100644 index 000000000000..e1da407316c0 --- /dev/null +++ b/tests/integration/construct_component_provider_explicit/go/Pulumi.yaml @@ -0,0 +1,5 @@ +name: construct_component_provider_go +description: A program that constructs remote component resources with first class provider. +runtime: go +config: + pulumi:disable-default-providers: ["*"] diff --git a/tests/integration/construct_component_provider_explicit/go/go.mod b/tests/integration/construct_component_provider_explicit/go/go.mod new file mode 100644 index 000000000000..941e38ecf0f6 --- /dev/null +++ b/tests/integration/construct_component_provider_explicit/go/go.mod @@ -0,0 +1,68 @@ +module github.com/pulumi/pulumi/tests/construct_component_provider + +go 1.18 + +require github.com/pulumi/pulumi/sdk/v3 v3.40.1 + +require ( + github.com/HdrHistogram/hdrhistogram-go v1.1.2 // indirect + 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/blang/semver v3.5.1+incompatible // indirect + github.com/cheggaaa/pb v1.0.29 // indirect + github.com/cloudflare/circl v1.3.3 // 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/gofrs/uuid v4.2.0+incompatible // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang/glog v1.0.0 // indirect + github.com/golang/protobuf v1.5.2 // 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/imdario/mergo v0.3.13 // indirect + github.com/inconshreveable/mousetrap v1.0.0 // indirect + github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect + github.com/kevinburke/ssh_config v1.2.0 // indirect + github.com/mattn/go-colorable v0.1.12 // indirect + github.com/mattn/go-runewidth v0.0.13 // indirect + github.com/mitchellh/go-ps v1.0.0 // 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/rivo/uniseg v0.2.0 // indirect + github.com/rogpeppe/go-internal v1.8.1 // 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.2.0 // indirect + github.com/skeema/knownhosts v1.1.0 // indirect + github.com/spf13/cobra v1.5.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/stretchr/testify v1.8.0 // 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 + go.uber.org/atomic v1.9.0 // indirect + golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a // indirect + golang.org/x/net v0.7.0 // indirect + golang.org/x/sys v0.5.0 // indirect + golang.org/x/term v0.5.0 // indirect + golang.org/x/text v0.7.0 // indirect + google.golang.org/genproto v0.0.0-20220405205423-9d709892a2bf // indirect + google.golang.org/grpc v1.49.0 // indirect + google.golang.org/protobuf v1.28.1 // indirect + gopkg.in/warnings.v0 v0.1.2 // indirect + gopkg.in/yaml.v2 v2.4.0 // 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/tests/integration/construct_component_provider_explicit/go/go.sum b/tests/integration/construct_component_provider_explicit/go/go.sum new file mode 100644 index 000000000000..c066f51b559f --- /dev/null +++ b/tests/integration/construct_component_provider_explicit/go/go.sum @@ -0,0 +1,400 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +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/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= +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/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +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/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/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cheggaaa/pb v1.0.29 h1:FckUN5ngEk2LpvuG0fw1GEFx6LtyY2pWI/Z2QgCnEYo= +github.com/cheggaaa/pb v1.0.29/go.mod h1:W40334L7FMC5JKWldsTWbdGjLo0RxUKK73K+TuPxX30= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +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/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +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/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s= +github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= +github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +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/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/gofrs/uuid v4.2.0+incompatible h1:yyYWMnhkhrKwwr8gAOcOCYxOOscHgDS9yZgBrnJfGa0= +github.com/gofrs/uuid v4.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +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/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ= +github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +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/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +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/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.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +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/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= +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/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.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU= +github.com/mattn/go-runewidth v0.0.13/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/mmcloughlin/avo v0.5.0/go.mod h1:ChHFdoV7ql95Wi7vuq2YT1bwCJqiWdZrQ1im3VujLYM= +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/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= +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/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/pulumi/pulumi/sdk/v3 v3.40.1 h1:PLKYHyRffrO9nNfidDGGr2xkf8G0wjtSZx1Zj7OwyyA= +github.com/pulumi/pulumi/sdk/v3 v3.40.1/go.mod h1:tSNA8Z+GnEjMxH+qtrfcwpmOQj7mTPTAmJUhwvuox5I= +github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= +github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= +github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XFkP+Eg= +github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= +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.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= +github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= +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/cobra v1.5.0 h1:X+jTBEBqF0bHN+9cSMgmfuvv2VHJ9ezmFNf9Y/XstYU= +github.com/spf13/cobra v1.5.0/go.mod h1:dWXEIy2H428czQCjInthrTRUg7yKbok+2Qi/yBIJoUM= +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/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0 h1:M2gUjqZET1qApGOWNSnZ49BAIMX4F/1plDv3+l31EJ4= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +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.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +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= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +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-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +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.3.1-0.20221117191849-2c476679df9a h1:diz9pEYuTIuLMJLs3rGDkeaTsNyRs6duYdFyPAxzE/U= +golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= +golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +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-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +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-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +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-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +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.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= +golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +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/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +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-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +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-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/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.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= +golang.org/x/sys v0.5.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.5.0 h1:n2a8QNdAb0sZNpU9R1ALUXBbY+w51fCQDN+7EdxNBsY= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +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.5/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.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +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-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +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= +gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= +gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= +gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= +gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20220405205423-9d709892a2bf h1:JTjwKJX9erVpsw17w+OIPP7iAgEkN/r8urhWSunEDTs= +google.golang.org/genproto v0.0.0-20220405205423-9d709892a2bf/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= +google.golang.org/grpc v1.49.0 h1:WTLtQzmQori5FUH25Pq4WT22oCsv8USpQ+F6rqtsmxw= +google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +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.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= +google.golang.org/protobuf v1.28.1/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-20180628173108-788fd7840127/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/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +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.3/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= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +lukechampine.com/frand v1.4.2 h1:RzFIpOvkMXuPMBb9maa4ND4wjBn71E1Jpf8BzJHMaVw= +lukechampine.com/frand v1.4.2/go.mod h1:4S/TM2ZgrKejMcKMbeLjISpJMO+/eZ1zu3vYX9dtj3s= +pgregory.net/rapid v0.4.7 h1:MTNRktPuv5FNqOO151TM9mDTa+XHcX6ypYeISDVD14g= +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/tests/integration/construct_component_provider_explicit/go/main.go b/tests/integration/construct_component_provider_explicit/go/main.go new file mode 100644 index 000000000000..77000f783d40 --- /dev/null +++ b/tests/integration/construct_component_provider_explicit/go/main.go @@ -0,0 +1,110 @@ +// Copyright 2016-2023, Pulumi Corporation. All rights reserved. +//go:build !all +// +build !all + +package main + +import ( + "reflect" + + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +) + +type Provider struct { + pulumi.ProviderResourceState + + Message pulumi.StringOutput `pulumi:"message"` +} + +func NewProvider(ctx *pulumi.Context, + name string, args *ProviderArgs, opts ...pulumi.ResourceOption, +) (*Provider, error) { + if args == nil { + args = &ProviderArgs{} + } + var resource Provider + err := ctx.RegisterResource("pulumi:providers:testcomponent", name, args, &resource, opts...) + if err != nil { + return nil, err + } + return &resource, nil +} + +type providerArgs struct { + Message string `pulumi:"message"` +} + +type ProviderArgs struct { + Message pulumi.StringInput +} + +func (ProviderArgs) ElementType() reflect.Type { + return reflect.TypeOf((*providerArgs)(nil)).Elem() +} + +// A remote component resource. +type Component struct { + pulumi.ResourceState + + Message pulumi.StringOutput `pulumi:"message"` +} + +// Creates a remote component resource. +func NewComponent(ctx *pulumi.Context, name string, opts ...pulumi.ResourceOption) (*Component, error) { + var resource Component + err := ctx.RegisterRemoteComponentResource("testcomponent:index:Component", name, nil, &resource, opts...) + if err != nil { + return nil, err + } + return &resource, nil +} + +// A local component resource. +type LocalComponent struct { + pulumi.ResourceState + + Message pulumi.StringOutput +} + +// Creates a regular local component resource, which creates a child remote component resource. +func NewLocalComponent(ctx *pulumi.Context, name string, opts ...pulumi.ResourceOption) (*LocalComponent, error) { + var resource LocalComponent + err := ctx.RegisterComponentResource("my:index:LocalComponent", name, &resource, opts...) + if err != nil { + return nil, err + } + + component, err := NewComponent(ctx, name+"-mycomponent", pulumi.Parent(&resource)) + if err != nil { + return nil, err + } + resource.Message = component.Message + + return &resource, nil +} + +func main() { + pulumi.Run(func(ctx *pulumi.Context) error { + provider, err := NewProvider(ctx, "myprovider", &ProviderArgs{ + Message: pulumi.String("hello world"), + }) + if err != nil { + return err + } + + component, err := NewComponent(ctx, "mycomponent", pulumi.Provider(provider)) + if err != nil { + return err + } + + localComponent, err := NewLocalComponent(ctx, "mylocalcomponent", pulumi.Providers(provider)) + if err != nil { + return err + } + + ctx.Export("message", component.Message) + ctx.Export("nestedMessage", localComponent.Message) + + return nil + }) +} diff --git a/tests/integration/construct_component_provider_explicit/nodejs/.gitignore b/tests/integration/construct_component_provider_explicit/nodejs/.gitignore new file mode 100644 index 000000000000..8381bf4ce062 --- /dev/null +++ b/tests/integration/construct_component_provider_explicit/nodejs/.gitignore @@ -0,0 +1,3 @@ +/.pulumi/ +/bin/ +/node_modules/ diff --git a/tests/integration/construct_component_provider_explicit/nodejs/Pulumi.yaml b/tests/integration/construct_component_provider_explicit/nodejs/Pulumi.yaml new file mode 100644 index 000000000000..dc4463702815 --- /dev/null +++ b/tests/integration/construct_component_provider_explicit/nodejs/Pulumi.yaml @@ -0,0 +1,5 @@ +name: construct_component_provider_nodejs +description: A program that constructs remote component resources with first class provider. +runtime: nodejs +config: + pulumi:disable-default-providers: ["*"] diff --git a/tests/integration/construct_component_provider_explicit/nodejs/index.ts b/tests/integration/construct_component_provider_explicit/nodejs/index.ts new file mode 100644 index 000000000000..dde719d11d2c --- /dev/null +++ b/tests/integration/construct_component_provider_explicit/nodejs/index.ts @@ -0,0 +1,40 @@ +// Copyright 2016-2023, Pulumi Corporation. All rights reserved. + +import * as pulumi from "@pulumi/pulumi"; + +class Provider extends pulumi.ProviderResource { + public readonly message!: pulumi.Output; + + constructor(name: string, message: string, opts?: pulumi.ResourceOptions) { + super("testcomponent", name, { message }, opts); + } +} + +class Component extends pulumi.ComponentResource { + public readonly message!: pulumi.Output; + + constructor(name: string, opts?: pulumi.ComponentResourceOptions) { + const inputs = { + message: undefined /*out*/, + }; + super("testcomponent:index:Component", name, inputs, opts, true); + } +} + +class LocalComponent extends pulumi.ComponentResource { + public readonly message: pulumi.Output; + + constructor(name: string, opts?: pulumi.ComponentResourceOptions) { + super("my:index:LocalComponent", name, {}, opts); + + const component = new Component(`${name}-mycomponent`, { parent: this }); + this.message = component.message; + } +} + +const provider = new Provider("myprovider", "hello world") +const component = new Component("mycomponent", { provider }); +const localComponent = new LocalComponent("mylocalcomponent", { providers: [provider] }); + +export const message = component.message; +export const nestedMessage = localComponent.message; diff --git a/tests/integration/construct_component_provider_explicit/nodejs/package.json b/tests/integration/construct_component_provider_explicit/nodejs/package.json new file mode 100644 index 000000000000..bb9354b077c9 --- /dev/null +++ b/tests/integration/construct_component_provider_explicit/nodejs/package.json @@ -0,0 +1,10 @@ +{ + "name": "construct_component_provider", + "license": "Apache-2.0", + "devDependencies": { + "typescript": "^3.0.0" + }, + "peerDependencies": { + "@pulumi/pulumi": "latest" + } +} diff --git a/tests/integration/construct_component_provider_explicit/python/.gitignore b/tests/integration/construct_component_provider_explicit/python/.gitignore new file mode 100644 index 000000000000..3f47d8e79266 --- /dev/null +++ b/tests/integration/construct_component_provider_explicit/python/.gitignore @@ -0,0 +1,5 @@ +*.pyc +/.pulumi/ +/dist/ +/*.egg-info +venv/ diff --git a/tests/integration/construct_component_provider_explicit/python/Pulumi.yaml b/tests/integration/construct_component_provider_explicit/python/Pulumi.yaml new file mode 100644 index 000000000000..bdd242530be1 --- /dev/null +++ b/tests/integration/construct_component_provider_explicit/python/Pulumi.yaml @@ -0,0 +1,5 @@ +name: construct_component_provider_py +description: A program that constructs remote component resources with first class provider. +runtime: python +config: + pulumi:disable-default-providers: ["*"] diff --git a/tests/integration/construct_component_provider_explicit/python/__main__.py b/tests/integration/construct_component_provider_explicit/python/__main__.py new file mode 100644 index 000000000000..7b470edc1a50 --- /dev/null +++ b/tests/integration/construct_component_provider_explicit/python/__main__.py @@ -0,0 +1,44 @@ +# Copyright 2016-2023, Pulumi Corporation. All rights reserved. + +from typing import Optional + +import pulumi + + +class Provider(pulumi.ProviderResource): + message: pulumi.Output[str] + + def __init__(self, name: str, message: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions] = None) -> None: + super().__init__("testcomponent", name, {"message": message}, opts) + + +class Component(pulumi.ComponentResource): + message: pulumi.Output[str] + + def __init__(self, name: str, opts: Optional[pulumi.ResourceOptions] = None) -> None: + props = { + "message": None + } + super().__init__("testcomponent:index:Component", name, props, opts, True) + + +class LocalComponent(pulumi.ComponentResource): + message: pulumi.Output[str] + + def __init__(self, name: str, opts: Optional[pulumi.ResourceOptions] = None) -> None: + super().__init__("my:index:LocalComponent", name, {}, opts) + + component = Component(f"{name}-mycomponent", pulumi.ResourceOptions(parent=self)) + self.message = component.message + + +provider = Provider("myprovider", "hello world") +component = Component("mycomponent", pulumi.ResourceOptions( + provider=provider, +)) +localComponent = LocalComponent("mylocalcomponent", pulumi.ResourceOptions( + providers=[provider], +)) + +pulumi.export("message", component.message) +pulumi.export("nestedMessage", localComponent.message) diff --git a/tests/integration/construct_component_provider_explicit/python/requirements.txt b/tests/integration/construct_component_provider_explicit/python/requirements.txt new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/integration/construct_component_provider_explicit/testcomponent-go/.gitignore b/tests/integration/construct_component_provider_explicit/testcomponent-go/.gitignore new file mode 100644 index 000000000000..97b8f0004c40 --- /dev/null +++ b/tests/integration/construct_component_provider_explicit/testcomponent-go/.gitignore @@ -0,0 +1,2 @@ +pulumi-resource-testcomponent +pulumi-resource-testcomponent.exe diff --git a/tests/integration/construct_component_provider_explicit/testcomponent-go/PulumiPlugin.yaml b/tests/integration/construct_component_provider_explicit/testcomponent-go/PulumiPlugin.yaml new file mode 100644 index 000000000000..735ef96543fb --- /dev/null +++ b/tests/integration/construct_component_provider_explicit/testcomponent-go/PulumiPlugin.yaml @@ -0,0 +1 @@ +runtime: go \ No newline at end of file diff --git a/tests/integration/construct_component_provider_explicit/testcomponent-go/main.go b/tests/integration/construct_component_provider_explicit/testcomponent-go/main.go new file mode 100644 index 000000000000..ea6eba6ba7f7 --- /dev/null +++ b/tests/integration/construct_component_provider_explicit/testcomponent-go/main.go @@ -0,0 +1,196 @@ +// Copyright 2016-2023, Pulumi Corporation. All rights reserved. +//go:build !all +// +build !all + +package main + +import ( + "context" + "fmt" + + "github.com/pulumi/pulumi/pkg/v3/resource/provider" + "github.com/pulumi/pulumi/sdk/v3/go/common/resource" + "github.com/pulumi/pulumi/sdk/v3/go/common/util/cmdutil" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + pulumiprovider "github.com/pulumi/pulumi/sdk/v3/go/pulumi/provider" + pulumirpc "github.com/pulumi/pulumi/sdk/v3/proto/go" + + pbempty "github.com/golang/protobuf/ptypes/empty" +) + +const ( + providerName = "testcomponent" + version = "0.0.1" +) + +type Component struct { + pulumi.ResourceState + + Message pulumi.StringOutput `pulumi:"message"` +} + +func NewComponent(ctx *pulumi.Context, name, message string, opts ...pulumi.ResourceOption) (*Component, error) { + component := &Component{} + err := ctx.RegisterComponentResource(providerName+":index:Component", name, component, opts...) + if err != nil { + return nil, err + } + component.Message = pulumi.String(message).ToStringOutput() + + if err := ctx.RegisterResourceOutputs(component, pulumi.Map{ + "message": component.Message, + }); err != nil { + return nil, err + } + + return component, nil +} + +func main() { + err := provider.Main(providerName, func(host *provider.HostClient) (pulumirpc.ResourceProviderServer, error) { + return makeProvider(host, providerName, version) + }) + if err != nil { + cmdutil.ExitError(err.Error()) + } +} + +type Provider struct { + pulumirpc.UnimplementedResourceProviderServer + + host *provider.HostClient + name string + version string + + message string +} + +func makeProvider(host *provider.HostClient, name, version string) (pulumirpc.ResourceProviderServer, error) { + return &Provider{ + host: host, + name: name, + version: version, + }, nil +} + +func (p *Provider) Create(ctx context.Context, + req *pulumirpc.CreateRequest, +) (*pulumirpc.CreateResponse, error) { + urn := resource.URN(req.GetUrn()) + return nil, fmt.Errorf("Unknown resource type '%s'", urn.Type()) +} + +func (p *Provider) Construct(ctx context.Context, + req *pulumirpc.ConstructRequest, +) (*pulumirpc.ConstructResponse, error) { + return pulumiprovider.Construct(ctx, req, p.host.EngineConn(), func(ctx *pulumi.Context, typ, name string, + inputs pulumiprovider.ConstructInputs, options pulumi.ResourceOption, + ) (*pulumiprovider.ConstructResult, error) { + if typ != providerName+":index:Component" { + return nil, fmt.Errorf("unknown resource type %s", typ) + } + + component, err := NewComponent(ctx, name, p.message, options) + if err != nil { + return nil, fmt.Errorf("creating component: %w", err) + } + + return pulumiprovider.NewConstructResult(component) + }) +} + +func (p *Provider) CheckConfig(ctx context.Context, + req *pulumirpc.CheckRequest, +) (*pulumirpc.CheckResponse, error) { + return &pulumirpc.CheckResponse{Inputs: req.GetNews()}, nil +} + +func (p *Provider) DiffConfig(ctx context.Context, + req *pulumirpc.DiffRequest, +) (*pulumirpc.DiffResponse, error) { + return &pulumirpc.DiffResponse{}, nil +} + +func (p *Provider) Configure(ctx context.Context, + req *pulumirpc.ConfigureRequest, +) (*pulumirpc.ConfigureResponse, error) { + if val, ok := req.GetArgs().Fields["message"]; ok { + p.message = val.GetStringValue() + } + return &pulumirpc.ConfigureResponse{ + AcceptSecrets: true, + SupportsPreview: true, + AcceptResources: true, + }, nil +} + +func (p *Provider) Invoke(ctx context.Context, + req *pulumirpc.InvokeRequest, +) (*pulumirpc.InvokeResponse, error) { + return nil, fmt.Errorf("Unknown Invoke token '%s'", req.GetTok()) +} + +func (p *Provider) StreamInvoke(req *pulumirpc.InvokeRequest, + server pulumirpc.ResourceProvider_StreamInvokeServer, +) error { + return fmt.Errorf("Unknown StreamInvoke token '%s'", req.GetTok()) +} + +func (p *Provider) Call(ctx context.Context, + req *pulumirpc.CallRequest, +) (*pulumirpc.CallResponse, error) { + return nil, fmt.Errorf("Unknown Call token '%s'", req.GetTok()) +} + +func (p *Provider) Check(ctx context.Context, + req *pulumirpc.CheckRequest, +) (*pulumirpc.CheckResponse, error) { + return &pulumirpc.CheckResponse{Inputs: req.News, Failures: nil}, nil +} + +func (p *Provider) Diff(ctx context.Context, req *pulumirpc.DiffRequest) (*pulumirpc.DiffResponse, error) { + return &pulumirpc.DiffResponse{}, nil +} + +func (p *Provider) Read(ctx context.Context, req *pulumirpc.ReadRequest) (*pulumirpc.ReadResponse, error) { + return &pulumirpc.ReadResponse{ + Id: req.GetId(), + Properties: req.GetProperties(), + }, nil +} + +func (p *Provider) Update(ctx context.Context, + req *pulumirpc.UpdateRequest, +) (*pulumirpc.UpdateResponse, error) { + return &pulumirpc.UpdateResponse{ + Properties: req.GetNews(), + }, nil +} + +func (p *Provider) Delete(ctx context.Context, req *pulumirpc.DeleteRequest) (*pbempty.Empty, error) { + return &pbempty.Empty{}, nil +} + +func (p *Provider) GetPluginInfo(context.Context, *pbempty.Empty) (*pulumirpc.PluginInfo, error) { + return &pulumirpc.PluginInfo{ + Version: p.version, + }, nil +} + +func (p *Provider) Attach(ctx context.Context, req *pulumirpc.PluginAttach) (*pbempty.Empty, error) { + return &pbempty.Empty{}, nil +} + +func (p *Provider) GetSchema(ctx context.Context, + req *pulumirpc.GetSchemaRequest, +) (*pulumirpc.GetSchemaResponse, error) { + return &pulumirpc.GetSchemaResponse{}, nil +} + +func (p *Provider) Cancel(context.Context, *pbempty.Empty) (*pbempty.Empty, error) { + return &pbempty.Empty{}, nil +} + +func (p *Provider) GetMapping(context.Context, *pulumirpc.GetMappingRequest) (*pulumirpc.GetMappingResponse, error) { + return &pulumirpc.GetMappingResponse{}, nil +} diff --git a/tests/integration/integration_go_test.go b/tests/integration/integration_go_test.go index d6b317d6b010..992e8aeb50c7 100644 --- a/tests/integration/integration_go_test.go +++ b/tests/integration/integration_go_test.go @@ -1023,3 +1023,9 @@ func TestAutomation_externalPluginDownload_issue13301(t *testing.T) { _, err = stack.Preview(ctx) require.NoError(t, err) } + +func TestConstructProviderExplicitGo(t *testing.T) { + t.Parallel() + + testConstructProviderExplicit(t, "go", []string{"github.com/pulumi/pulumi/sdk/v3"}) +} diff --git a/tests/integration/integration_nodejs_test.go b/tests/integration/integration_nodejs_test.go index a1f2814d53ae..0cd4642afb0d 100644 --- a/tests/integration/integration_nodejs_test.go +++ b/tests/integration/integration_nodejs_test.go @@ -1448,3 +1448,9 @@ func TestConstructProviderPropagationNode(t *testing.T) { testConstructProviderPropagation(t, "nodejs", []string{"@pulumi/pulumi"}) } + +func TestConstructProviderExplicitNode(t *testing.T) { + t.Parallel() + + testConstructProviderExplicit(t, "nodejs", []string{"@pulumi/pulumi"}) +} diff --git a/tests/integration/integration_python_test.go b/tests/integration/integration_python_test.go index 335073a51fb5..071618895342 100644 --- a/tests/integration/integration_python_test.go +++ b/tests/integration/integration_python_test.go @@ -1076,3 +1076,11 @@ func TestDuplicateOutputPython(t *testing.T) { }, }) } + +func TestConstructProviderExplicitPython(t *testing.T) { + t.Parallel() + + testConstructProviderExplicit(t, "python", []string{ + filepath.Join("..", "..", "sdk", "python", "env", "src"), + }) +} diff --git a/tests/integration/integration_util_test.go b/tests/integration/integration_util_test.go index 88e50b5901bf..790eb5bfbd40 100644 --- a/tests/integration/integration_util_test.go +++ b/tests/integration/integration_util_test.go @@ -504,3 +504,23 @@ func printfTestValidation(t *testing.T, stack integration.RuntimeValidationStack assert.Equal(t, 11, foundStdout) assert.Equal(t, 11, foundStderr) } + +func testConstructProviderExplicit(t *testing.T, lang string, dependencies []string) { + const testDir = "construct_component_provider_explicit" + runComponentSetup(t, testDir) + + localProvider := integration.LocalDependency{ + Package: "testcomponent", Path: filepath.Join(testDir, "testcomponent-go"), + } + integration.ProgramTest(t, &integration.ProgramTestOptions{ + Dir: filepath.Join(testDir, lang), + Dependencies: dependencies, + LocalProviders: []integration.LocalDependency{localProvider}, + Quick: true, + NoParallel: true, // already called by tests + ExtraRuntimeValidation: func(t *testing.T, stackInfo integration.RuntimeValidationStackInfo) { + assert.Equal(t, "hello world", stackInfo.Outputs["message"]) + assert.Equal(t, "hello world", stackInfo.Outputs["nestedMessage"]) + }, + }) +} From db1d8c7217a8fef7185706622ea7bc704fd775ba Mon Sep 17 00:00:00 2001 From: Justin Van Patten Date: Sun, 25 Jun 2023 23:21:46 -0700 Subject: [PATCH 2/6] [sdk/nodejs] Update langhost test for packaged component providers Update the test for the behavior we expect. Currently fails. --- .../cases/068.remote_component_providers/index.js | 12 ++++++++++++ sdk/nodejs/tests/runtime/langhost/run.spec.ts | 10 +++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/sdk/nodejs/tests/runtime/langhost/cases/068.remote_component_providers/index.js b/sdk/nodejs/tests/runtime/langhost/cases/068.remote_component_providers/index.js index 3f41cb3d66c1..d024abd955f6 100644 --- a/sdk/nodejs/tests/runtime/langhost/cases/068.remote_component_providers/index.js +++ b/sdk/nodejs/tests/runtime/langhost/cases/068.remote_component_providers/index.js @@ -9,6 +9,12 @@ class Provider extends pulumi.ProviderResource { } } +class FooProvider extends pulumi.ProviderResource { + constructor(name, opts) { + super("foo", name, {}, opts); + } +} + class RemoteComponent extends pulumi.ComponentResource { constructor(name, opts) { super("test:index:Component", name, {}, opts, true /*remote*/); @@ -20,3 +26,9 @@ const myprovider = new Provider("myprovider"); new RemoteComponent("singular", { provider: myprovider }); new RemoteComponent("map", { providers: { test: myprovider } }); new RemoteComponent("array", { providers: [myprovider] }); + +const fooprovider = new FooProvider("fooprovider"); + +new RemoteComponent("foo-singular", { provider: fooprovider }); +new RemoteComponent("foo-map", { providers: { foo: fooprovider } }); +new RemoteComponent("foo-array", { providers: [fooprovider] }); diff --git a/sdk/nodejs/tests/runtime/langhost/run.spec.ts b/sdk/nodejs/tests/runtime/langhost/run.spec.ts index 0eb629172d1e..48cd6387851a 100644 --- a/sdk/nodejs/tests/runtime/langhost/run.spec.ts +++ b/sdk/nodejs/tests/runtime/langhost/run.spec.ts @@ -1469,7 +1469,7 @@ describe("rpc", () => { }, remote_component_providers: { program: path.join(base, "068.remote_component_providers"), - expectResourceCount: 4, + expectResourceCount: 8, registerResource: ( ctx: any, dryrun: boolean, @@ -1489,10 +1489,14 @@ describe("rpc", () => { providers?: any, ) => { if (name === "singular" || name === "map" || name === "array") { - assert.strictEqual(provider, ""); + assert.strictEqual(provider, "pulumi:providers:test::myprovider::1"); assert.deepStrictEqual(Object.keys(providers), ["test"]); } - return { urn: makeUrn(t, name), id: undefined, props: undefined }; + if (name === "foo-singular" || name === "foo-map" || name === "foo-array") { + assert.strictEqual(provider, ""); + assert.deepStrictEqual(Object.keys(providers), ["foo"]); + } + return { urn: makeUrn(t, name), id: name === "myprovider" ? "1" : undefined, props: undefined }; }, }, ambiguous_entrypoints: { From bfcb67361bf9d23a80acbf60a10db58d0264684e Mon Sep 17 00:00:00 2001 From: Justin Van Patten Date: Sun, 25 Jun 2023 23:25:18 -0700 Subject: [PATCH 3/6] [sdk/nodejs] Support explicit providers for packaged components Updates the Node.js SDK to support passing an explicit provider. --- sdk/nodejs/resource.ts | 17 ++++++----------- sdk/nodejs/runtime/resource.ts | 29 ++++++++++++++++++++++++++++- 2 files changed, 34 insertions(+), 12 deletions(-) diff --git a/sdk/nodejs/resource.ts b/sdk/nodejs/resource.ts index 8fdbce9d854c..be0451176ecd 100644 --- a/sdk/nodejs/resource.ts +++ b/sdk/nodejs/resource.ts @@ -15,7 +15,7 @@ import { ResourceError } from "./errors"; import * as log from "./log"; import { Input, Inputs, interpolate, Output, output } from "./output"; -import { getResource, readResource, registerResource, registerResourceOutputs } from "./runtime/resource"; +import { getResource, pkgFromType, readResource, registerResource, registerResourceOutputs } from "./runtime/resource"; import { unknownValue } from "./runtime/rpc"; import { getProject, getStack } from "./runtime/settings"; import { getStackResource } from "./runtime/state"; @@ -279,11 +279,10 @@ export abstract class Resource { // getProvider fetches the provider for the given module member, if any. public getProvider(moduleMember: string): ProviderResource | undefined { - const memComponents = moduleMember.split(":"); - if (memComponents.length !== 3) { + const pkg = pkgFromType(moduleMember); + if (pkg === undefined) { return undefined; } - const pkg = memComponents[0]; return this.__providers[pkg]; } @@ -384,12 +383,8 @@ export abstract class Resource { // 1. opts.provider // 2. a matching provider in opts.providers // 3. a matching provider inherited from opts.parent - if (custom && opts.provider === undefined) { - let pkg = undefined; - const memComponents = t.split(":"); - if (memComponents.length === 3) { - pkg = memComponents[0]; - } + if ((custom || remote) && opts.provider === undefined) { + const pkg = pkgFromType(t); const parentProvider = parent?.getProvider(t); if (pkg && pkg in this.__providers) { @@ -400,7 +395,7 @@ export abstract class Resource { } this.__protect = !!opts.protect; - this.__prov = custom ? opts.provider : undefined; + this.__prov = custom || remote ? opts.provider : undefined; this.__version = opts.version; this.__pluginDownloadURL = opts.pluginDownloadURL; diff --git a/sdk/nodejs/runtime/resource.ts b/sdk/nodejs/runtime/resource.ts index 00772e6f4537..4c153e0cc2cd 100644 --- a/sdk/nodejs/runtime/resource.ts +++ b/sdk/nodejs/runtime/resource.ts @@ -688,11 +688,26 @@ export async function prepareResource( // If no parent was provided, parent to the root resource. const parentURN = parent ? await parent.urn.promise() : undefined; - let providerRef: string | undefined; let importID: ID | undefined; if (custom) { const customOpts = opts; importID = customOpts.import; + } + + let providerRef: string | undefined; + let sendProvider = custom; + if (remote && opts.provider) { + // If it's a remote component and a provider was specified, only + // send the provider in the request if the provider's package is + // the same as the component's package. Otherwise, don't send it + // because the user specified `provider: someProvider` as shorthand + // for `providers: [someProvider]`. + const pkg = pkgFromType(type!); + if (pkg && pkg === opts.provider.getPackage()) { + sendProvider = true; + } + } + if (sendProvider) { providerRef = await ProviderResource.register(opts.provider); } @@ -1114,3 +1129,15 @@ function runAsyncResourceOp(label: string, callback: () => Promise, serial } } } + +/** + * Extract the pkg from the type token of the form "pkg:module:member". + * @internal + */ +export function pkgFromType(type: string): string | undefined { + const parts = type.split(":"); + if (parts.length === 3) { + return parts[0]; + } + return undefined; +} From ef41442211a8b87f184a2bda65a7d0170399616f Mon Sep 17 00:00:00 2001 From: Justin Van Patten Date: Mon, 26 Jun 2023 00:19:04 -0700 Subject: [PATCH 4/6] [sdk/python] Add langhost test for packaged component providers Currently fails without the fix. --- .../lib/test/langhost/aliases/test_aliases.py | 2 +- .../lib/test/langhost/asset/test_asset.py | 2 +- .../chained_failure/test_chained_failure.py | 2 +- .../test_component_dependencies.py | 2 +- .../test_component_provider_resolution.py | 2 +- ...st_component_resource_list_of_providers.py | 2 +- ...test_component_resource_single_provider.py | 2 +- .../lib/test/langhost/config/test_config.py | 2 +- .../test_delete_before_replace.py | 2 +- .../test_first_class_provider.py | 2 +- .../test_first_class_provider_invoke.py | 2 +- .../test_first_class_provider_unknown.py | 2 +- .../future_failure/test_future_failure.py | 2 +- .../future_input/test_future_input.py | 2 +- .../ignore_changes/test_ignore_changes.py | 2 +- .../inherit_defaults/test_inherit_defaults.py | 2 +- .../test_inheritance_translation.py | 2 +- .../test_inheritance_types.py | 2 +- .../test_input_type_mismatch.py | 2 +- .../test_input_values_for_outputs.py | 2 +- .../test_invalid_property_dependency.py | 2 +- .../lib/test/langhost/invoke/test_invoke.py | 2 +- .../test/langhost/invoke_types/test_invoke.py | 2 +- .../large_resource/test_large_resource.py | 2 +- .../marshal_failure/test_marshal_failure.py | 2 +- .../test_one_complex_resource.py | 2 +- .../one_resource/test_one_resource.py | 2 +- .../langhost/output_all/test_output_all.py | 2 +- .../output_nested/test_output_nested.py | 2 +- .../test_output_property_dependencies.py | 2 +- .../lib/test/langhost/preview/test_preview.py | 2 +- .../test_property_dependencies.py | 2 +- .../test_property_renaming.py | 2 +- .../lib/test/langhost/protect/test_protect.py | 2 +- .../lib/test/langhost/read/test_read.py | 2 +- .../test_remote_component_dependencies.py | 1 + .../remote_component_providers/__init__.py | 13 +++++ .../remote_component_providers/__main__.py | 43 ++++++++++++++ .../test_remote_component_providers.py | 56 +++++++++++++++++++ .../test_replace_on_changes.py | 2 +- .../test_resource_op_bad_inputs.py | 2 +- .../resource_op_fail/test_resource_op_fail.py | 2 +- .../resource_thens/test_resource_thens.py | 2 +- .../ten_resources/test_ten_resources.py | 2 +- .../lib/test/langhost/types/test_types.py | 2 +- sdk/python/lib/test/langhost/util.py | 4 +- .../test/langhost/versions/test_versions.py | 2 +- 47 files changed, 158 insertions(+), 43 deletions(-) create mode 100644 sdk/python/lib/test/langhost/remote_component_providers/__init__.py create mode 100644 sdk/python/lib/test/langhost/remote_component_providers/__main__.py create mode 100644 sdk/python/lib/test/langhost/remote_component_providers/test_remote_component_providers.py diff --git a/sdk/python/lib/test/langhost/aliases/test_aliases.py b/sdk/python/lib/test/langhost/aliases/test_aliases.py index 208fa578bdb4..4cf852ac7aaa 100644 --- a/sdk/python/lib/test/langhost/aliases/test_aliases.py +++ b/sdk/python/lib/test/langhost/aliases/test_aliases.py @@ -21,7 +21,7 @@ def test_component_dependencies(self): def register_resource(self, _ctx, _dry_run, ty, name, _resource, _dependencies, _parent, _custom, _protect, _provider, _property_deps, _delete_before_replace, _ignore_changes, _version, _import, - _replace_on_changes): + _replace_on_changes, _providers): return { "urn": f"urn:pulumi:stack::project::{ty}::{name}", "id": "myID", diff --git a/sdk/python/lib/test/langhost/asset/test_asset.py b/sdk/python/lib/test/langhost/asset/test_asset.py index 3952ba3b83b9..862da49c716b 100644 --- a/sdk/python/lib/test/langhost/asset/test_asset.py +++ b/sdk/python/lib/test/langhost/asset/test_asset.py @@ -24,7 +24,7 @@ def test_asset(self): def register_resource(self, _ctx, _dry_run, ty, name, _resource, _dependencies, _parent, _custom, protect, _provider, _property_deps, _delete_before_replace, _ignore_changes, _version, _import, - _replace_on_changes): + _replace_on_changes, _providers): self.assertEqual(ty, "test:index:MyResource") if name == "file": self.assertIsInstance(_resource["asset"], FileAsset) diff --git a/sdk/python/lib/test/langhost/chained_failure/test_chained_failure.py b/sdk/python/lib/test/langhost/chained_failure/test_chained_failure.py index 5f345e595730..3da9d2cdc012 100644 --- a/sdk/python/lib/test/langhost/chained_failure/test_chained_failure.py +++ b/sdk/python/lib/test/langhost/chained_failure/test_chained_failure.py @@ -32,7 +32,7 @@ def test_chained_failure(self): def register_resource(self, _ctx, _dry_run, ty, name, _resource, _dependencies, _parent, _custom, protect, _provider, _property_deps, _delete_before_replace, _ignore_changes, _version, _import, - _replace_on_changes): + _replace_on_changes, _providers): if ty == "test:index:ResourceA": self.assertEqual(name, "resourceA") self.assertDictEqual(_resource, {"inprop": 777}) diff --git a/sdk/python/lib/test/langhost/component_dependencies/test_component_dependencies.py b/sdk/python/lib/test/langhost/component_dependencies/test_component_dependencies.py index f3b66137bc3d..e3eaea035eca 100644 --- a/sdk/python/lib/test/langhost/component_dependencies/test_component_dependencies.py +++ b/sdk/python/lib/test/langhost/component_dependencies/test_component_dependencies.py @@ -24,7 +24,7 @@ def test_component_dependencies(self): def register_resource(self, _ctx, _dry_run, ty, name, _resource, _dependencies, _parent, _custom, protect, _provider, _property_deps, _delete_before_replace, _ignore_changes, _version, _import, - _replace_on_changes): + _replace_on_changes, _providers): if name == "resD": self.assertListEqual(_dependencies, ["resA"], msg=f"{name}._dependencies") diff --git a/sdk/python/lib/test/langhost/component_provider_resolution/test_component_provider_resolution.py b/sdk/python/lib/test/langhost/component_provider_resolution/test_component_provider_resolution.py index 0d6b344829af..3a2382825bc9 100644 --- a/sdk/python/lib/test/langhost/component_provider_resolution/test_component_provider_resolution.py +++ b/sdk/python/lib/test/langhost/component_provider_resolution/test_component_provider_resolution.py @@ -24,7 +24,7 @@ def test_component_provider_resolution(self): def register_resource(self, _ctx, _dry_run, ty, name, _resource, _dependencies, _parent, _custom, protect, _provider, _property_deps, _delete_before_replace, _ignore_changes, _version, _import, - _replace_on_changes): + _replace_on_changes, _providers): if name == "combined-mine": self.assertTrue(protect) self.assertEqual(_provider, "") diff --git a/sdk/python/lib/test/langhost/component_resource_list_of_providers/test_component_resource_list_of_providers.py b/sdk/python/lib/test/langhost/component_resource_list_of_providers/test_component_resource_list_of_providers.py index 3237f64d805c..0d990fdf022e 100644 --- a/sdk/python/lib/test/langhost/component_resource_list_of_providers/test_component_resource_list_of_providers.py +++ b/sdk/python/lib/test/langhost/component_resource_list_of_providers/test_component_resource_list_of_providers.py @@ -31,7 +31,7 @@ def test_component_resource_list_of_providers(self): def register_resource(self, _ctx, _dry_run, ty, name, _resource, _dependencies, _parent, _custom, protect, _provider, _property_deps, _delete_before_replace, _ignore_changes, _version, _import, - _replace_on_changes): + _replace_on_changes, _providers): if _custom and not ty.startswith("pulumi:providers:"): expect_protect = False expect_provider_name = "" diff --git a/sdk/python/lib/test/langhost/component_resource_single_provider/test_component_resource_single_provider.py b/sdk/python/lib/test/langhost/component_resource_single_provider/test_component_resource_single_provider.py index 37a997f8e9e2..43f7086bd977 100644 --- a/sdk/python/lib/test/langhost/component_resource_single_provider/test_component_resource_single_provider.py +++ b/sdk/python/lib/test/langhost/component_resource_single_provider/test_component_resource_single_provider.py @@ -31,7 +31,7 @@ def test_component_resource_single_provider(self): def register_resource(self, _ctx, _dry_run, ty, name, _resource, _dependencies, _parent, _custom, protect, _provider, _property_deps, _delete_before_replace, _ignore_changes, _version, _import, - _replace_on_changes): + _replace_on_changes, _providers): if _custom and not ty.startswith("pulumi:providers:"): expect_protect = False expect_provider_name = "" diff --git a/sdk/python/lib/test/langhost/config/test_config.py b/sdk/python/lib/test/langhost/config/test_config.py index e3d350a66ee3..6cd636e60330 100644 --- a/sdk/python/lib/test/langhost/config/test_config.py +++ b/sdk/python/lib/test/langhost/config/test_config.py @@ -29,7 +29,7 @@ def test_config(self): def register_resource(self, _ctx, _dry_run, ty, name, _resource, _dependencies, _parent, _custom, protect, _provider, _property_deps, _delete_before_replace, _ignore_changes, _version, _import, - _replace_on_changes): + _replace_on_changes, _providers): self.assertEqual("test:index:MyResource", ty) self.assertEqual("myname", name) return { diff --git a/sdk/python/lib/test/langhost/delete_before_replace/test_delete_before_replace.py b/sdk/python/lib/test/langhost/delete_before_replace/test_delete_before_replace.py index 5055ea0245f8..408c954fcf50 100644 --- a/sdk/python/lib/test/langhost/delete_before_replace/test_delete_before_replace.py +++ b/sdk/python/lib/test/langhost/delete_before_replace/test_delete_before_replace.py @@ -26,7 +26,7 @@ def test_delete_before_replace(self): def register_resource(self, _ctx, _dry_run, ty, name, _resource, _dependencies, _parent, _custom, protect, _provider, _property_deps, _delete_before_replace, _ignore_changes, _version, _import, - _replace_on_changes): + _replace_on_changes, _providers): self.assertEqual("foo", name) self.assertTrue(_delete_before_replace) return { diff --git a/sdk/python/lib/test/langhost/first_class_provider/test_first_class_provider.py b/sdk/python/lib/test/langhost/first_class_provider/test_first_class_provider.py index 00c630b2aba5..dd946494783e 100644 --- a/sdk/python/lib/test/langhost/first_class_provider/test_first_class_provider.py +++ b/sdk/python/lib/test/langhost/first_class_provider/test_first_class_provider.py @@ -30,7 +30,7 @@ def test_first_class_provider(self): def register_resource(self, _ctx, _dry_run, ty, name, _resource, _dependencies, _parent, _custom, protect, _provider, _property_deps, _delete_before_replace, _ignore_changes, _version, _import, - _replace_on_changes): + _replace_on_changes, _providers): if name == "testprov": # Provider resource. self.assertEqual("pulumi:providers:test", ty) diff --git a/sdk/python/lib/test/langhost/first_class_provider_invoke/test_first_class_provider_invoke.py b/sdk/python/lib/test/langhost/first_class_provider_invoke/test_first_class_provider_invoke.py index 10728b546a89..9124982cbbae 100644 --- a/sdk/python/lib/test/langhost/first_class_provider_invoke/test_first_class_provider_invoke.py +++ b/sdk/python/lib/test/langhost/first_class_provider_invoke/test_first_class_provider_invoke.py @@ -53,7 +53,7 @@ def invoke(self, _ctx, token, args, provider, _version): def register_resource(self, _ctx, _dry_run, ty, name, _resource, _dependencies, _parent, _custom, protect, _provider, _property_deps, _delete_before_replace, _ignore_changes, _version, _import, - _replace_on_changes): + _replace_on_changes, _providers): if name == "testprov": self.assertEqual("pulumi:providers:test", ty) self.prov_urn = self.make_urn(ty, name) diff --git a/sdk/python/lib/test/langhost/first_class_provider_unknown/test_first_class_provider_unknown.py b/sdk/python/lib/test/langhost/first_class_provider_unknown/test_first_class_provider_unknown.py index bab796adbb4f..49e7fb3d0958 100644 --- a/sdk/python/lib/test/langhost/first_class_provider_unknown/test_first_class_provider_unknown.py +++ b/sdk/python/lib/test/langhost/first_class_provider_unknown/test_first_class_provider_unknown.py @@ -32,7 +32,7 @@ def test_first_class_provider_unknown(self): def register_resource(self, _ctx, _dry_run, ty, name, _resource, _dependencies, _parent, _custom, protect, _provider, _property_deps, _delete_before_replace, _ignore_changes, _version, _import, - _replace_on_changes): + _replace_on_changes, _providers): if name == "testprov": self.assertEqual("pulumi:providers:test", ty) # Only provide an ID when doing an update. When doing a preview the ID will be unknown diff --git a/sdk/python/lib/test/langhost/future_failure/test_future_failure.py b/sdk/python/lib/test/langhost/future_failure/test_future_failure.py index 72ab24ed7f5f..54edce909063 100644 --- a/sdk/python/lib/test/langhost/future_failure/test_future_failure.py +++ b/sdk/python/lib/test/langhost/future_failure/test_future_failure.py @@ -28,7 +28,7 @@ def invoke(self, _ctx, token, args, provider, _version): def register_resource(self, _ctx, _dry_run, ty, name, _resource, _dependencies, _parent, _custom, protect, _provider, _property_deps, _delete_before_replace, _ignore_changes, _version, _import, - _replace_on_changes): + _replace_on_changes, _providers): self.assertEqual("test:index:MyResource", ty) return { "urn": self.make_urn(ty, name), diff --git a/sdk/python/lib/test/langhost/future_input/test_future_input.py b/sdk/python/lib/test/langhost/future_input/test_future_input.py index 36ed778b31b4..92ac5e2fdb94 100644 --- a/sdk/python/lib/test/langhost/future_input/test_future_input.py +++ b/sdk/python/lib/test/langhost/future_input/test_future_input.py @@ -27,7 +27,7 @@ def test_future_input(self): def register_resource(self, _ctx, _dry_run, ty, name, _resource, _dependencies, _parent, _custom, protect, _provider, _property_deps, _delete_before_replace, _ignore_changes, _version, _import, - _replace_on_changes): + _replace_on_changes, _providers): self.assertEqual(ty, "test:index:FileResource") self.assertEqual(name, "file") self.assertDictEqual(_resource, { diff --git a/sdk/python/lib/test/langhost/ignore_changes/test_ignore_changes.py b/sdk/python/lib/test/langhost/ignore_changes/test_ignore_changes.py index 21ab53529f65..cf1ef6e96348 100644 --- a/sdk/python/lib/test/langhost/ignore_changes/test_ignore_changes.py +++ b/sdk/python/lib/test/langhost/ignore_changes/test_ignore_changes.py @@ -26,7 +26,7 @@ def test_ignore_changes(self): def register_resource(self, _ctx, _dry_run, ty, name, _resource, _dependencies, _parent, _custom, protect, _provider, _property_deps, _delete_before_replace, _ignore_changes, _version, _import, - _replace_on_changes): + _replace_on_changes, _providers): # Note that here we expect to receive `ignoredProperty`, even though the user provided `ignored_property`. self.assertListEqual(_ignore_changes, ["ignoredProperty", "ignored_property_other"]) diff --git a/sdk/python/lib/test/langhost/inherit_defaults/test_inherit_defaults.py b/sdk/python/lib/test/langhost/inherit_defaults/test_inherit_defaults.py index a1dee25bc547..023557975d99 100644 --- a/sdk/python/lib/test/langhost/inherit_defaults/test_inherit_defaults.py +++ b/sdk/python/lib/test/langhost/inherit_defaults/test_inherit_defaults.py @@ -31,7 +31,7 @@ def test_inherit_defaults(self): def register_resource(self, _ctx, _dry_run, ty, name, _resource, _dependencies, _parent, _custom, protect, _provider, _property_deps, _delete_before_replace, _ignore_changes, _version, _import, - _replace_on_changes): + _replace_on_changes, _providers): if _custom and not ty.startswith("pulumi:providers:"): expect_protect = False expect_provider_name = "" diff --git a/sdk/python/lib/test/langhost/inheritance_translation/test_inheritance_translation.py b/sdk/python/lib/test/langhost/inheritance_translation/test_inheritance_translation.py index a2a7f6e4ab3e..8de3a54f5e64 100644 --- a/sdk/python/lib/test/langhost/inheritance_translation/test_inheritance_translation.py +++ b/sdk/python/lib/test/langhost/inheritance_translation/test_inheritance_translation.py @@ -23,7 +23,7 @@ def test_inheritance_translation(self): def register_resource(self, _ctx, _dry_run, ty, name, _resource, _dependencies, _parent, _custom, protect, _provider, _property_deps, _delete_before_replace, _ignore_changes, _version, _import, - _replace_on_changes): + _replace_on_changes, _providers): self.assertEqual("test:index:MyResource", ty) return { "urn": self.make_urn(ty, name), diff --git a/sdk/python/lib/test/langhost/inheritance_types/test_inheritance_types.py b/sdk/python/lib/test/langhost/inheritance_types/test_inheritance_types.py index 41e7c506d4f3..82422abbcfd7 100644 --- a/sdk/python/lib/test/langhost/inheritance_types/test_inheritance_types.py +++ b/sdk/python/lib/test/langhost/inheritance_types/test_inheritance_types.py @@ -23,7 +23,7 @@ def test_inheritance_types(self): def register_resource(self, _ctx, _dry_run, ty, name, _resource, _dependencies, _parent, _custom, protect, _provider, _property_deps, _delete_before_replace, _ignore_changes, _version, _import, - _replace_on_changes): + _replace_on_changes, _providers): self.assertEqual("test:index:MyResource", ty) return { "urn": self.make_urn(ty, name), diff --git a/sdk/python/lib/test/langhost/input_type_mismatch/test_input_type_mismatch.py b/sdk/python/lib/test/langhost/input_type_mismatch/test_input_type_mismatch.py index ee3a620840da..465b8fe3fb61 100644 --- a/sdk/python/lib/test/langhost/input_type_mismatch/test_input_type_mismatch.py +++ b/sdk/python/lib/test/langhost/input_type_mismatch/test_input_type_mismatch.py @@ -25,7 +25,7 @@ def test_input_type_mismatch(self): def register_resource(self, _ctx, _dry_run, ty, name, _resource, _dependencies, _parent, _custom, protect, _provider, _property_deps, _delete_before_replace, _ignore_changes, _version, _import, - _replace_on_changes): + _replace_on_changes, _providers): self.assertEqual("test:index:MyResource", ty) policy = _resource["policy"] diff --git a/sdk/python/lib/test/langhost/input_values_for_outputs/test_input_values_for_outputs.py b/sdk/python/lib/test/langhost/input_values_for_outputs/test_input_values_for_outputs.py index 71e89543b5c2..d76d1fa59469 100644 --- a/sdk/python/lib/test/langhost/input_values_for_outputs/test_input_values_for_outputs.py +++ b/sdk/python/lib/test/langhost/input_values_for_outputs/test_input_values_for_outputs.py @@ -26,7 +26,7 @@ def test_input_values_for_outputs(self): def register_resource(self, _ctx, _dry_run, ty, name, _resource, _dependencies, _parent, _custom, protect, _provider, _property_deps, _delete_before_replace, _ignore_changes, _version, _import, - _replace_on_changes): + _replace_on_changes, _providers): return { "urn": self.make_urn(ty, name), "id": name, diff --git a/sdk/python/lib/test/langhost/invalid_property_dependency/test_invalid_property_dependency.py b/sdk/python/lib/test/langhost/invalid_property_dependency/test_invalid_property_dependency.py index d97e6d045242..d8282a6a072a 100644 --- a/sdk/python/lib/test/langhost/invalid_property_dependency/test_invalid_property_dependency.py +++ b/sdk/python/lib/test/langhost/invalid_property_dependency/test_invalid_property_dependency.py @@ -25,7 +25,7 @@ def test_invalid_property_dependency(self): def register_resource(self, _ctx, _dry_run, ty, name, _resource, _dependencies, _parent, _custom, protect, _provider, _property_deps, _delete_before_replace, _ignore_changes, _version, _import, - _replace_on_changes): + _replace_on_changes, _providers): self.assertEqual(ty, "test:index:MyResource") if name == "resA": self.assertListEqual(_dependencies, []) diff --git a/sdk/python/lib/test/langhost/invoke/test_invoke.py b/sdk/python/lib/test/langhost/invoke/test_invoke.py index 2fd83b3a7560..63ac44efac0a 100644 --- a/sdk/python/lib/test/langhost/invoke/test_invoke.py +++ b/sdk/python/lib/test/langhost/invoke/test_invoke.py @@ -35,7 +35,7 @@ def invoke(self, _ctx, token, args, provider, _version): def register_resource(self, _ctx, _dry_run, ty, name, _resource, _dependencies, _parent, _custom, protect, _provider, _property_deps, _delete_before_replace, _ignore_changes, _version, _import, - _replace_on_changes): + _replace_on_changes, _providers): self.assertEqual("test:index:MyResource", ty) self.assertEqual(_resource["value"], 42) diff --git a/sdk/python/lib/test/langhost/invoke_types/test_invoke.py b/sdk/python/lib/test/langhost/invoke_types/test_invoke.py index 0d3a19e8c935..dc5b4ef73a9f 100644 --- a/sdk/python/lib/test/langhost/invoke_types/test_invoke.py +++ b/sdk/python/lib/test/langhost/invoke_types/test_invoke.py @@ -44,7 +44,7 @@ def result(expected_first_value: str, expected_second_value: float): def register_resource(self, _ctx, _dry_run, ty, name, _resource, _dependencies, _parent, _custom, protect, _provider, _property_deps, _delete_before_replace, _ignore_changes, _version, _import, - _replace_on_changes): + _replace_on_changes, _providers): if name == "resourceA": self.assertEqual({ "first_value": "hellohello", diff --git a/sdk/python/lib/test/langhost/large_resource/test_large_resource.py b/sdk/python/lib/test/langhost/large_resource/test_large_resource.py index cf9499fe84ef..78746df34eae 100644 --- a/sdk/python/lib/test/langhost/large_resource/test_large_resource.py +++ b/sdk/python/lib/test/langhost/large_resource/test_large_resource.py @@ -29,7 +29,7 @@ def test_large_resource(self): def register_resource(self, _ctx, _dry_run, ty, name, _resource, _dependencies, _parent, _custom, protect, _provider, _property_deps, _delete_before_replace, _ignore_changes, _version, _import, - _replace_on_changes): + _replace_on_changes, _providers): self.assertEqual(ty, "test:index:MyLargeStringResource") self.assertEqual(name, "testResource1") diff --git a/sdk/python/lib/test/langhost/marshal_failure/test_marshal_failure.py b/sdk/python/lib/test/langhost/marshal_failure/test_marshal_failure.py index 2288246a29c2..ddc5dc26787b 100644 --- a/sdk/python/lib/test/langhost/marshal_failure/test_marshal_failure.py +++ b/sdk/python/lib/test/langhost/marshal_failure/test_marshal_failure.py @@ -28,7 +28,7 @@ def invoke(self, _ctx, token, args, provider, _version): def register_resource(self, _ctx, _dry_run, ty, name, _resource, _dependencies, _parent, _custom, protect, _provider, _property_deps, _delete_before_replace, _ignore_changes, _version, _import, - _replace_on_changes): + _replace_on_changes, _providers): self.assertEqual("test:index:MyResource", ty) return { "urn": self.make_urn(ty, name), diff --git a/sdk/python/lib/test/langhost/one_complex_resource/test_one_complex_resource.py b/sdk/python/lib/test/langhost/one_complex_resource/test_one_complex_resource.py index 1979c20f3aeb..63916498161d 100644 --- a/sdk/python/lib/test/langhost/one_complex_resource/test_one_complex_resource.py +++ b/sdk/python/lib/test/langhost/one_complex_resource/test_one_complex_resource.py @@ -24,7 +24,7 @@ def test_one_complex_resource(self): def register_resource(self, _ctx, _dry_run, ty, name, _resource, _dependencies, _parent, _custom, protect, _provider, _property_deps, _delete_before_replace, _ignore_changes, _version, _import, - _replace_on_changes): + _replace_on_changes, _providers): self.assertEqual(ty, "test:index:MyResource") self.assertEqual(name, "testres") self.assertEqual(_resource["falseprop"], False) diff --git a/sdk/python/lib/test/langhost/one_resource/test_one_resource.py b/sdk/python/lib/test/langhost/one_resource/test_one_resource.py index 2dcc638c5573..63a58dd5fed2 100644 --- a/sdk/python/lib/test/langhost/one_resource/test_one_resource.py +++ b/sdk/python/lib/test/langhost/one_resource/test_one_resource.py @@ -23,7 +23,7 @@ def test_one_resource(self): def register_resource(self, _ctx, _dry_run, ty, name, _resource, _dependencies, _parent, _custom, protect, _provider, _property_deps, _delete_before_replace, _ignore_changes, _version, _import, - _replace_on_changes): + _replace_on_changes, _providers): self.assertEqual(ty, "test:index:MyResource") self.assertEqual(name, "testResource1") return { diff --git a/sdk/python/lib/test/langhost/output_all/test_output_all.py b/sdk/python/lib/test/langhost/output_all/test_output_all.py index 74966ae7ca90..f570bea8a202 100644 --- a/sdk/python/lib/test/langhost/output_all/test_output_all.py +++ b/sdk/python/lib/test/langhost/output_all/test_output_all.py @@ -25,7 +25,7 @@ def test_output_all(self): def register_resource(self, _ctx, _dry_run, ty, name, _resource, _dependencies, _parent, _custom, protect, _provider, _property_deps, _delete_before_replace, _ignore_changes, _version, _import, - _replace_on_changes): + _replace_on_changes, _providers): number = 0 if name == "testResource1": self.assertEqual(ty, "test:index:MyResource") diff --git a/sdk/python/lib/test/langhost/output_nested/test_output_nested.py b/sdk/python/lib/test/langhost/output_nested/test_output_nested.py index 5abfebf75d94..17f6c52d25e0 100644 --- a/sdk/python/lib/test/langhost/output_nested/test_output_nested.py +++ b/sdk/python/lib/test/langhost/output_nested/test_output_nested.py @@ -23,7 +23,7 @@ def test_output_nested(self): def register_resource(self, _ctx, _dry_run, ty, name, _resource, _dependencies, _parent, _custom, protect, _provider, _property_deps, _delete_before_replace, _ignore_changes, _version, _import, - _replace_on_changes): + _replace_on_changes, _providers): nested_numbers = None if name == "testResource1": self.assertEqual(ty, "test:index:MyResource") diff --git a/sdk/python/lib/test/langhost/output_property_dependencies/test_output_property_dependencies.py b/sdk/python/lib/test/langhost/output_property_dependencies/test_output_property_dependencies.py index 0cb7206337f3..f1473163e5f7 100644 --- a/sdk/python/lib/test/langhost/output_property_dependencies/test_output_property_dependencies.py +++ b/sdk/python/lib/test/langhost/output_property_dependencies/test_output_property_dependencies.py @@ -24,7 +24,7 @@ def test_output_property_dependencies(self): def register_resource(self, _ctx, _dry_run, ty, name, _resource, _dependencies, _parent, _custom, protect, _provider, _property_deps, _delete_before_replace, _ignore_changes, _version, _import, - _replace_on_changes): + _replace_on_changes, _providers): self.assertEqual(ty, "test:index:MyResource") if name == "resA": return { diff --git a/sdk/python/lib/test/langhost/preview/test_preview.py b/sdk/python/lib/test/langhost/preview/test_preview.py index 462eeb44f51e..0137a3ca752a 100644 --- a/sdk/python/lib/test/langhost/preview/test_preview.py +++ b/sdk/python/lib/test/langhost/preview/test_preview.py @@ -26,7 +26,7 @@ def test_preview(self): def register_resource(self, _ctx, _dry_run, ty, name, _resource, _dependencies, _parent, _custom, protect, _provider, _property_deps, _delete_before_replace, _ignore_changes, _version, _import, - _replace_on_changes): + _replace_on_changes, _providers): self.assertEqual(ty, "test:index:MyResource") self.assertEqual(name, "foo") if _dry_run: diff --git a/sdk/python/lib/test/langhost/property_dependencies/test_property_dependencies.py b/sdk/python/lib/test/langhost/property_dependencies/test_property_dependencies.py index cbdfa9d1df96..3dbcfafbfa90 100644 --- a/sdk/python/lib/test/langhost/property_dependencies/test_property_dependencies.py +++ b/sdk/python/lib/test/langhost/property_dependencies/test_property_dependencies.py @@ -24,7 +24,7 @@ def test_property_dependencies(self): def register_resource(self, _ctx, _dry_run, ty, name, _resource, _dependencies, _parent, _custom, protect, _provider, _property_deps, _delete_before_replace, _ignore_changes, _version, _import, - _replace_on_changes): + _replace_on_changes, _providers): self.assertEqual(ty, "test:index:MyResource") if name == "resA": self.assertListEqual(_dependencies, [], msg=f"{name}._dependencies") diff --git a/sdk/python/lib/test/langhost/property_renaming/test_property_renaming.py b/sdk/python/lib/test/langhost/property_renaming/test_property_renaming.py index 94ea0c2bf43a..8300bba46860 100644 --- a/sdk/python/lib/test/langhost/property_renaming/test_property_renaming.py +++ b/sdk/python/lib/test/langhost/property_renaming/test_property_renaming.py @@ -27,7 +27,7 @@ def test_property_renaming(self): def register_resource(self, _ctx, _dry_run, ty, name, _resource, _dependencies, _parent, _custom, protect, _provider, _property_deps, _delete_before_replace, _ignore_changes, _version, _import, - _replace_on_changes): + _replace_on_changes, _providers): # Test: # 1. Everything that we receive from the running program is in camel-case. The engine never sees # the pre-translated names of the input properties. diff --git a/sdk/python/lib/test/langhost/protect/test_protect.py b/sdk/python/lib/test/langhost/protect/test_protect.py index 525726f2b9b5..883a7eb5cd39 100644 --- a/sdk/python/lib/test/langhost/protect/test_protect.py +++ b/sdk/python/lib/test/langhost/protect/test_protect.py @@ -26,7 +26,7 @@ def test_protect(self): def register_resource(self, _ctx, _dry_run, ty, name, _resource, _dependencies, _parent, _custom, protect, _provider, _property_deps, _delete_before_replace, _ignore_changes, _version, _import, - _replace_on_changes): + _replace_on_changes, _providers): self.assertEqual("foo", name) self.assertTrue(protect) return { diff --git a/sdk/python/lib/test/langhost/read/test_read.py b/sdk/python/lib/test/langhost/read/test_read.py index eec2fc4e8860..87e1dad25c04 100644 --- a/sdk/python/lib/test/langhost/read/test_read.py +++ b/sdk/python/lib/test/langhost/read/test_read.py @@ -23,7 +23,7 @@ def test_read(self): def register_resource(self, _ctx, _dry_run, ty, name, _resource, _dependencies, _parent, _custom, protect, _provider, _property_deps, _delete_before_replace, _ignore_changes, _version, _import, - _replace_on_changes): + _replace_on_changes, _providers): self.assertEqual(ty, "test:index:MyResource") self.assertEqual(name, "foo2") return { diff --git a/sdk/python/lib/test/langhost/remote_component_dependencies/test_remote_component_dependencies.py b/sdk/python/lib/test/langhost/remote_component_dependencies/test_remote_component_dependencies.py index 336e88a5af70..6a97a92b0c96 100644 --- a/sdk/python/lib/test/langhost/remote_component_dependencies/test_remote_component_dependencies.py +++ b/sdk/python/lib/test/langhost/remote_component_dependencies/test_remote_component_dependencies.py @@ -41,6 +41,7 @@ def register_resource( _version, _import, _replace_on_changes, + _providers, ): if name == "resA": diff --git a/sdk/python/lib/test/langhost/remote_component_providers/__init__.py b/sdk/python/lib/test/langhost/remote_component_providers/__init__.py new file mode 100644 index 000000000000..39d2a134ee45 --- /dev/null +++ b/sdk/python/lib/test/langhost/remote_component_providers/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2016-2023, Pulumi Corporation. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/sdk/python/lib/test/langhost/remote_component_providers/__main__.py b/sdk/python/lib/test/langhost/remote_component_providers/__main__.py new file mode 100644 index 000000000000..6ffb94933fe1 --- /dev/null +++ b/sdk/python/lib/test/langhost/remote_component_providers/__main__.py @@ -0,0 +1,43 @@ +# Copyright 2016-2023, Pulumi Corporation. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from pulumi import ComponentResource, ProviderResource, ResourceOptions + + +class Provider(ProviderResource): + def __init__(self, name, opts=None): + super().__init__("test", name, opts=opts) + + +class FooProvider(ProviderResource): + def __init__(self, name, opts=None): + super().__init__("foo", name, opts=opts) + + +class RemoteComponent(ComponentResource): + def __init__(self, name, opts=None): + super().__init__("test:index:Component", name, opts=opts, remote=True) + + +myprovider = Provider("myprovider") + +RemoteComponent("singular", ResourceOptions(provider=myprovider)) +RemoteComponent("map", ResourceOptions(providers={"test": myprovider})) +RemoteComponent("array", ResourceOptions(providers=[myprovider])) + +fooprovider = FooProvider("fooprovider") + +RemoteComponent("foo-singular", ResourceOptions(provider=fooprovider)) +RemoteComponent("foo-map", ResourceOptions(providers={"foo": fooprovider})) +RemoteComponent("foo-array", ResourceOptions(providers=[fooprovider])) diff --git a/sdk/python/lib/test/langhost/remote_component_providers/test_remote_component_providers.py b/sdk/python/lib/test/langhost/remote_component_providers/test_remote_component_providers.py new file mode 100644 index 000000000000..4cde68dfcc92 --- /dev/null +++ b/sdk/python/lib/test/langhost/remote_component_providers/test_remote_component_providers.py @@ -0,0 +1,56 @@ +# Copyright 2016-2023, Pulumi Corporation. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +from os import path +import unittest +from ..util import LanghostTest + + +class RemoteComponentProvidersTest(LanghostTest): + def test_remote_component_dependencies(self): + self.run_test( + program=path.join(self.base_path(), "remote_component_providers"), + expected_resource_count=8, + ) + + def register_resource( + self, + _ctx, + _dry_run, + ty, + name, + _resource, + _dependencies, + _parent, + _custom, + _protect, + provider, + _property_deps, + _delete_before_replace, + _ignore_changes, + _version, + _import, + _replace_on_changes, + providers, + ): + if name == "singular" or name == "map" or name == "array": + self.assertEqual(provider, "myprovider::myprovider") + self.assertEqual(list(providers.keys()), ["test"]) + if name == "foo-singular" or name == "foo-map" or name == "foo-array": + self.assertEqual(provider, "") + self.assertEqual(list(providers.keys()), ["foo"]) + + return { + "urn": name, + "id": name, + } diff --git a/sdk/python/lib/test/langhost/replace_on_changes/test_replace_on_changes.py b/sdk/python/lib/test/langhost/replace_on_changes/test_replace_on_changes.py index 3cb0a0bf29f3..2d5043fd285f 100644 --- a/sdk/python/lib/test/langhost/replace_on_changes/test_replace_on_changes.py +++ b/sdk/python/lib/test/langhost/replace_on_changes/test_replace_on_changes.py @@ -26,7 +26,7 @@ def test_replace_on_changes(self): def register_resource(self, _ctx, _dry_run, ty, name, _resource, _dependencies, _parent, _custom, protect, _provider, _property_deps, _delete_before_replace, _ignore_changes, _version, _import, - _replace_on_changes): + _replace_on_changes, _providers): print(f'register_resource args: {locals()}') self.assertEqual("testResource", name) diff --git a/sdk/python/lib/test/langhost/resource_op_bad_inputs/test_resource_op_bad_inputs.py b/sdk/python/lib/test/langhost/resource_op_bad_inputs/test_resource_op_bad_inputs.py index 5a45261b9936..6539d02c530e 100644 --- a/sdk/python/lib/test/langhost/resource_op_bad_inputs/test_resource_op_bad_inputs.py +++ b/sdk/python/lib/test/langhost/resource_op_bad_inputs/test_resource_op_bad_inputs.py @@ -23,5 +23,5 @@ def test_unhandled_exception(self): def register_resource(self, _ctx, _dry_run, ty, name, _resource, _dependencies, _parent, _custom, protect, _provider, _property_deps, _delete_before_replace, _ignore_changes, _version, _import, - _replace_on_changes): + _replace_on_changes, _providers): raise Exception("oh no") diff --git a/sdk/python/lib/test/langhost/resource_op_fail/test_resource_op_fail.py b/sdk/python/lib/test/langhost/resource_op_fail/test_resource_op_fail.py index 878bec1121b5..a2c4b1e56255 100644 --- a/sdk/python/lib/test/langhost/resource_op_fail/test_resource_op_fail.py +++ b/sdk/python/lib/test/langhost/resource_op_fail/test_resource_op_fail.py @@ -23,5 +23,5 @@ def test_unhandled_exception(self): def register_resource(self, _ctx, _dry_run, ty, name, _resource, _dependencies, _parent, _custom, protect, _provider, _property_deps, _delete_before_replace, _ignore_changes, _version, _import, - _replace_on_changes): + _replace_on_changes, _providers): raise Exception("oh no") diff --git a/sdk/python/lib/test/langhost/resource_thens/test_resource_thens.py b/sdk/python/lib/test/langhost/resource_thens/test_resource_thens.py index a970b60ef821..9c7b99a8d277 100755 --- a/sdk/python/lib/test/langhost/resource_thens/test_resource_thens.py +++ b/sdk/python/lib/test/langhost/resource_thens/test_resource_thens.py @@ -31,7 +31,7 @@ def test_resource_thens(self): def register_resource(self, _ctx, _dry_run, ty, name, _resource, _dependencies, _parent, _custom, protect, _provider, _property_deps, _delete_before_replace, _ignore_changes, _version, _import, - _replace_on_changes): + _replace_on_changes, _providers): if ty == "test:index:ResourceA": self.assertEqual(name, "resourceA") self.assertDictEqual(_resource, {"inprop": 777, "inprop_2": 42}) diff --git a/sdk/python/lib/test/langhost/ten_resources/test_ten_resources.py b/sdk/python/lib/test/langhost/ten_resources/test_ten_resources.py index 6a6c7b684a24..3f3c5723db79 100644 --- a/sdk/python/lib/test/langhost/ten_resources/test_ten_resources.py +++ b/sdk/python/lib/test/langhost/ten_resources/test_ten_resources.py @@ -26,7 +26,7 @@ def test_ten_resources(self): def register_resource(self, _ctx, _dry_run, ty, name, _resource, _dependencies, _parent, _custom, protect, _provider, _property_deps, _delete_before_replace, _ignore_changes, _version, _import, - _replace_on_changes): + _replace_on_changes, _providers): self.assertEqual("test:index:MyResource", ty) if not _dry_run: self.assertIsNone( diff --git a/sdk/python/lib/test/langhost/types/test_types.py b/sdk/python/lib/test/langhost/types/test_types.py index d06a97b0e2f9..90baa8eb313c 100644 --- a/sdk/python/lib/test/langhost/types/test_types.py +++ b/sdk/python/lib/test/langhost/types/test_types.py @@ -24,7 +24,7 @@ def test_types(self): def register_resource(self, _ctx, _dry_run, ty, name, _resource, _dependencies, _parent, _custom, protect, _provider, _property_deps, _delete_before_replace, _ignore_changes, _version, _import, - _replace_on_changes): + _replace_on_changes, _providers): if name in ["testres", "testres2", "testres3", "testres4"]: self.assertIn("additional", _resource) self.assertEqual({ diff --git a/sdk/python/lib/test/langhost/util.py b/sdk/python/lib/test/langhost/util.py index 645d827f8130..49cbf0cb496e 100644 --- a/sdk/python/lib/test/langhost/util.py +++ b/sdk/python/lib/test/langhost/util.py @@ -99,6 +99,7 @@ def RegisterResource(self, request, context): version = request.version import_ = request.importId replace_on_changes = sorted(list(request.replaceOnChanges)) + providers = request.providers property_dependencies = {} for key, value in request.propertyDependencies.items(): @@ -108,6 +109,7 @@ def RegisterResource(self, request, context): outs = self.langhost_test.register_resource( context, self.dryrun, type_, name, props, deps, parent, custom, protect, provider, property_dependencies, delete_before_replace, ignore_changes, version, import_, replace_on_changes, + providers, ) if outs.get("urn"): urn = outs["urn"] @@ -280,7 +282,7 @@ def read_resource(self, ctx, ty, name, _id, parent, state, dependencies, provide def register_resource(self, _ctx, _dry_run, ty, name, _resource, _dependencies, _parent, _custom, protect, _provider, _property_deps, _delete_before_replace, _ignore_changes, _version, _import, - _replace_on_changes): + _replace_on_changes, _providers): """ Method corresponding to the `RegisterResource` resource monitor RPC call. Override for custom behavior or assertions. diff --git a/sdk/python/lib/test/langhost/versions/test_versions.py b/sdk/python/lib/test/langhost/versions/test_versions.py index 5e93de7eeb00..9dcb1cc9b3c6 100644 --- a/sdk/python/lib/test/langhost/versions/test_versions.py +++ b/sdk/python/lib/test/langhost/versions/test_versions.py @@ -23,7 +23,7 @@ def test_versions(self): def register_resource(self, _ctx, _dry_run, ty, name, _resource, _dependencies, _parent, _custom, protect, _provider, _property_deps, _delete_before_replace, _ignore_changes, _version, _import, - _replace_on_changes): + _replace_on_changes, _providers): if name == "testres": self.assertEqual(_version, "0.19.1") elif name == "testres2": From 499e381299f9649baaf11f8590a47a5435c13ae2 Mon Sep 17 00:00:00 2001 From: Justin Van Patten Date: Mon, 26 Jun 2023 00:20:00 -0700 Subject: [PATCH 5/6] [sdk/python] Support explicit providers for packaged components Updates the Python SDK to support passing an explicit provider. --- sdk/python/lib/pulumi/resource.py | 14 +++++--------- sdk/python/lib/pulumi/runtime/resource.py | 20 +++++++++++++++++++- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/sdk/python/lib/pulumi/resource.py b/sdk/python/lib/pulumi/resource.py index 97e942de0e10..ac09721d655c 100644 --- a/sdk/python/lib/pulumi/resource.py +++ b/sdk/python/lib/pulumi/resource.py @@ -34,6 +34,7 @@ from .metadata import get_project, get_stack from .runtime import known_types from .runtime.resource import ( + _pkg_from_type, get_resource, register_resource, register_resource_outputs, @@ -843,15 +844,11 @@ def __init__( # Infer providers and provider maps from parent, if one was provided. self._providers = opts.parent._providers - type_components = t.split(":") - pkg = None - if len(type_components) == 3: - [pkg, _, _] = type_components - + pkg = _pkg_from_type(t) opts.provider, opts.providers = self._get_providers(t, pkg, opts) self._protect = bool(opts.protect) - self._provider = opts.provider if custom else None + self._provider = opts.provider if (custom or remote) else None if self._provider and self._provider.package != pkg: action = ( "get" @@ -994,11 +991,10 @@ def get_provider(self, module_member: str) -> Optional["ProviderResource"]: :return: The :class:`ProviderResource` associated with the given module member, or None if one does not exist. :rtype: Optional[ProviderResource] """ - components = module_member.split(":") - if len(components) != 3: + pkg = _pkg_from_type(module_member) + if pkg is None: return None - [pkg, _, _] = components return self._providers.get(pkg) diff --git a/sdk/python/lib/pulumi/runtime/resource.py b/sdk/python/lib/pulumi/runtime/resource.py index 67530afb434a..b3c180e3cb05 100644 --- a/sdk/python/lib/pulumi/runtime/resource.py +++ b/sdk/python/lib/pulumi/runtime/resource.py @@ -193,7 +193,15 @@ async def prepare_resource( # Construct the provider reference, if we were given a provider to use. provider_ref = None - if custom and opts is not None and opts.provider is not None: + send_provider = custom + if remote and opts is not None and opts.provider is not None: + # If it's a remote component and a provider was specified, only + # send the provider in the request if the provider's package is + # the same as the component's package. + pkg = _pkg_from_type(ty) + if pkg is not None and pkg == opts.provider.package: + send_provider = True + if send_provider and opts is not None and opts.provider is not None: provider = opts.provider # If we were given a provider, wait for it to resolve and construct a provider reference from it. @@ -1106,3 +1114,13 @@ async def _resolve_depends_on_urns( all_deps.add(direct_dep) return await rpc._expand_dependencies(all_deps, from_resource) + + +def _pkg_from_type(ty: str) -> Optional[str]: + """ + Extract the pkg from the type token of the form "pkg:module:member". + """ + parts = ty.split(":") + if len(parts) != 3: + return None + return parts[0] From 8f951da4b8f328eff1ba6eff26dd0c5a9c9a2f95 Mon Sep 17 00:00:00 2001 From: Justin Van Patten Date: Mon, 26 Jun 2023 00:22:26 -0700 Subject: [PATCH 6/6] Changelog --- ...n--support-explicit-providers-for-packaged-components.yaml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 changelog/pending/20230626--sdk-nodejs-python--support-explicit-providers-for-packaged-components.yaml diff --git a/changelog/pending/20230626--sdk-nodejs-python--support-explicit-providers-for-packaged-components.yaml b/changelog/pending/20230626--sdk-nodejs-python--support-explicit-providers-for-packaged-components.yaml new file mode 100644 index 000000000000..8ec3f63162ad --- /dev/null +++ b/changelog/pending/20230626--sdk-nodejs-python--support-explicit-providers-for-packaged-components.yaml @@ -0,0 +1,4 @@ +changes: +- type: feat + scope: sdk/nodejs,python + description: Support explicit providers for packaged components