Hi guys, asked this in the python channel but I am...
# kubernetes
v
Hi guys, asked this in the python channel but I am having an issue ignoring the version of a helm chart. This is what I am trying that fails:
Copy code
rabbitmq_chart = Chart(
    'rabbitmq-chart',
    ChartOpts(
        resource_prefix=stack_name,
        chart='rabbitmq',
        version="8.16.2",
        fetch_opts={'repo': '<https://charts.bitnami.com/bitnami>'},
        values={},
    ),
    ResourceOptions(provider=k8s_provider, ignore_changes=['version'])
)
This is the error
Copy code
Traceback (most recent call last):
      File "/usr/local/Cellar/python@3.9/3.9.7/Frameworks/Python.framework/Versions/3.9/lib/python3.9/concurrent/futures/_base.py", line 329, in _invoke_callbacks
        callback(self)
      File "/usr/local/Cellar/python@3.9/3.9.7/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/futures.py", line 398, in _call_set_state
        dest_loop.call_soon_threadsafe(_set_state, destination, source)
      File "/usr/local/Cellar/python@3.9/3.9.7/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py", line 791, in call_soon_threadsafe
        self._check_closed()
      File "/usr/local/Cellar/python@3.9/3.9.7/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py", line 510, in _check_closed
        raise RuntimeError('Event loop is closed')
    RuntimeError: Event loop is closed

    error: Program failed with an unhandled exception:
    error: Traceback (most recent call last):
      File "/usr/local/bin/pulumi-language-python-exec", line 107, in <module>
        loop.run_until_complete(coro)
      File "/usr/local/Cellar/python@3.9/3.9.7/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
        return future.result()
      File "/Users/julian/virtuals/infrastructure/lib/python3.9/site-packages/pulumi/runtime/stack.py", line 126, in run_in_stack
        await run_pulumi_func(lambda: Stack(func))
      File "/Users/julian/virtuals/infrastructure/lib/python3.9/site-packages/pulumi/runtime/stack.py", line 51, in run_pulumi_func
        await wait_for_rpcs()
      File "/Users/julian/virtuals/infrastructure/lib/python3.9/site-packages/pulumi/runtime/stack.py", line 73, in wait_for_rpcs
        await RPC_MANAGER.rpcs.pop()
      File "/Users/julian/virtuals/infrastructure/lib/python3.9/site-packages/pulumi/runtime/rpc_manager.py", line 68, in rpc_wrapper
        result = await rpc
      File "/Users/julian/virtuals/infrastructure/lib/python3.9/site-packages/pulumi/runtime/resource.py", line 685, in do_register_resource_outputs
        serialized_props = await rpc.serialize_properties(outputs, {})
      File "/Users/julian/virtuals/infrastructure/lib/python3.9/site-packages/pulumi/runtime/rpc.py", line 172, in serialize_properties
        result = await serialize_property(
      File "/Users/julian/virtuals/infrastructure/lib/python3.9/site-packages/pulumi/runtime/rpc.py", line 343, in serialize_property
        value = await serialize_property(
      File "/Users/julian/virtuals/infrastructure/lib/python3.9/site-packages/pulumi/runtime/rpc.py", line 326, in serialize_property
        future_return = await asyncio.ensure_future(awaitable)
      File "/Users/julian/virtuals/infrastructure/lib/python3.9/site-packages/pulumi/output.py", line 169, in run
        value = await self._future
      File "/Users/julian/virtuals/infrastructure/lib/python3.9/site-packages/pulumi/output.py", line 123, in get_value
        val = await self._future
      File "/Users/julian/virtuals/infrastructure/lib/python3.9/site-packages/pulumi/output.py", line 206, in run
        return await transformed.future(with_unknowns=True)
      File "/Users/julian/virtuals/infrastructure/lib/python3.9/site-packages/pulumi/output.py", line 123, in get_value
        val = await self._future
      File "/Users/julian/virtuals/infrastructure/lib/python3.9/site-packages/pulumi/output.py", line 169, in run
        value = await self._future
      File "/Users/julian/virtuals/infrastructure/lib/python3.9/site-packages/pulumi/output.py", line 194, in run
        transformed: Input[U] = func(value)
      File "/Users/julian/virtuals/infrastructure/lib/python3.9/site-packages/pulumi_kubernetes/helm/v3/helm.py", line 598, in <lambda>
        objects = json_opts.apply(lambda x: pulumi.runtime.invoke('kubernetes:helm:template',
      File "/Users/julian/virtuals/infrastructure/lib/python3.9/site-packages/pulumi/runtime/invoke.py", line 166, in invoke
        raise invoke_error
    Exception: invoke of kubernetes:helm:template failed: invocation of kubernetes:helm:template returned an error: failed to generate YAML for specified Helm chart: failed to pull chart: chart "rabbitmq" version "8.16.2" not found in <https://charts.bitnami.com/bitnami> repository
    error: an unhandled error occurred: Program exited with non-zero exit code: 1
I have also tried this transformation that does not work:
Copy code
def transformation(args: ResourceTransformationArgs):
    if args.type_ == "kubernetes:helm:template":
        return ResourceTransformationResult(
            props=args.props,
            opts=ResourceOptions.merge(args.opts, ResourceOptions(
                ignore_changes=["ChartOpts"],
            )))
it looks like bitnami no longer supports that version of rabbitmq and trying to ignore version parameter on the resource.
Any ideas?
I am still interested in how to do this but I found out the issue.
This will be an issue for anyone using bitnami and the Chart resource with a version that came out before 2022.
s
You could try one of the changes in this PR: https://github.com/pulumi/pulumi-kubernetes/pull/2004/files This is following a change from bitnami which removed older versions of charts from the index
v
yes.
Thanks.
s
So specifically you want to use the following as your repository URL instead: `
Copy code
<https://raw.githubusercontent.com/bitnami/charts/eb5f9a9513d987b519f0ecd732e7031241c50328/bitnami>
v
Yah, read it in the above issue. Thanks again!