Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix!: respect hyphens in helm chart names #1666

Open
wants to merge 2 commits into
base: 2.x
Choose a base branch
from

Conversation

rassie
Copy link
Contributor

@rassie rassie commented Nov 21, 2023

From json2jsii 0.4.0 onwards, type name sanitization works correctly with kebab case, i.e. it no longer ignores hyphens, so that names like ingress-nginx, which previously have been previously converted to Ingressnginx, now get converted to IngressNginx, which is the expected behaviour for kebab case to pascal case conversion. However, cdk8s-cli's helm import has been additionally sanitizing hyphens in chart names, even though hyphens are valid characters in chart names, so that the change in json2jsii had no effect. This patch simplifies the helm importer's sanitization routine to not remove hyphens anymore, resulting in more correct class names.

This will be a breaking change for people using Helm charts with a hyphen in the name.

From `json2jsii` 0.4.0 onwards, type name sanitization works correctly with kebab case, i.e. it no longer ignores
hyphens, so that names like `ingress-nginx`, which previously have been previously converted to `Ingressnginx`, now get
converted to `IngressNginx`, which is the expected behaviour for kebab case to pascal case conversion. However,
`cdk8s-cli`'s helm import has been additionally sanitizing hyphens in chart names, even though hyphens are valid
characters in chart names, so that the change in `json2jsii` had no effect. This patch simplifies the helm importer's
sanitization routine to not remove hyphens anymore, resulting in more correct class names.

Signed-off-by: Nikolai Prokoschenko <nikolai.prokoschenko@kurzdigital.com>
@rassie
Copy link
Contributor Author

rassie commented Nov 21, 2023

cc @vinayak-kukreja, since you are the author of the original patch

@vinayak-kukreja
Copy link
Contributor

Hey @rassie, thank you for opening a contribution with us and apologies for the delay.

I am not sure if we can accept a breaking change. Probably would need to be behind some kind of feature flag. Let me consult the team and get back to you.

@shinebayar-g
Copy link
Contributor

shinebayar-g commented Dec 20, 2023

https://github.com/cdk8s-team/cdk8s-cli/pull/1737/files was a breaking change to the same effect.
v2.198.4...v2.198.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants