crd2pulumi icon indicating copy to clipboard operation
crd2pulumi copied to clipboard

CRD schema object causing a panic

Open hanthor opened this issue 1 year ago • 1 comments

Threw a crazy long CRD at crd2pulumi and it error out like on https://github.com/pulumi/crd2pulumi/pull/135 Its a 5000 line CRD from https://github.com/element-hq/ess-starter-edition-core

 panic: fatal: error An assertion has failed: could not parse Pulumi package. source error: could not import spec: <nil>: #/types/kubernetes:matrix.element.io%2Fv1alpha1:ElementDeploymentSpecComponentsSynapseConfigMedia/properties/volume/default: type pulumi:pulumi:Any cannot have a constant value; only booleans, integers, numbers and strings may have constant values; , and 3 other diagnostic(s)

 properties:
   volume:
     default:
       name: media
       size: 2048
     description: The volume holding media
     oneOf:
     - not:
         required:
         - name
       required:
       - size
     - required:
       - name
       - size
     properties:
       name:
         description: The volume name to use to store the
           media
         type: string
       size:
         anyOf:
         - type: integer
         - type: string
         description: The volume size to use to store the
           media
         pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[MGTPE])?$
         x-kubernetes-int-or-string: true
     type: object
type: object

hanthor avatar Jul 15 '24 21:07 hanthor

Thanks for this example @hanthor!

We're currently working on some improvements to crd2pulumi which I expect will address this. Stay tuned!

cc @rquitales

blampe avatar Jul 22 '24 17:07 blampe

Added to epic https://github.com/pulumi/home/issues/3431

cleverguy25 avatar Aug 09 '24 17:08 cleverguy25

This issue has been addressed in PR #143 and shipped in release v1.5.0.

pulumi-bot avatar Oct 14 '24 20:10 pulumi-bot