https://pulumi.com logo
#kubernetes
Title
# kubernetes
p

polite-rain-7632

11/11/2020, 7:23 PM
Hey all, is there a recommended approach for adding a label to an already existing namespace "default" (using Go), was looking quickly at the SDK and it seemed to be limited to newly created namespaces only, and testing it quickly confirmed it.
Copy code
_, err = k8s.NewNamespace(ctx, "default", &k8s.NamespaceArgs{
		Metadata: &meta.ObjectMetaArgs{
			Labels: pulumi.StringMap{"foo": pulumi.String("bar")},
		},
	}, pulumi.Provider(input.K8sProvider))
	if err != nil {
		return err
	}
b

billowy-army-68599

11/11/2020, 7:36 PM
is importing the namespace an option? in that case you can just add it that way
p

polite-rain-7632

11/11/2020, 7:42 PM
ideally, I would like to keep this fully managed but can do an import as a workaround in the mean time. 👍
b

billowy-army-68599

11/11/2020, 8:03 PM
if you don't want to import, the kubernetes go-sdk is probably your best bet (not the pulumi kubernetes one)
p

polite-rain-7632

11/11/2020, 8:12 PM
👍
4 Views