nginxinc / kic-reference-architectures

MARA: Modern Application Reference Architecture

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bug: when is a number not a number in the land of pulumi?

qdzlug opened this issue · comments

Describe the bug
The following error is thrown building our cluster....

View Live: https://app.pulumi.com/qdzlug/do-k8s/jaymara203/updates/2


 +  pulumi:pulumi:Stack do-k8s-jaymara203 creating
    digitalocean:index:KubernetesCluster do-jaymara203-cluster  error: digitalocean:index/kubernetesCluster:KubernetesCluster resource 'do-jaymara203-cluster' has a problem: Attribute must be a whole number, got 3. Examine values at 'KubernetesCluster.NodePool.NodeCount'.
 +  pulumi:pulumi:Stack do-k8s-jaymara203 created
    digitalocean:index:KubernetesCluster do-jaymara203-cluster **failed** 1 error

Diagnostics:
  digitalocean:index:KubernetesCluster (do-jaymara203-cluster):
    error: digitalocean:index/kubernetesCluster:KubernetesCluster resource 'do-jaymara203-cluster' has a problem: Attribute must be a whole number, got 3. Examine values at 'KubernetesCluster.NodePool.NodeCount'.

Resources:
    + 1 created

Duration: 2s

 stderr:

But looking at the config....

❯ pulumi config -C ./pulumi/python/infrastructure/digitalocean/container-registry
KEY                    VALUE
docean:instance_size   s-4vcpu-8gb
docean:k8s_version     1.22.12-do.0
docean:node_count      3
docean:region          sfo3
kic-helm:fqdn          mara203.docean.mantawang.com
kubernetes:infra_type  DO

To Reproduce
Steps to reproduce the behavior:

  1. Deploy to DO, and include a integer for # of nodes.
  2. Run deployment.
  3. Boom, as shown above...

Expected behavior
To work; if you remove the value from the config file and instead use the fallback in the code (which is also set to 3) things work as expected.

Your environment

Additional context
None

Fix is to force Pulumi to treat it as an int; so instead of Config.get you need to use Config.get_int.

Will be closed by #167