brave-ambulance-98491
03/14/2020, 11:24 PMpanic: interface conversion: interface {} is resource.PropertyMap, not string
goroutine 28 [running]:
<http://github.com/pulumi/pulumi/pkg/resource.PropertyValue.StringValue(...)|github.com/pulumi/pulumi/pkg/resource.PropertyValue.StringValue(...)>
/home/travis/gopath/pkg/mod/github.com/pulumi/pulumi@v1.6.1/pkg/resource/properties.go:359
<http://github.com/pulumi/pulumi-kubernetes/pkg/provider.parseKubeconfigPropertyValue(0x2386280|github.com/pulumi/pulumi-kubernetes/pkg/provider.parseKubeconfigPropertyValue(0x2386280>, 0xc0001fea50, 0x2475423, 0xa, 0xc0001b2508)
/home/travis/gopath/src/github.com/pulumi/pulumi-kubernetes/pkg/provider/util.go:85 +0x169
<http://github.com/pulumi/pulumi-kubernetes/pkg/provider.(*kubeProvider).DiffConfig(0xc000014000|github.com/pulumi/pulumi-kubernetes/pkg/provider.(*kubeProvider).DiffConfig(0xc000014000>, 0x26e1260, 0xc0001fe9f0, 0xc0001380e0, 0xc000014000, 0x2275301, 0xc00031a0c0)
/home/travis/gopath/src/github.com/pulumi/pulumi-kubernetes/pkg/provider/provider.go:278 +0x61b
<http://github.com/pulumi/pulumi/sdk/proto/go._ResourceProvider_DiffConfig_Handler.func1(0x26e1260|github.com/pulumi/pulumi/sdk/proto/go._ResourceProvider_DiffConfig_Handler.func1(0x26e1260>, 0xc0001fe9f0, 0x23a5e80, 0xc0001380e0, 0x23c0a00, 0x33070c0, 0x26e1260, 0xc0001fe9f0)
/home/travis/gopath/pkg/mod/github.com/pulumi/pulumi@v1.6.1/sdk/proto/go/provider.pb.go:1504 +0x86
<http://github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc.OpenTracingServerInterceptor.func1(0x26e1260|github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc.OpenTracingServerInterceptor.func1(0x26e1260>, 0xc000577200, 0x23a5e80, 0xc0001380e0, 0xc00000cb20, 0xc00000cb40, 0x0, 0x0, 0x26a05e0, 0xc0000cf7b0)
/home/travis/gopath/pkg/mod/github.com/grpc-ecosystem/grpc-opentracing@v0.0.0-20171105060200-01f8541d5372/go/otgrpc/server.go:61 +0x36e
<http://github.com/pulumi/pulumi/sdk/proto/go._ResourceProvider_DiffConfig_Handler(0x2402f60|github.com/pulumi/pulumi/sdk/proto/go._ResourceProvider_DiffConfig_Handler(0x2402f60>, 0xc000014000, 0x26e1260, 0xc000577200, 0xc0000de3c0, 0xc0004d2040, 0x26e1260, 0xc000577200, 0xc000331300, 0x101f)
/home/travis/gopath/pkg/mod/github.com/pulumi/pulumi@v1.6.1/sdk/proto/go/provider.pb.go:1506 +0x14b
<http://google.golang.org/grpc.(*Server).processUnaryRPC(0xc00034e300|google.golang.org/grpc.(*Server).processUnaryRPC(0xc00034e300>, 0x26fdc00, 0xc00045b500, 0xc00015a200, 0xc000436180, 0x32d3258, 0x0, 0x0, 0x0)
/home/travis/gopath/pkg/mod/google.golang.org/grpc@v1.21.1/server.go:998 +0x46a
<http://google.golang.org/grpc.(*Server).handleStream(0xc00034e300|google.golang.org/grpc.(*Server).handleStream(0xc00034e300>, 0x26fdc00, 0xc00045b500, 0xc00015a200, 0x0)
/home/travis/gopath/pkg/mod/google.golang.org/grpc@v1.21.1/server.go:1278 +0xd97
<http://google.golang.org/grpc.(*Server).serveStreams.func1.1(0xc00039bd30|google.golang.org/grpc.(*Server).serveStreams.func1.1(0xc00039bd30>, 0xc00034e300, 0x26fdc00, 0xc00045b500, 0xc00015a200)
/home/travis/gopath/pkg/mod/google.golang.org/grpc@v1.21.1/server.go:717 +0xbb
created by <http://google.golang.org/grpc.(*Server).serveStreams.func1|google.golang.org/grpc.(*Server).serveStreams.func1>
/home/travis/gopath/pkg/mod/google.golang.org/grpc@v1.21.1/server.go:715 +0xa1
white-balloon-205
03/15/2020, 8:09 PMkubeconfig
property set to in your program (and in your state file)? It is expected to be a string, but it looks like perhaps you are passing an object?brave-ambulance-98491
03/15/2020, 8:40 PMkubeconfig
value, exported from another stack.export const eksKubeconfig = eksCluster.kubeconfig;
white-balloon-205
03/15/2020, 9:25 PMJSON.stringify
an object if passed in here.
What language are you using? I would have expected a type-error in your language even ahead of being able to reach this.
All of the occurences of kubeconfig:
in pulumi/examples show passing it a string (from various different sources), including this snippet in the aws-ts-eks
README:
const myk8s = new k8s.Provider("myk8s", {
kubeconfig: cluster.kubeconfig.apply(JSON.stringify),
});
brave-ambulance-98491
03/15/2020, 10:27 PMany
or something?
const providerKubeconfig = infraStack.requireOutput("eksClusterKubeconfig");
const eksProvider = new k8s.Provider("eks-k8s-provider", {
kubeconfig: providerKubeconfig
});
args
array to the returned cluster value, which is pretty dang ugly.white-balloon-205
03/15/2020, 10:34 PMrequireOutput
returns any
. So unless you cast that explicitly into what you know it actually is - this won't get caught.there's actually a related feature request i'd love to submit where the kubeconfig builder function is exported from that moduleThat's a good idea. Mind opening an issue in
pulumi/eks
? I think this has come up before (and there may even already be an issue there?).brave-ambulance-98491
03/15/2020, 10:40 PMshy-tent-25663
03/25/2020, 2:50 PMkubeconfig
from another stack and receiving a panic when the config is consumed by the Provider
method. However, changes are applied to the stack with no other errors.
panic: interface conversion: interface {} is resource.PropertyMap, not string
exporting stack:
const clusterObj = cluster.create(controlPlaneSg, ngRole);
export const kubeconfig = clusterObj.kubeconfig;
consuming stack:
export const clusterStackRef = new pulumi.StackReference(`project/trips/${envName}`);
const clusterKubeconfig = clusterStackRef.requireOutput("kubeconfig");
const provider = new k8s.Provider("provider", { kubeconfig: clusterKubeconfig });
white-balloon-205
03/25/2020, 3:27 PMk8s.Provider( { kubeconfig: ... })
. Is your exported kubeconfig
a string or an object?
We should at least have a better error here, if not accept either a string or an object.shy-tent-25663
03/25/2020, 4:09 PMkubeconfig
as an object. I added JSON.stringify
but I get the same panic, even on preview.
const clusterKubeconfig = clusterStackRef.requireOutput("kubeconfig").apply(JSON.stringify);
const provider = new k8s.Provider("provider", { kubeconfig: clusterKubeconfig });
brave-ambulance-98491
03/25/2020, 4:11 PMshy-tent-25663
03/26/2020, 3:55 PM