RyanH
(Ryan Hass)
March 9, 2023, 9:27pm
1
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:redacted-user@redacted-domain.com]]] scim:map[enabled:true]]
Looking at helm get all sonarqube-test
I see the keys and hash structure:
sonarProperties:
sonar:
governance:
report:
project:
branch:
frequency: Daily
view:
frequency: Daily
recipients: redacted-user@redacted-domain.com
scim:
enabled: true
Versions:
Helm Chart 8.0.0_463
SonarQube 9.9.0.65466 Enterprise Edition
Helm Client Version v3.10.0
1 Like
ganncamp
(G Ann Campbell)
March 10, 2023, 6:20pm
2
Hi,
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.
Â
HTH,
Ann
1 Like
RyanH
(Ryan Hass)
March 10, 2023, 7:21pm
3
I want to do it this was so we can configure and manage my deployments as code.
ganncamp
(G Ann Campbell)
March 10, 2023, 8:02pm
4
Hi,
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.
Â
Ann
1 Like
RyanH
(Ryan Hass)
March 11, 2023, 1:47am
6
I fixed this issue and opened a PR.
SonarSource:master
â rhass:flatten-sonarPropeties-hash
opened 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:
```
sonar=map[governance:map[report:map[project:map[branch:map[frequency:Daily]]
```
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.
2 Likes
RyanH
(Ryan Hass)
March 11, 2023, 1:53am
7
Ah, yep⌠there is a bug I need to fix for the null case.
1 Like
system
(system)
Closed
March 20, 2023, 8:32am
9
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.