sparse-intern-71089
12/19/2018, 3:03 PMgifted-island-55702
12/19/2018, 3:05 PMk8sCluster
object instead of project config. When I did that, pulumi was finding changes to be deployed every time I run pulumi update
even though there were no changes in my code. When I added some debug logging I found out that when it checks the updates, project
variable doesn’t contain a plain string value but instead an object (it’s printed in my debug output as [object ...]
). Is it a bug?gifted-island-55702
12/19/2018, 10:58 PMwhite-balloon-205
[object Object]
it typically means you are attempting to toString an Output
. Instead, you need to use output.apply(x => x.toString())
or similar. For example to log the Output you would want to do output.apply(console.log)
. The value of these `Output`s is not known unti the deployment has happened, which is why these are wrapped inside Output
instead of just string values. The pulumi.all
and pulumi.apply
above are part of taking all of these Outputs and using them to construct a new string value for the kubeconfig.white-balloon-205
gifted-island-55702
12/19/2018, 11:21 PMgifted-island-55702
12/19/2018, 11:26 PMexport const k8sConfig = pulumi.
all([ cluster.project, cluster.name, cluster.endpoint, cluster.masterAuth, cluster.region, cluster.zone ]).
apply(([ project, name, endpoint, auth, region, zone ]) => {
const location = region || zone
const context = `${project}_${location}_${name}`
return `apiVersion: v1
clusters:
.....
gifted-island-55702
12/19/2018, 11:28 PMregion
or zone
depending on the actual cluster (regional vs zonal) to create the context name. In my case the cluster is zonal, and region
is undefined. In this scenario whenever I run pulumi update
it always shows there is a change in my k8s provider due to a change in kubeconfig even though there was no change in the code.gifted-island-55702
12/19/2018, 11:29 PMregion
(which in my scenario always has undefined
value) then it work correctlygifted-island-55702
12/19/2018, 11:29 PMgifted-island-55702
12/19/2018, 11:41 PM