cdk8s-team / cdk8s

Define Kubernetes native apps and abstractions using object-oriented programming
https://cdk8s.io
Apache License 2.0
4.29k stars 290 forks source link

Java Issue Importing Jenkins CRD #234

Closed campionfellin closed 4 years ago

campionfellin commented 4 years ago

Description of the bug:

I'm trying to import this CRD: https://raw.githubusercontent.com/jenkinsci/kubernetes-operator/master/deploy/crds/jenkins.io_jenkins_crd.yaml

But the Java package name ends up as jenkins.io/jenkins which is invalid.

Reproduction Steps:

cdk8s import -l java https://raw.githubusercontent.com/jenkinsci/kubernetes-operator/master/deploy/crds/jenkins.io_jenkins_crd.yaml

Error Log:

No error. This is where we should look at fixing:

https://github.com/awslabs/cdk8s/blob/b1fa11d6062dc5008e4e263cf556695a64ae88ad/packages/cdk8s-cli/lib/import/crd.ts#L73-L75

Environment:

Other:


This is :bug: Bug Report

eladb commented 4 years ago

I think the fix should be in the java import code path. moduleName is "agnostic" and each language should mangle it based on its constraints.