Hey guys, we are deploying helm charts and trying ...
# kubernetes
f
Hey guys, we are deploying helm charts and trying to figure out a way to depend on underlying resources of the chart. In Python I see there is a get_resource method on a v3 chart but it returns a Output[CustomResource] and not a Resource so I am unable to add it as a depends_on resource. Do you know a way to do this or is it not possible right now? here is an example. I wanted to extract the deployment of the cert-manager chart but that variable is an Output[CustomResource] and not a Resource so I am unable to use it.
Copy code
cert_manager_deployment = cert_manager_chart.get_resource(group_version_kind="apps/v1/Deployment",
                                                          name="cert-manager",
                                                          namespace="cert-manager")
Trying to use that ends up with this exception
Exception: 'depends_on' was passed a value that was not a Resource.
@gorgeous-egg-16927 Is this something you can help me out with?
g
@billowy-army-68599 Do you know? I haven’t tried this recently.
b
i don't think it's possible? I'd probably be inclined to just run the helm template through kube2pulumi and skip the helm chart altogether in this scenario
@fast-dinner-32080 have you seen that workflow?
f
I have seen that but it would require running it through each time a chart update is made and from what I understand it doesn’t support custom resources.
g
I would have expected that work, actually. CustomResource is a subclass of Resource. Here’s the relevant code that’s raising the exception: https://github.com/pulumi/pulumi/blame/5cef84f0366f264baf51c322d1d22b6124fdf236/sdk/python/lib/pulumi/resource.py#L450-L454
I’m guessing that check isn’t checking parent classes properly if it’s an Output value.
f
Is it due to it being a Output[CustomResource] and not just CustomResource?
g
Yeah, I think that’s a bug in the Python SDK
f
Okay. I just logged this issue to track it https://github.com/pulumi/pulumi/issues/5642
👍 1
Thanks for take a look