pulumi / pulumi-kubernetesx

Kubernetes for Everyone
Apache License 2.0
135 stars 15 forks source link

Fixes replicas ignoring falsy value zero #64

Closed andrebsguedes closed 3 years ago

andrebsguedes commented 3 years ago

In JavaScript (or TypeScript) zero is considered a falsy value, so when replicas is assigned to args.replicas || 1 the 0 value is never allowed.

leezen commented 3 years ago

@andrebsguedes Thanks for finding this issue and providing a PR. I think ?? might be more idiomatic than the undefined check?

andrebsguedes commented 3 years ago

@leezen Sorry, I wasn't sure if your target supported these somewhat newer operators

leezen commented 3 years ago

@andrebsguedes Yup, that makes sense to be cautious. We already have a dependency on this in other parts of our codegen, so this is safe to target support for these.