https://pulumi.com logo
Title
b

busy-journalist-6936

03/24/2022, 7:18 PM
I could use some help solving how to write kustomize transformations to remove a namespace object from being generated by @pulumi/kubernetes's kubernetes.kustomize.Directory where the namespace object is coming in from an upstream that is out of my control. Problem of kustomize generating the namespace object results in:
Updating (keycloak):
     Type                                                  Name                   Status                  Info
     pulumi:pulumi:Stack                                   tkl-keycloak-keycloak  **failed**              1 error
     โ””โ”€ kubernetes:kustomize:Directory                     keycloak                                       
 +      โ”œโ”€ kubernetes:core/v1:Namespace                    keycloak               **creating failed**     1 error
๐Ÿงต
q

quiet-wolf-18467

03/25/2022, 10:22 AM
transformations: [
    (obj: any, opts: pulumi.CustomResourceOptions) => {
      unset(obj.metadata.namespace)
    },
This might work
b

busy-journalist-6936

03/25/2022, 5:33 PM
ooh, let me give that a try, Thank you
l

limited-rainbow-51650

05/23/2022, 8:39 AM
@quiet-wolf-18467 I find it confusing that the function signature for transformations on
kustomize.Directory
is different from generic Pulumi resource transformations. It took me some time to figure this out.
q

quiet-wolf-18467

05/25/2022, 10:23 AM
@limited-rainbow-51650 I didnโ€™t know that, let me take a look ๐Ÿ˜„