Hi I'm working with pulumi python, after using `k8...
# general
c
Hi I'm working with pulumi python, after using
k8s.yaml.ConfigFile
and
k8s.yaml.ConfigGroup
for a few months with no issues, I'm currently seeing an issue when previewing a new stack with these elements. this is a stuck trace.
Copy code
error: Traceback (most recent call last):
      File "/nix/store/4a6xm29r8fpn80ipkqyqhn31mhh7pai6-pulumi-3.32.1/bin/pulumi-language-python-exec", line 107, in <module>
        loop.run_until_complete(coro)
      File "/nix/store/328bxidfhv01x138sjynkzswiskrk1yd-python3-3.9.12/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete
        return future.result()
      File "/nix/store/s6zf9dbdk4b9cajc6plcw72gg8mgvybq-python3-3.9.12-env/lib/python3.9/site-packages/pulumi/runtime/stack.py", line 126, in run_in_stack
        await run_pulumi_func(lambda: Stack(func))
      File "/nix/store/s6zf9dbdk4b9cajc6plcw72gg8mgvybq-python3-3.9.12-env/lib/python3.9/site-packages/pulumi/runtime/stack.py", line 49, in run_pulumi_func
        func()
      File "/nix/store/s6zf9dbdk4b9cajc6plcw72gg8mgvybq-python3-3.9.12-env/lib/python3.9/site-packages/pulumi/runtime/stack.py", line 126, in <lambda>
        await run_pulumi_func(lambda: Stack(func))
      File "/nix/store/s6zf9dbdk4b9cajc6plcw72gg8mgvybq-python3-3.9.12-env/lib/python3.9/site-packages/pulumi/runtime/stack.py", line 149, in __init__
        func()
      File "/nix/store/4a6xm29r8fpn80ipkqyqhn31mhh7pai6-pulumi-3.32.1/bin/pulumi-language-python-exec", line 106, in <lambda>
        coro = pulumi.runtime.run_in_stack(lambda: runpy.run_path(args.PROGRAM, run_name='__main__'))
      File "/nix/store/328bxidfhv01x138sjynkzswiskrk1yd-python3-3.9.12/lib/python3.9/runpy.py", line 285, in run_path
        return _run_code(code, mod_globals, init_globals,
      File "/nix/store/328bxidfhv01x138sjynkzswiskrk1yd-python3-3.9.12/lib/python3.9/runpy.py", line 87, in _run_code
        exec(code, run_globals)
      File "/Users/uritwig/workspace/arnac/infra/pulumi/./__main__.py", line 19, in <module>
        managed_infra.deploy()
      File "/Users/uritwig/workspace/arnac/infra/pulumi/stacks/managed_infra.py", line 224, in deploy
        create_cluster(network)
      File "/Users/uritwig/workspace/arnac/infra/pulumi/stacks/managed_infra.py", line 195, in create_cluster
        cluster = Cluster(cluster_args)
      File "/Users/uritwig/workspace/arnac/infra/pulumi/components/cluster/cluster.py", line 112, in __init__
        self._create_enclave_smarter_device()
      File "/Users/uritwig/workspace/arnac/infra/pulumi/components/cluster/cluster.py", line 208, in _create_enclave_smarter_device
        self.smarter_device = k8s.yaml.ConfigFile(
      File "/nix/store/s6zf9dbdk4b9cajc6plcw72gg8mgvybq-python3-3.9.12-env/lib/python3.9/site-packages/pulumi_kubernetes/yaml/yaml.py", line 348, in __init__
        __ret__ = pulumi.runtime.invoke('kubernetes:yaml:decode', {'text': text}, invoke_opts).value['result']
    TypeError: 'NoneType' object is not subscriptable
    error: an unhandled error occurred: Program exited with non-zero exit code: 1
removing these elements removes the issue.I'm using pulumi 3.32.1 with this is the k8s pluging when running
pulumi plugin ls
Copy code
kubernetes                resource  3.20.3   78 MB   2 hours ago  2 hours ago
kubernetes                resource  3.20.2   78 MB   2 hours ago  2 hours ago
kubernetes                resource  3.19.0   79 MB   2 hours ago  2 hours ago
What can I do to fix this?
b
please file an issue
c
workaround
Copy code
self.k8s_provider = k8s.Provider(
            f"{self.resource_name}-kubeconf-provider",
            kubeconfig=None if pulumi.runtime.is_dry_run() else args.kubeconfig,
            opts=self.default_ops,
        )
found it here https://github.com/pulumi/pulumi-kubernetes/issues/2038
🙌 1