Use random namespace for py-provider example for test parallelism
-# Copyright 2016-2018, Pulumi Corporation.
+# Copyright 2016-2019, Pulumi Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# See the License for the specific language governing permissions and
# limitations under the License.
from os import path
+
from pulumi import ResourceOptions
from pulumi_kubernetes import Provider
-from pulumi_kubernetes.core.v1 import Pod
+from pulumi_kubernetes.core.v1 import Pod, Namespace
kubeconfig_file = path.join(path.expanduser("~"), ".kube", "config")
with open(kubeconfig_file) as f:
kubeconfig = f.read()
my_k8s = Provider("myk8s", kubeconfig=kubeconfig)
-nginx = Pod("nginx", spec={
+
+namespace = Namespace("test")
+
+nginx = Pod(
+ "nginx",
+ metadata={
+ "namespace": namespace,
+ },
+ spec={
"containers": [{
"image": "nginx:1.7.9",
"name": "nginx",
