Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Closed
qdzlug opened this issue Aug 4, 2022 · 1 comment · Fixed by #167
Closed

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

qdzlug opened this issue Aug 4, 2022 · 1 comment · Fixed by #167
Assignees

Comments

@qdzlug
Copy link
Contributor

qdzlug commented Aug 4, 2022

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

@qdzlug
Copy link
Contributor Author

qdzlug commented Aug 4, 2022

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

@qdzlug qdzlug self-assigned this Aug 19, 2022
@qdzlug qdzlug linked a pull request Aug 19, 2022 that will close this issue
7 tasks
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant