Wrong python code generated for arbitrary string -> object mapping fields #163
Labels
area/codegen
Affects quality or correctness of generated code
kind/bug
Some behavior is incorrect or out of spec
What happened?
The generated python code is syntactically correct but doesn't match the CRD and the resource is rejected by the Kubernetes API server.
The problem happens in this CRD https://github.com/red-hat-storage/ocs-operator/blob/release-4.16/deploy/ocs-operator/manifests/storagecluster.crd.yaml#L3895 for the spec.resources element starting in line 3895.
Example
The yaml for the resource element:
Generated python for this element:
resources: Optional[pulumi.Input[Mapping[str, pulumi.Input[Mapping[str, pulumi.Input[str]]]]]] = None,
This should be something like
resources: Optional[pulumi.Input[Mapping[str, pulumi.Input[Mapping[str, pulumi.Input[Mapping[str, pulumi.Input[str]]]]]]]] = None,
or even better:
resources: Optional[pulumi.Input[Mapping[str, pulumi.Input[StorageClusterSpecResourcesArgs]]]] = None,
Output of
pulumi about
crd2pulumi version v1.5.4
Additional context
I'm pretty sure this worked in earlier versions of crd2pulumi.
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: