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

Do not camel case properties in the generated Helm manifests #1121

Merged
merged 1 commit into from
Jan 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ private String deductProperty(HelmChartConfig helmConfig, String property) {
property = helmConfig.getValuesRootAlias() + "." + property;
}

return Strings.kebabToCamelCase(property);
return property;
}

private Map<String, Object> mergeWithFileIfExists(Path inputDir, String file, Map<String, Object> data) {
Expand Down Expand Up @@ -520,8 +520,7 @@ private List<Map<Object, Object>> replaceValuesInYamls(HelmChartConfig helmConfi
Map<String, Object> seen = new HashMap<>();

for (ConfigReference valueReference : valuesReferences) {
String valueReferenceProperty = Strings
.kebabToCamelCase(helmConfig.getValuesRootAlias() + "." + valueReference.getProperty());
String valueReferenceProperty = helmConfig.getValuesRootAlias() + "." + valueReference.getProperty();

if (seen.containsKey(valueReference.getProperty())) {
if (Strings.isNotNullOrEmpty(valueReference.getProfile())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public void valuesShouldContainExpectedData() throws IOException {
// Should NOT contain not-found: as this property is ignored
assertNull(helmExampleValues.get("not-found"));
// Should contain vcs-url with the overridden value from properties
assertEquals("Overridden", helmExampleValues.get("vcsUrl"));
assertEquals("Overridden", helmExampleValues.get("vcs-url"));
// Should include health check properties:
// 1. tcp socket action
Map<String, Object> livenessValues = (Map<String, Object>) helmExampleValues.get("livenessProbe");
Expand Down Expand Up @@ -150,7 +150,7 @@ public void valuesShouldContainExpectedDataInDevProfile() throws IOException {
// Should NOT contain not-found: as this property is ignored
assertNull(helmExampleValues.get("not-found"));
// Should contain vcs-url with the value from properties
assertEquals("Only for DEV!", helmExampleValues.get("vcsUrl"));
assertEquals("Only for DEV!", helmExampleValues.get("vcs-url"));
// Should contain ingress with the value from properties
assertEquals("my-test-host", helmExampleValues.get("host"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@ public void valuesShouldContainExpectedData() throws IOException {
Map<String, Object> helmExampleValues = (Map<String, Object>) values.get(ROOT_CONFIG_NAME);

// Should contain s2i configuration
assertNotNull(helmExampleValues.get("s2iJava"));
assertEquals("fabric8/s2i-java", ((Map<String, Object>) helmExampleValues.get("s2iJava")).get("builderImage"));
assertNotNull(helmExampleValues.get("s2i-java"));
assertEquals("fabric8/s2i-java", ((Map<String, Object>) helmExampleValues.get("s2i-java")).get("builder-image"));
// Should contain replicas
assertEquals(3, helmExampleValues.get("replicas"));
// Should NOT contain not-found: as this property is ignored
assertNull(helmExampleValues.get("not-found"));
// Should contain vcs-url with the overridden value from properties
assertEquals("Overridden", helmExampleValues.get("vcsUrl"));
assertEquals("Overridden", helmExampleValues.get("vcs-url"));
}

@Test
Expand All @@ -87,13 +87,13 @@ public void valuesShouldContainExpectedDataInDevProfile() throws IOException {
Map<String, Object> helmExampleValues = (Map<String, Object>) values.get(ROOT_CONFIG_NAME);

// Should contain s2i configuration
assertNotNull(helmExampleValues.get("s2iJava"));
assertEquals("fabric8/s2i-java", ((Map<String, Object>) helmExampleValues.get("s2iJava")).get("builderImage"));
assertNotNull(helmExampleValues.get("s2i-java"));
assertEquals("fabric8/s2i-java", ((Map<String, Object>) helmExampleValues.get("s2i-java")).get("builder-image"));
// Should contain replicas
assertEquals(3, helmExampleValues.get("replicas"));
// Should NOT contain not-found: as this property is ignored
assertNull(helmExampleValues.get("not-found"));
// Should contain vcs-url with the value from properties
assertEquals("Only for DEV!", helmExampleValues.get("vcsUrl"));
assertEquals("Only for DEV!", helmExampleValues.get("vcs-url"));
}
}