Closed blaise-bradley closed 1 month ago
Hi @blaise-bradley. Thanks for raising the issue.
As a work-around, I think you can change one of the generated packages to have a different name. This way Pulumi can distinguish between them and won't error because two modules with the same name and version were registered at the same time.
crd2pulumi
wasn't design to generate side-by-side compatible packages. We will consider that for the future.
Added to epic https://github.com/pulumi/home/issues/3431
crd2pulumi
allows you to generate a single package from multiple input files. Usage example: crd2pulumi --go file1.yaml file2.yaml
.
This issue has been addressed in PR #143 and shipped in release v1.5.0.
What happened?
I’m trying to generate code for the IngressRoute and Middleware CRDs from the Traefik Helm Chart. Based on the usage described in the README, it seems like you can only point crd2pulumi to a single file. My approach has been to generate code for each CRD yml file and then move the generated code into separate directories. If I import just one of the generated classes, my program works as expected. When I import both of the generated classes into the same Pulumi program, the planning step fails with the following error:
My best guess is that there is some kind of conflict since we are trying to register the "resource module"
traefik.containo.us/v1alpha1
twice with the same version number.Expected Behavior
It's possible to import and use both classes in the same program.
Steps to reproduce
Run
crd2pulumi
against two Traefik CRD files such as ingressroute.yaml and middlewares.yaml.Put the generated code in sibling directories. A screenshot of my directory structure is below:
Import both classes in the same Pulumi program:
Attempt to create an instance of each resource:
Output of
pulumi about
Additional context
No response
Contributing
Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).