You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
TypeError: Invalid Version:
at new SemVer (/Users/blaisebradley/Code/rollout-embedded-poc/node_modules/@pulumi/pulumi/node_modules/semver/semver.js:332:11)
at compare (/Users/blaisebradley/Code/rollout-embedded-poc/node_modules/@pulumi/pulumi/node_modules/semver/semver.js:647:10)
at Object.eq (/Users/blaisebradley/Code/rollout-embedded-poc/node_modules/@pulumi/pulumi/node_modules/semver/semver.js:693:10)
at sameVersion (/Users/blaisebradley/Code/rollout-embedded-poc/node_modules/@pulumi/runtime/rpc.ts:701:57)
at register (/Users/blaisebradley/Code/rollout-embedded-poc/node_modules/@pulumi/runtime/rpc.ts:716:17)
at Object.registerResourceModule (/Users/blaisebradley/Code/rollout-embedded-poc/node_modules/@pulumi/runtime/rpc.ts:810:5)
at Object.<anonymous> (/Users/blaisebradley/Code/rollout-embedded-poc/pulumi-crd/helm/middlewares/traefik/v1alpha1/index.ts:25:16)
at Module._compile (node:internal/modules/cjs/loader:1159:14)
at Module.m._compile (/Users/blaisebradley/Code/rollout-embedded-poc/node_modules/@pulumi/pulumi/node_modules/ts-node/src/index.ts:439:23)
at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
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.
Put the generated code in sibling directories. A screenshot of my directory structure is below:
Import both classes in the same Pulumi program:
import { IngressRoute as TraefikIngressRoute } from "../pulumi-crd/traefik/ingress-route/traefik/v1alpha1";
import { Middleware as TraefikMiddleware } from "../pulumi-crd/traefik/middlewares/traefik/v1alpha1";
CLI
Version 3.60.1
Go Version go1.20.2
Go Compiler gc
Plugins
NAME VERSION
nodejs unknown
random 4.12.1
Host
OS darwin
Version 12.4
Arch arm64
This project is written in nodejs: executable='/Users/blaisebradley/.nvm/versions/node/v18.12.1/bin/node' version='v18.12.1'
Backend
Name pulumi.com
URL https://app.pulumi.com/blaiseb
User blaiseb
Organizations blaiseb, rollout
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).
The text was updated successfully, but these errors were encountered:
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.
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:
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).
The text was updated successfully, but these errors were encountered: