https://pulumi.com logo
Title
h

handsome-state-59775

04/04/2021, 9:16 AM
how can i prevent auto-naming for created namespaces? tried to follow links via FAQ, but haven't been able to figure it out yet with python, azure-native, pulumi_kubernetes:
1
k8s.core.v1.Namespace(
        resource_name=name,  # NEED TO HAVE THIS AS IT IS
        opts=p.ResourceOptions(
            provider=k8s_provider,  # via kubeconfig from AKS ManagedCluster output
            delete_before_replace=True,
            parent=aks,
        ),
    )
... by setting:
k8s.core.v1.Namespace(
...
        metadata=k8s.meta.v1.ObjectMetaArgs(
            name=name,
        ),
...
)
c

cool-fireman-90027

04/05/2021, 1:56 PM
You could do something like this
h

handsome-state-59775

04/05/2021, 2:02 PM
just to confirm - you mean setting metadata.name explicitly, right?
c

cool-fireman-90027

04/05/2021, 2:05 PM
correct, cause you are running into this.
👍 1
h

handsome-state-59775

04/05/2021, 2:24 PM
got it, thanks! that's how i fixed it (second snippet that i added above for posterity)