chilly-garage-80867
09/18/2020, 7:27 PMException: invocation of kubernetes:yaml:decode returned an error: error converting YAML to JSON: yaml: line 128: mapping values are not allowed in this context
broad-dog-22463
09/18/2020, 8:02 PMgorgeous-egg-16927
09/18/2020, 8:06 PMgorgeous-egg-16927
09/18/2020, 8:33 PMimport pulumi_kubernetes as k8s
# Omit a resource from the Chart by transforming the specified resource definition to an empty List.
def omit_namespace(obj, opts):
if obj["kind"] == "Namespace" and obj["metadata"]["name"] == "istio-system":
obj["apiVersion"] = "v1"
obj["kind"] = "List"
k8s.yaml.ConfigFile(
"istio-crd",
file="<https://raw.githubusercontent.com/knative-sandbox/net-istio/master/third_party/istio-stable/istio-crds.yaml>"
)
k8s.yaml.ConfigFile(
"istio-minimal",
file="<https://raw.githubusercontent.com/knative-sandbox/net-istio/master/third_party/istio-stable/istio-minimal.yaml>",
transformations=[omit_namespace]
)
$ pip3 freeze
pulumi==2.10.1
pulumi-kubernetes==2.6.1
chilly-garage-80867
09/18/2020, 8:52 PMgorgeous-egg-16927
09/18/2020, 8:58 PMistio-system
namespace is present in both manifests, so I omitted it from the second onechilly-garage-80867
09/18/2020, 9:16 PM## Omit Namespaces
def omit_istio_namespace(obj, opts):
if obj["kind"] == "Namespace" and obj["metadata"]["name"] == "istio-system":
obj["apiVersion"] = "v1"
obj["kind"] = "List"
# Istio
istio_crd = ConfigFile(
"istio_crd",
file="<https://raw.githubusercontent.com/knative-sandbox/net-istio/master/third_party/istio-stable/istio-crds.yaml>",
)
istio_minimal = ConfigFile(
"istio_minimal",
file="<https://raw.githubusercontent.com/knative-sandbox/net-istio/master/third_party/istio-stable/istio-minimal.yaml>",
opts=ResourceOptions(provider=k8s_provider),
transformations=[omit_istio_namespace],
)
Exception: invocation of kubernetes:yaml:decode returned an error: error converting YAML to JSON: yaml: line 128: mapping values are not allowed in this context
error: an unhandled error occurred: Program exited with non-zero exit code: 1
gorgeous-egg-16927
09/18/2020, 9:50 PMpulumi
and pulumi-kubernetes
?chilly-garage-80867
09/18/2020, 10:04 PM$ pulumi plugin ls
NAME KIND VERSION SIZE INSTALLED LAST USED
gcp resource 3.24.0 101 MB 22 hours ago 22 hours ago
gcp resource 3.23.0 100 MB 3 days ago 3 days ago
gcp resource 3.13.0 93 MB 2 months ago 2 months ago
gcp resource 3.11.0 92 MB 2 months ago 2 months ago
kubernetes resource 2.6.1 68 MB 22 hours ago 22 hours ago
random resource 2.3.1 42 MB 22 hours ago 22 hours ago
random resource 2.2.0 39 MB 2 months ago 2 months ago
random resource 1.7.0 38 MB 2 months ago 2 months ago
gorgeous-egg-16927
09/18/2020, 10:29 PMpip3 freeze
?chilly-garage-80867
09/18/2020, 10:54 PMgorgeous-egg-16927
09/18/2020, 11:05 PMchilly-garage-80867
09/18/2020, 11:37 PMgorgeous-egg-16927
09/18/2020, 11:40 PMchilly-garage-80867
09/18/2020, 11:43 PMgorgeous-egg-16927
09/21/2020, 4:00 PM