https://pulumi.com logo
#automation-api
Title
# automation-api
p

proud-pizza-80589

03/16/2022, 9:59 PM
Given the following component resource https://gist.github.com/roderik/4d6a223f05623280d87b2ce16c870d2f i can easily scale up my PVC (by increasing resources.limits.storage) But scaling down can’t happen as this will throw an error. Is there a way to access the “current” state of this component resource so I can compare it and not downgrade storage?
l

little-cartoon-10569

03/16/2022, 10:02 PM
That should be done outside of Pulumi. You can call your cloud provider's SDK to get the current value synchronously, before Pulumi starts doing its thing (that is: don't do it inside the component resource, do it in index.ts or similar). Then pass it to where it needs to be and apply your logic.
Or, if you wanted to do it asynchronously, you could look it up inside the constructor, but that introduces more opportunity to fail during deployment.
p

proud-pizza-80589

03/16/2022, 10:07 PM
Optimally Pulumi would recognise that downgrading storage is not allowed, we modified it can scale uo here https://github.com/pulumi/pulumi-kubernetes/pull/1705 but now downsizing errors out
l

little-cartoon-10569

03/16/2022, 10:08 PM
That's not a Pulumi feature, though it could be a provider feature.
p

proud-pizza-80589

03/16/2022, 10:09 PM
yeah, i throw pulumi and all of its providers on one pile 😉