Hi all! Have a question about the `crd2pulumi` too...
# kubernetes
m
Hi all! Have a question about the
crd2pulumi
tool, but can’t seem to find a dedicated channel on that topic. Please let me know if there’s somewhere better to post this q! I’m trying to generate Typescript code for multiple CRDs from the same project. Specifically, I’m trying to generate code for Traefik’s
IngressRoute
and
Middleware
resources. 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 (see attached screenshot). I’m able to import and use the generated classes (yay!). However I see the following error when importing two classes in the same Pulumi program:
TypeError: Invalid Version:
The printed stack trace that points me to a line that reads
pulumi.runtime.registerResourceModule("crds", "<http://traefik.containo.us/v1alpha1|traefik.containo.us/v1alpha1>", _module)
. It looks like the version in each
package.json
is empty, but I’m finding it curious that this error only seems to occur when I try to import two different classes generated as described above. Wondering if there’s some sort of conflict since I’m registering the same resource module twice? Am I just missing how to generate code for multiple CRDs that belong in the same module? Thanks in advance for any advice here!
b
there are definite;y some bugs in crd2pulumi, please file issues as you find them
m
got it, thanks! will file this as an issue in the repo