Skip to content

Invalid typescript code produced when generating for strimzi crds  #103

@maxemann96

Description

@maxemann96

What happened?

The following invalid typescript code is produced (Stripped the other invalid generated code as the error is always the same).

export interface KafkaConnectSpecJvmoptions {
      /**
       * A map of -XX options to the JVM.
       */
      -XX?: { [key: string]: any };
      /**
       * -Xms option to to the JVM.
       */
      -Xms?: string;
      /**
       * -Xmx option to to the JVM.
       */
      -Xmx?: string;
      /**
       * Specifies whether the Garbage Collection logging is enabled. The default is false.
       */
      gcLoggingEnabled?: boolean;
      /**
       * A map of additional system properties which will be passed using the `-D` option to the JVM.
       */
      javaSystemProperties?: outputs.kafka.v1beta2.KafkaConnectSpecJvmoptionsJavasystemproperties[];
    }

Steps to reproduce

Get the strimzi crds and generate the typescript code for example with crd2pulumi --nodejs --nodejsPath=crds/nodejs/ crds/k8s/*.yaml. The following excerpt automatically downloads the crds:

mkdir -p crds/k8s/
pushd crds/k8s/
curl --fail --remote-name -sSL https://raw.githubusercontent.com/strimzi/strimzi-kafka-operator/main/helm-charts/helm3/strimzi-kafka-operator/crds/\{040-Crd-kafka,041-Crd-kafkaconnect,042-Crd-strimzipodset,043-Crd-kafkatopic,044-Crd-kafkauser,045-Crd-kafkamirrormaker,046-Crd-kafkabridge,047-Crd-kafkaconnector,048-Crd-kafkamirrormaker2,048-Crd-kafkamirrormaker2,049-Crd-kafkarebalance\}.yaml
popd

Expected Behavior

Valid typescript code

Actual Behavior

Invalid typescript code

Output of pulumi about

CLI          
Version      3.43.1
Go Version   go1.19.2
Go Compiler  gc

Plugins
NAME    VERSION
nodejs  unknown

Host     
OS       darwin
Version  11.7
Arch     x86_64

This project is written in nodejs: executable='/usr/local/bin/node' version='v18.11.0'

Current Stack: [REDACTED]

TYPE                                                         URN
[STRIPPED]


Found no pending operations associated with [REDACTED]

Backend        
Name           pulumi.com
URL            https://app.pulumi.com/maxemann96
User           maxemann96
Organizations  maxemann96, [REDACTED]

Pulumi locates its logs in /var/folders/3p/6t2fzpvj3g7gj3jtgqm4yt080000gn/T/ by default
warning: Failed to get information about the Pulumi program's dependencies: Could not find either /[REDACTED]/yarn.lock or /[REDACTED]/package-lock.json

The warning can be ignored since it is a npm workspace setup.

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).

Metadata

Metadata

Assignees

Labels

area/codegenAffects quality or correctness of generated codearea/schemaRelated to support for CRD or Pulumi schema supportimpact/accessibilitySomething that is difficult or impossible for some people to usekind/bugSome behavior is incorrect or out of spec

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions