Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set plugin version for Go SDK invoke calls #1325

Merged
merged 1 commit into from
Sep 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## HEAD (Unreleased)

### Bug Fixes

- Set plugin version for Go SDK invoke calls (https://github.com/pulumi/pulumi-kubernetes/pull/1325)

## 2.6.1 (September 16, 2020)

### Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion provider/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require (
github.com/onsi/gomega v1.9.0 // indirect
github.com/pkg/errors v0.9.1
github.com/pulumi/pulumi/pkg/v2 v2.10.2-0.20200916204740-92a7d717a4d1
github.com/pulumi/pulumi/sdk/v2 v2.10.2-0.20200916204740-92a7d717a4d1
github.com/pulumi/pulumi/sdk/v2 v2.10.2-0.20200917182150-ab70dd3d645d
github.com/stretchr/testify v1.6.1
google.golang.org/grpc v1.29.1
helm.sh/helm/v3 v3.3.1
Expand Down
4 changes: 2 additions & 2 deletions provider/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -882,8 +882,8 @@ github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40T
github.com/pulumi/pulumi/pkg/v2 v2.10.2-0.20200916204740-92a7d717a4d1 h1:6MkruuwuH0SStrTbanQDj002KvmQiiJho8idovsMUgA=
github.com/pulumi/pulumi/pkg/v2 v2.10.2-0.20200916204740-92a7d717a4d1/go.mod h1:zQWe2D4tYJDeXNzSclqNmP8/SMSKOh8k22AbWg3+mVc=
github.com/pulumi/pulumi/sdk/v2 v2.2.1/go.mod h1:QNbWpL4gvf3X0lUFT7TXA2Jo1ff/Ti2l97AyFGYwvW4=
github.com/pulumi/pulumi/sdk/v2 v2.10.2-0.20200916204740-92a7d717a4d1 h1:OuuZs684M+C63XqvNjjK6BHn1+tw2/CYzcPNRwH3mNE=
github.com/pulumi/pulumi/sdk/v2 v2.10.2-0.20200916204740-92a7d717a4d1/go.mod h1:EED7KCDOohYIewUppsav5KHTFTmfYGqUFib1uRvYdWQ=
github.com/pulumi/pulumi/sdk/v2 v2.10.2-0.20200917182150-ab70dd3d645d h1:xIY2dPPLqnqCbNbd3SF/+k9hYYxW0d+4O+xfkKWxL/k=
github.com/pulumi/pulumi/sdk/v2 v2.10.2-0.20200917182150-ab70dd3d645d/go.mod h1:EED7KCDOohYIewUppsav5KHTFTmfYGqUFib1uRvYdWQ=
github.com/qri-io/starlib v0.4.2-0.20200213133954-ff2e8cd5ef8d/go.mod h1:7DPO4domFU579Ga6E61sB9VFNaniPVwJP5C4bBCu3wA=
github.com/quasilyte/go-consistent v0.0.0-20190521200055-c6f3937de18c/go.mod h1:5STLWrekHfjyYwxBRVRXNOSewLJ3PWfDJd1VyTS21fI=
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
Expand Down
6 changes: 5 additions & 1 deletion provider/pkg/gen/go-templates/helm/v3/chart.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,11 @@ func helmTemplate(ctx *pulumi.Context, jsonOpts string) ([]map[string]interface{
var ret struct {
Result []map[string]interface{} `pulumi:"result"`
}
if err := ctx.Invoke("kubernetes:helm:template", &args, &ret); err != nil {

// TODO: Rather than hardcoding, try to parse a version from a go.mod
// https://github.com/pulumi/pulumi-kubernetes/issues/1324
versionOpt := pulumi.Version("2.6.1") // Pin invoke to 2.6.1 so that the helm:template function is available
if err := ctx.Invoke("kubernetes:helm:template", &args, &ret, versionOpt); err != nil {
return nil, errors.Wrap(err, "failed to invoke helm template")
}
return ret.Result, nil
Expand Down
6 changes: 5 additions & 1 deletion provider/pkg/gen/go-templates/kustomize/directory.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,11 @@ func parseDirectory(ctx *pulumi.Context, name string, args directoryArgs, opts .
var ret struct {
Result []map[string]interface{} `pulumi:"result"`
}
if err := ctx.Invoke("kubernetes:kustomize:directory", &invokeArgs, &ret); err != nil {

// TODO: Rather than hardcoding, try to parse a version from a go.mod
// https://github.com/pulumi/pulumi-kubernetes/issues/1324
versionOpt := pulumi.Version("2.6.1")
if err := ctx.Invoke("kubernetes:kustomize:directory", &invokeArgs, &ret, versionOpt); err != nil {
return nil, errors.Wrap(err, "kustomize invoke failed")
}

Expand Down
6 changes: 5 additions & 1 deletion provider/pkg/gen/go-templates/yaml/yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,11 @@ func yamlDecode(ctx *pulumi.Context, text string, opts ...pulumi.ResourceOption)
var ret struct {
Result []map[string]interface{} `pulumi:"result"`
}
if err := ctx.Invoke("kubernetes:yaml:decode", &args, &ret); err != nil {

// TODO: Rather than hardcoding, try to parse a version from a go.mod
// https://github.com/pulumi/pulumi-kubernetes/issues/1324
versionOpt := pulumi.Version("2.6.1")
if err := ctx.Invoke("kubernetes:yaml:decode", &args, &ret, versionOpt); err != nil {
return nil, err
}
return ret.Result, nil
Expand Down
2 changes: 1 addition & 1 deletion sdk/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.14
require (
github.com/google/go-cmp v0.4.0 // indirect
github.com/pkg/errors v0.9.1
github.com/pulumi/pulumi/sdk/v2 v2.2.2-0.20200514204320-e677c7d6dca3
github.com/pulumi/pulumi/sdk/v2 v2.10.2-0.20200917182150-ab70dd3d645d
github.com/sergi/go-diff v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
google.golang.org/genproto v0.0.0-20200318110522-7735f76e9fa5 // indirect
Expand Down
15 changes: 13 additions & 2 deletions sdk/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
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=
Expand Down Expand Up @@ -105,10 +106,14 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxv
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs=
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
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/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-colorable v0.1.6 h1:6Su7aK7lXmJ/U79bYtBjLNaha4Fs1Rg9plHpcH+vvnE=
Expand Down Expand Up @@ -149,10 +154,14 @@ github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y8
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
github.com/pulumi/pulumi/sdk/v2 v2.2.2-0.20200514204320-e677c7d6dca3 h1:uCVadlcmLexcm6WHJv1EFB3E9PKqWQt/+zVuNC+WpjM=
github.com/pulumi/pulumi/sdk/v2 v2.2.2-0.20200514204320-e677c7d6dca3/go.mod h1:QNbWpL4gvf3X0lUFT7TXA2Jo1ff/Ti2l97AyFGYwvW4=
github.com/pulumi/pulumi/sdk/v2 v2.10.2-0.20200917182150-ab70dd3d645d h1:xIY2dPPLqnqCbNbd3SF/+k9hYYxW0d+4O+xfkKWxL/k=
github.com/pulumi/pulumi/sdk/v2 v2.10.2-0.20200917182150-ab70dd3d645d/go.mod h1:EED7KCDOohYIewUppsav5KHTFTmfYGqUFib1uRvYdWQ=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/sabhiram/go-gitignore v0.0.0-20180611051255-d3107576ba94 h1:G04eS0JkAIVZfaJLjla9dNxkJCPiKIGZlw9AfOhzOD0=
github.com/sabhiram/go-gitignore v0.0.0-20180611051255-d3107576ba94/go.mod h1:b18R55ulyQ/h3RaWyloPyER7fWQVZvimKKhnI5OfrJQ=
github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww=
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ=
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
Expand Down Expand Up @@ -187,6 +196,8 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5
github.com/texttheater/golang-levenshtein v0.0.0-20191208221605-eb6844b05fc6 h1:9VTskZOIRf2vKF3UL8TuWElry5pgUpV1tFSe/e/0m/E=
github.com/texttheater/golang-levenshtein v0.0.0-20191208221605-eb6844b05fc6/go.mod h1:XDKHRm5ThF8YJjx001LtgelzsoaEcvnA7lVWz9EeX3g=
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
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.22.1+incompatible h1:NHcubEkVbahf9t3p75TOCR83gdUHXjRJvjoBh1yACsM=
github.com/uber/jaeger-client-go v2.22.1+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk=
github.com/uber/jaeger-lib v2.2.0+incompatible h1:MxZXOiR2JuoANZ3J6DE/U0kSFv/eJ/GfSYVCjK7dyaw=
Expand Down
6 changes: 5 additions & 1 deletion sdk/go/kubernetes/helm/v3/chart.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,11 @@ func helmTemplate(ctx *pulumi.Context, jsonOpts string) ([]map[string]interface{
var ret struct {
Result []map[string]interface{} `pulumi:"result"`
}
if err := ctx.Invoke("kubernetes:helm:template", &args, &ret); err != nil {

// TODO: Rather than hardcoding, try to parse a version from a go.mod
// https://github.com/pulumi/pulumi-kubernetes/issues/1324
versionOpt := pulumi.Version("2.6.1") // Pin invoke to 2.6.1 so that the helm:template function is available
if err := ctx.Invoke("kubernetes:helm:template", &args, &ret, versionOpt); err != nil {
return nil, errors.Wrap(err, "failed to invoke helm template")
}
return ret.Result, nil
Expand Down
6 changes: 5 additions & 1 deletion sdk/go/kubernetes/kustomize/directory.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,11 @@ func parseDirectory(ctx *pulumi.Context, name string, args directoryArgs, opts .
var ret struct {
Result []map[string]interface{} `pulumi:"result"`
}
if err := ctx.Invoke("kubernetes:kustomize:directory", &invokeArgs, &ret); err != nil {

// TODO: Rather than hardcoding, try to parse a version from a go.mod
// https://github.com/pulumi/pulumi-kubernetes/issues/1324
versionOpt := pulumi.Version("2.6.1")
if err := ctx.Invoke("kubernetes:kustomize:directory", &invokeArgs, &ret, versionOpt); err != nil {
return nil, errors.Wrap(err, "kustomize invoke failed")
}

Expand Down
6 changes: 5 additions & 1 deletion sdk/go/kubernetes/yaml/yaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,11 @@ func yamlDecode(ctx *pulumi.Context, text string, opts ...pulumi.ResourceOption)
var ret struct {
Result []map[string]interface{} `pulumi:"result"`
}
if err := ctx.Invoke("kubernetes:yaml:decode", &args, &ret); err != nil {

// TODO: Rather than hardcoding, try to parse a version from a go.mod
// https://github.com/pulumi/pulumi-kubernetes/issues/1324
versionOpt := pulumi.Version("2.6.1")
if err := ctx.Invoke("kubernetes:yaml:decode", &args, &ret, versionOpt); err != nil {
return nil, err
}
return ret.Result, nil
Expand Down
2 changes: 1 addition & 1 deletion tests/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ require (
github.com/pulumi/pulumi-kubernetes/provider/v2 v2.0.0
github.com/pulumi/pulumi-kubernetes/sdk/v2 v2.4.3
github.com/pulumi/pulumi/pkg/v2 v2.10.2-0.20200916204740-92a7d717a4d1
github.com/pulumi/pulumi/sdk/v2 v2.10.2-0.20200916204740-92a7d717a4d1
github.com/pulumi/pulumi/sdk/v2 v2.10.2-0.20200917182150-ab70dd3d645d
github.com/stretchr/testify v1.6.1
)
6 changes: 2 additions & 4 deletions tests/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -859,10 +859,8 @@ github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40T
github.com/pulumi/pulumi/pkg/v2 v2.10.2-0.20200916204740-92a7d717a4d1 h1:6MkruuwuH0SStrTbanQDj002KvmQiiJho8idovsMUgA=
github.com/pulumi/pulumi/pkg/v2 v2.10.2-0.20200916204740-92a7d717a4d1/go.mod h1:zQWe2D4tYJDeXNzSclqNmP8/SMSKOh8k22AbWg3+mVc=
github.com/pulumi/pulumi/sdk/v2 v2.2.1/go.mod h1:QNbWpL4gvf3X0lUFT7TXA2Jo1ff/Ti2l97AyFGYwvW4=
github.com/pulumi/pulumi/sdk/v2 v2.2.2-0.20200514204320-e677c7d6dca3 h1:uCVadlcmLexcm6WHJv1EFB3E9PKqWQt/+zVuNC+WpjM=
github.com/pulumi/pulumi/sdk/v2 v2.2.2-0.20200514204320-e677c7d6dca3/go.mod h1:QNbWpL4gvf3X0lUFT7TXA2Jo1ff/Ti2l97AyFGYwvW4=
github.com/pulumi/pulumi/sdk/v2 v2.10.2-0.20200916204740-92a7d717a4d1 h1:OuuZs684M+C63XqvNjjK6BHn1+tw2/CYzcPNRwH3mNE=
github.com/pulumi/pulumi/sdk/v2 v2.10.2-0.20200916204740-92a7d717a4d1/go.mod h1:EED7KCDOohYIewUppsav5KHTFTmfYGqUFib1uRvYdWQ=
github.com/pulumi/pulumi/sdk/v2 v2.10.2-0.20200917182150-ab70dd3d645d h1:xIY2dPPLqnqCbNbd3SF/+k9hYYxW0d+4O+xfkKWxL/k=
github.com/pulumi/pulumi/sdk/v2 v2.10.2-0.20200917182150-ab70dd3d645d/go.mod h1:EED7KCDOohYIewUppsav5KHTFTmfYGqUFib1uRvYdWQ=
github.com/qri-io/starlib v0.4.2-0.20200213133954-ff2e8cd5ef8d/go.mod h1:7DPO4domFU579Ga6E61sB9VFNaniPVwJP5C4bBCu3wA=
github.com/quasilyte/go-consistent v0.0.0-20190521200055-c6f3937de18c/go.mod h1:5STLWrekHfjyYwxBRVRXNOSewLJ3PWfDJd1VyTS21fI=
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
Expand Down