Having some trouble with promises and providers, c...
# general
b
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
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.