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
File "<string>", line 1
from imports.sample-controller.k8s.io import foo
^
SyntaxError: invalid syntax
Environment:
Framework Version:
0.25.0
OS: MacOS
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.
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 apython
app, this is invalid forimport
, making the resulting package unreachable from within thepython
code.Reproduction Steps:
version.yaml
file so that thegroup
issample-controller
instead ofsamplecontroller
cdk8s import version.yaml
tree imports
python -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: Bug Report