https://pulumi.com logo
b

better-actor-92669

02/08/2021, 4:55 PM
Hey guys. Is there any way to skip an installation of some object in a helm chart using transformations? For instance, I want to avoid installing everything that includes the substring "test". I tried
del obj
but it doesn't work.
Copy code
def remove_test_objects(obj):
    # if obj["kind"] == "Pod" and 'test' in obj["metadata"]["name"]:
    if 'test' in obj["metadata"]["name"]:
        del obj
g

gorgeous-egg-16927

02/08/2021, 5:00 PM
b

better-actor-92669

02/08/2021, 5:12 PM
@gorgeous-egg-16927, thanks a lot, gonna test it now
Copy code
# Omit a resource from the Chart by transforming the specified resource definition to an empty List.
def omit_resource(obj, opts):
    if obj["kind"] == "Pod" and obj["metadata"]["name"] == "test":
        obj["apiVersion"] = "v1"
        obj["kind"] = "List"
4 Views