This message was deleted.
# general
s
This message was deleted.
b
don't do an import. Does the K8s provider have something like
GetNamespace.InvokeAsync
? so you can use that namespace in your stack but it is not a resource managed by your stack.
i can't find anything like what I'm thinking of in the docs. the AWS provider has the concept of Functions like these here: https://www.pulumi.com/docs/reference/pkg/aws/ecs/ and those can be used to get resources that don't belong to the stack so that resources within the stack can reference them. If the K8s provider can't do that though then you'll probably just want to make your own namespace
w
thanks. I've thought about something like
Copy code
const nsDefault = k8s.core.v1.Namespace.get("default", "default");
but then I don't see how I can add annotations or labels. making my own feels like a better idea
b
yea you wouldn't add or make any changes to the resource you are fetching. If you want to do that it should be part of your stack
w
heh. I love how pulumi is helping me structure my thinking
b
you can append child resources to the resource you are fetching, since those child resources would be controlled by your stack. Like in AWS I could fetch a IAM Role and I could add policies to it, because the policies are treated as separate resources and not properties on the fetched resource