March 9, 2023, 9:27pm
Hello! I am attempting to configure some properties for sonarqube via the
sonarProperties helm chart key, but it seems that the chart is failing to flatten the hashmap for the nested keys. When I shell into the running SonarQube container and cat the
/opt/sonarqube/conf/sonar.properties file I see this instead:
sonar=map[governance:map[report:map[project:map[branch:map[frequency:Daily]] view:map[frequency:Daily recipients:email@example.com]]] scim:map[enabled:true]]
helm get all sonarqube-test I see the keys and hash structure:
Helm Chart 8.0.0_463
SonarQube 22.214.171.124466 Enterprise Edition
Helm Client Version v3.10.0
(G Ann Campbell)
March 10, 2023, 6:20pm
There are things you can set via properties and things that should be set via the UI. Don’t worry, that latter category is stored in the DB, so it’s not ephemeral.
These frequencies are in the latter category and I suppose you’re seeing the strange hashmap behavior because it wasn’t intended to work the way you’re trying to set this up.
March 10, 2023, 7:21pm
I want to do it this was so we can configure and manage my deployments as code.
(G Ann Campbell)
March 10, 2023, 8:02pm
Yeah, I get that. You’re not the first. SonarQube isn’t built that way.
It’s built to be spun up, configured and then… occasionally upgraded. With no real need for ongoing management of deployments.
March 11, 2023, 1:47am
I fixed this issue and opened a PR.
01:46AM - 11 Mar 23 UTC
This adds a helper to flatten sonarProperties dictionary so that the key is form
… atted properly. Without this helper the values for nested keys get improperly strigified as things like this:
This joins the strings with dots as expected and sets the values correctly.
Please ensure your pull request adheres to the following guidelines:
- [x] explain your motives to contribute this change: what problem you are trying to fix, what improvement you are trying to make
- [ ] Document your Changes in the `CHANGELOG.md` file of the respected chart as well as the `Chart.yaml`
- [ ] Bump the Version number of the respected chart
I haven’t tested to see what it will do if the sonarProperties is empty/null yet… but this seems to work for my intended use case.
March 11, 2023, 1:53am
Ah, yep… there is a bug I need to fix for the null case.
March 20, 2023, 8:32am
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.