Given the following component resource <https://gi...
# automation-api
p
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
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
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
That's not a Pulumi feature, though it could be a provider feature.
p
yeah, i throw pulumi and all of its providers on one pile 😉