https://pulumi.com logo
#general
Title
# general
b

busy-umbrella-36067

06/24/2019, 6:04 PM
Having some trouble with promises and providers, can anyone help with building a kubernetes provider that uses a modified kubeconfig from
@pulumi/eks/Cluster
? This is what I've got so far, the modifications (
AWS_PROFILE
env var) never make it to the provider resource thats created
Copy code
const modifiedKubeconfig = this.cluster.kubeconfig.apply(kubeconfig => {
      kubeconfig.users[0].user.exec.env = [{"AWS_PROFILE": "staging"}]
      return kubeconfig
    })

    this.provider = new kube.Provider("test", { kubeconfig: modifiedKubeconfig.apply(JSON.stringify) }, { parent: this })
Looks like I just had to make a deep copy of the kubeconfig before modifying it
w

white-balloon-205

06/24/2019, 6:43 PM
That looks to me like it should work.
Huh - that is a little surprising that a deep copy would be needed. But glad it fixed thing for you.