I would expect you to see something along these lines during preview
gorgeous-egg-16927
02/19/2020, 4:32 PM
It may be a problem with your transformation. I’m not sure
obj.props?.metadata
is correct; I’d expect it to be
obj.metadata
.
gorgeous-egg-16927
02/19/2020, 4:33 PM
Note that instead of changing the namespace with a transformation, you can set a default namespace on a Provider, and any resources using that Provider will use that namespace if one is not already set.
gorgeous-egg-16927
02/19/2020, 4:35 PM
Copy code
const provider = new k8s.Provider("bar", {namespace: "bar"});
new k8s.yaml.ConfigFile("test",
{file: "secret.yaml"},
{provider}
);
c
creamy-forest-42826
02/20/2020, 9:58 AM
@gorgeous-egg-16927 I see create BEFORE_TRANSFORMATION_NS/secret name during preview. After
pulumi up
in kubectl is used correct (after transformation) namespace.
I tried add console.log in transformation function and it shown log info correctly.
Provider default namespace is not right way for us.
No matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.