https://pulumi.com logo
#kubernetes
Title
# kubernetes
f

fast-dinner-32080

10/27/2020, 7:54 PM
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

gorgeous-egg-16927

10/28/2020, 3:41 PM
@billowy-army-68599 Do you know? I haven’t tried this recently.
b

billowy-army-68599

10/28/2020, 3:41 PM
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

fast-dinner-32080

10/28/2020, 3:44 PM
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

gorgeous-egg-16927

10/28/2020, 3:47 PM
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

fast-dinner-32080

10/28/2020, 3:49 PM
Is it due to it being a Output[CustomResource] and not just CustomResource?
g

gorgeous-egg-16927

10/28/2020, 3:49 PM
Yeah, I think that’s a bug in the Python SDK
f

fast-dinner-32080

10/28/2020, 3:55 PM
Okay. I just logged this issue to track it https://github.com/pulumi/pulumi/issues/5642
👍 1
Thanks for take a look
3 Views