Description of the bug:
When running cdk8s import against a CRD whose custom resource group name contains dash characters (-), the resulting directory structure also contains dashes in the directory names. For a python app, this is invalid for import, making the resulting package unreachable from within the python code.
Reproduction Steps:
-
In the crd example, update the version.yaml file so that the group is sample-controller instead of samplecontroller
-
Run cdk8s import version.yaml
-
tree imports
imports/
└── sample-controller
└── k8s
└── io
└── foo
├── __init__.py
├── _jsii
│ ├── __init__.py
│ └── generated@0.0.0.jsii.tgz
└── py.typed
5 directories, 4 files
-
python -c 'from imports.sample-controller.k8s.io import foo'
Error Log:
File "<string>", line 1
from imports.sample-controller.k8s.io import foo
^
SyntaxError: invalid syntax
Environment:
Other:
I'm fairly certain I have a fix, but I haven't gotten the test env set up and have been distracted with other items this morning. I think that this section needs to do a replace of - with _. I'll keep this ticket up to date with anything else I find while testing.
This is 🐛 Bug Report
Description of the bug:
When running
cdk8s importagainst a CRD whose custom resource group name contains dash characters (-), the resulting directory structure also contains dashes in the directory names. For apythonapp, this is invalid forimport, making the resulting package unreachable from within thepythoncode.Reproduction Steps:
In the crd example, update the
version.yamlfile so that thegroupissample-controllerinstead ofsamplecontrollerRun
cdk8s import version.yamltree importspython -c 'from imports.sample-controller.k8s.io import foo'Error Log:
Environment:
Other:
I'm fairly certain I have a fix, but I haven't gotten the test env set up and have been distracted with other items this morning. I think that this section needs to do a replace of
-with_. I'll keep this ticket up to date with anything else I find while testing.This is 🐛 Bug Report