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

Pascal-cased Helm values do not work #2213

Open
rassie opened this issue Oct 7, 2024 · 2 comments
Open

Pascal-cased Helm values do not work #2213

rassie opened this issue Oct 7, 2024 · 2 comments
Labels
bug Something isn't working @component/cdk8s-cli Issue related to cdk8s-cli effort/medium 1 week tops priority/p1 Should be on near term plans

Comments

@rassie
Copy link

rassie commented Oct 7, 2024

Description of the bug:

When a chart is using Pascal-cased values keys, cdk8s generates a camel-cased property which does not work when applied to the chart.

Reproduction Steps:

  • Import helm:https://SonarSource.github.io/helm-chart-sonarqube/[email protected]+3598
  • Compare YAML output of two following chart declarations. You'll notice that OpenShift options described in the Helm chart do not activate when cdk8s-generated type declaration is used.

Non-working:

        new Sonarqube(this, "sonarqube", {
            values: {
                replicaCount: SonarqubeReplicaCount.VALUE_1,
                openShift: {
                    additionalValues: {
                        enabled: true,
                    },
                },
            },
        });

Working:

        new Sonarqube(this, "sonarqube", {
            values: {
                replicaCount: SonarqubeReplicaCount.VALUE_1,
                additionalValues: {
                    OpenShift: {
                        enabled: true,
                    },
                },
            },
        });

NB: I've not tested this extensively, so that root cause can be different, including my own stupidity.


This is 🐛 Bug Report

@rassie rassie added bug Something isn't working needs-triage Priority and effort undetermined yet labels Oct 7, 2024
@bdoyle0182
Copy link

seems valid issue to me after taking a quick glance at the chart generated import in typescript. If the generated schema value variable names don't map identically you're going to have to specify them in additionalValues manually. If doing a helm import, it probably doesn't make sense to do any variable name mutation to a case type; or store a mapping of the variable name to the actual helm key string to keep things pretty and use that mapping on generation?

@iliapolo
Copy link
Member

iliapolo commented Dec 9, 2024

Legit. We should be able to store original casing and encode it within the toJson_XXX functions of the generated code. (i'm kind of surprised it doesn't already do that...need to check why)

@iliapolo iliapolo added priority/p1 Should be on near term plans effort/medium 1 week tops @component/cdk8s-cli Issue related to cdk8s-cli and removed needs-triage Priority and effort undetermined yet labels Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working @component/cdk8s-cli Issue related to cdk8s-cli effort/medium 1 week tops priority/p1 Should be on near term plans
Projects
None yet
Development

No branches or pull requests

3 participants