-
Notifications
You must be signed in to change notification settings - Fork 528
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
feat (jkube-kit/resource) : Add toggle to preserve HelmParameter case #2369
feat (jkube-kit/resource) : Add toggle to preserve HelmParameter case #2369
Conversation
Eclipse JKube CI ReportStarted new GH workflow run for #2369 (2023-09-22T09:45:35Z) ⚙️ JKube E2E Tests (6272503804)
|
Codecov Report
@@ Coverage Diff @@
## master #2369 +/- ##
============================================
+ Coverage 59.36% 61.08% +1.72%
- Complexity 4586 4775 +189
============================================
Files 500 518 +18
Lines 21211 21387 +176
Branches 2830 2825 -5
============================================
+ Hits 12591 13064 +473
+ Misses 7370 7101 -269
+ Partials 1250 1222 -28
... and 63 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
29817d0
to
e9755b1
Compare
@@ -167,6 +171,10 @@ Defaults to empty string. | |||
The parameters can also represent a Golang expression | |||
| | |||
|
|||
| preserveParameterCase | |||
| A boolean toggling whether the parameter case is preserved when generating the Values.yaml file, off by default |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, would be better to write default value just like other fields.
| A boolean toggling whether the parameter case is preserved when generating the Values.yaml file, off by default | |
| A boolean toggling whether the parameter case is preserved when generating the Values.yaml file | |
Defaults to `false` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
import java.util.Collections; | ||
import java.util.Map; | ||
import java.util.Properties; | ||
import java.util.*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please revert to individual imports instead of wildcards?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
helmConfig.setApiVersion("v2"); | ||
|
||
File file = File.createTempFile("api-version-test", ".tmp"); | ||
file.deleteOnExit(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the significance of creating this file in the scope of this test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leftover that I missed, removed it.
helmConfig.setPreserveParameterCase(true); | ||
|
||
File file = File.createTempFile("case-preservation-test", ".tmp"); | ||
file.deleteOnExit(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even When I comment out these file creation lines, tests seem to pass. Could this possibly be a leftover?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure is, I've removed it.
@@ -140,6 +140,36 @@ void deserialize() throws Exception { | |||
.toBuilder().name("ngnix").version("1.2.3").repository("https://example.com/charts").build())); | |||
} | |||
|
|||
@Test | |||
void canEnableCasePresevation() throws IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
void canEnableCasePresevation() throws IOException { | |
void canEnableCasePreservation() throws IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
@@ -83,7 +83,7 @@ public HelmService(JKubeConfiguration jKubeConfiguration, ResourceServiceConfig | |||
this.logger = logger; | |||
} | |||
|
|||
/** | |||
/**∂ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/**∂ | |
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
return parameter.getName(); | ||
} else { | ||
return parameter.getName().toLowerCase(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This just my opinion, but we should try to use original method here:
public String getHelmName(final boolean preserveCase) {
if (preserveCase) {
return parameter.getName();
}
return getHelmName();
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switched to use the original method as suggested.
e9755b1
to
ee410c7
Compare
587168d
to
73ac8fa
Compare
Looking at the test failures it looks like a ssh connectivity failure, is there anything I need to do on my end? Tests were passing before I rebased to address a merge conflict in the changelog. |
hello @manusa do you remember the reason why the HelmParameters were turned to lowercase ? |
No, I haven't approved the PR yet because I want to check it out and see if I can remember why this was done in the first place. |
Adds preserveParameterCase to HelmConfig to allow opting in to preserve HelmParameter case in Values.yaml. Adds apiVersion to HelmConfig to allow specifying chart schema version. Signed-off-by: bryopsida <8363252+bryopsida@users.noreply.github.com>
73ac8fa
to
c3824db
Compare
Signed-off-by: Marc Nuri <marc@marcnuri.com>
c3824db
to
58bb4f4
Compare
Signed-off-by: Marc Nuri <marc@marcnuri.com>
069cfde
to
fae04b3
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs 100.0% Coverage The version of Java (11.0.18) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17. |
Description
Adds preserveParameterCase to HelmConfig to allow opting in to preserve HelmParameter case in Values.yaml.
Adds apiVersion to HelmConfig to allow specifying chart schema version.
Fixes #2356
Type of change
test, version modification, documentation, etc.)
Checklist