Skip to content

Commit

Permalink
SONAR-23627 fix small typo and add fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
jCOTINEAU committed Nov 15, 2024
1 parent dec709b commit 55ba5c2
Show file tree
Hide file tree
Showing 62 changed files with 1,546 additions and 1,080 deletions.
3 changes: 1 addition & 2 deletions charts/sonarqube-dce/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,11 @@ annotations:
- kind: added
description: "Support Gateway on different namespace in HTTPRoute"
- kind: changed
description: "Ensure the Pod will stop at "init" stage if init_sysctl.sh failed to modify kernel parameters"
description: "Ensure that ConfigMap resources are not created for `initFS` and `initSysctl` if not needed"
- kind: changed
description: "Ensure the Pod will stop at `init` stage if init_sysctl.sh failed to modify kernel parameters"
- kind: changed
description: "Replace the example images in initContainers, initSysctl and initFs from `busybox:1.36` to `ubuntu:24.04`, which are commented out by default"
description: "Replace the example images in initContainers, initSysctl and initFs from 'busybox:1.36' to 'ubuntu:24.04', which are commented out by default"
artifacthub.io/links: |
- name: support
url: https://community.sonarsource.com/
Expand Down
2 changes: 1 addition & 1 deletion charts/sonarqube-dce/templates/init-sysctl.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.initSysctl.enabled }}
{{- if and .Values.initSysctl.enabled (not .Values.OpenShift.enabled) }}
apiVersion: v1
kind: ConfigMap
metadata:
Expand Down
2 changes: 1 addition & 1 deletion charts/sonarqube/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ annotations:
- kind: changed
description: "Ensure the Pod will stop at `init` stage if init_sysctl.sh failed to modify kernel parameters"
- kind: changed
description: "Replace the example images in initContainers, initSysctl and initFs from `busybox:1.36` to `ubuntu:24.04`, which are commented out by default"
description: "Replace the example images in initContainers, initSysctl and initFs from 'busybox:1.36' to 'ubuntu:24.04', which are commented out by default"
artifacthub.io/containsSecurityUpdates: "false"
artifacthub.io/images: |
- name: sonarqube
Expand Down
2 changes: 1 addition & 1 deletion charts/sonarqube/templates/init-sysctl.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.initSysctl.enabled }}
{{- if and .Values.initSysctl.enabled (not .Values.OpenShift.enabled) }}
apiVersion: v1
kind: ConfigMap
metadata:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,22 +152,38 @@ metadata:
heritage: Helm
data:
init_sysctl.sh: |-
if [[ "$(sysctl -n vm.max_map_count)" -lt 524288 ]]; then
sysctl -w vm.max_map_count=524288
set -o errexit
set -o xtrace
vmMaxMapCount=524288
if [[ "$(sysctl -n vm.max_map_count)" -lt $vmMaxMapCount ]]; then
sysctl -w vm.max_map_count=$vmMaxMapCount
if [[ "$(sysctl -n vm.max_map_count)" -lt $vmMaxMapCount ]]; then
echo "Failed to set initSysctl.vmMaxMapCount"; exit 1
fi
fi
if [[ "$(sysctl -n fs.file-max)" -lt 131072 ]]; then
sysctl -w fs.file-max=131072
fsFileMax=131072
if [[ "$(sysctl -n fs.file-max)" -lt $fsFileMax ]]; then
sysctl -w fs.file-max=$fsFileMax
if [[ "$(sysctl -n fs.file-max)" -lt $fsFileMax ]]; then
echo "Failed to set initSysctl.fsFileMax"; exit 1
fi
fi
nofile=131072
if [[ "$(ulimit -n)" != "unlimited" ]]; then
if [[ "$(ulimit -n)" -lt 131072 ]]; then
echo "ulimit -n 131072"
ulimit -n 131072
if [[ "$(ulimit -n)" -lt $nofile ]]; then
ulimit -n $nofile
if [[ "$(ulimit -n)" -lt $nofile ]]; then
echo "Failed to set initSysctl.nofile"; exit 1
fi
fi
fi
nproc=8192
if [[ "$(ulimit -u)" != "unlimited" ]]; then
if [[ "$(ulimit -u)" -lt 8192 ]]; then
echo "ulimit -u 8192"
ulimit -u 8192
if [[ "$(ulimit -u)" -lt $nproc ]]; then
ulimit -u $nproc
if [[ "$(ulimit -u)" -lt $nproc ]]; then
echo "Failed to set initSysctl.nproc"; exit 1
fi
fi
fi
---
Expand Down Expand Up @@ -752,8 +768,8 @@ spec:
release: application-values.yaml
sonarqube.datacenter/type: "search"
annotations:
checksum/init-sysctl: b0adbc75e013962bdccee0ff7c665f96cde26a19fb8f77276ab0b19209db1a89
checksum/init-fs: 8944b522b680449d8adea850260d1bea05b7e7bcd83500fb45c2fa0eb317a30a
checksum/init-sysctl: 1b587d906e96c6234cd5aa9555dd9ee949f054fb3988706772de25668ff91b43
checksum/init-fs: 461175353f719eb6a55a52b4494871d9ae945e5537294170eab6ab537a8c6f45
checksum/config: 8b2345535c307746d03adee70b6115f85449c08829e7ce75c459a28796e9bd90
checksum/secret: 1769049746dc3c194133f7b24aac8789c0882223b0da297d21d23d95ff731509
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,22 +153,38 @@ metadata:
heritage: Helm
data:
init_sysctl.sh: |-
if [[ "$(sysctl -n vm.max_map_count)" -lt 524288 ]]; then
sysctl -w vm.max_map_count=524288
set -o errexit
set -o xtrace
vmMaxMapCount=524288
if [[ "$(sysctl -n vm.max_map_count)" -lt $vmMaxMapCount ]]; then
sysctl -w vm.max_map_count=$vmMaxMapCount
if [[ "$(sysctl -n vm.max_map_count)" -lt $vmMaxMapCount ]]; then
echo "Failed to set initSysctl.vmMaxMapCount"; exit 1
fi
fi
if [[ "$(sysctl -n fs.file-max)" -lt 131072 ]]; then
sysctl -w fs.file-max=131072
fsFileMax=131072
if [[ "$(sysctl -n fs.file-max)" -lt $fsFileMax ]]; then
sysctl -w fs.file-max=$fsFileMax
if [[ "$(sysctl -n fs.file-max)" -lt $fsFileMax ]]; then
echo "Failed to set initSysctl.fsFileMax"; exit 1
fi
fi
nofile=131072
if [[ "$(ulimit -n)" != "unlimited" ]]; then
if [[ "$(ulimit -n)" -lt 131072 ]]; then
echo "ulimit -n 131072"
ulimit -n 131072
if [[ "$(ulimit -n)" -lt $nofile ]]; then
ulimit -n $nofile
if [[ "$(ulimit -n)" -lt $nofile ]]; then
echo "Failed to set initSysctl.nofile"; exit 1
fi
fi
fi
nproc=8192
if [[ "$(ulimit -u)" != "unlimited" ]]; then
if [[ "$(ulimit -u)" -lt 8192 ]]; then
echo "ulimit -u 8192"
ulimit -u 8192
if [[ "$(ulimit -u)" -lt $nproc ]]; then
ulimit -u $nproc
if [[ "$(ulimit -u)" -lt $nproc ]]; then
echo "Failed to set initSysctl.nproc"; exit 1
fi
fi
fi
---
Expand Down Expand Up @@ -841,8 +857,8 @@ spec:
release: ca-certificates-configmap.yaml
sonarqube.datacenter/type: "search"
annotations:
checksum/init-sysctl: 17a1df024490ff1108533d425a03b19807e1dd8859dadf4ef3f43d2a158bb029
checksum/init-fs: cb69624553357300ec49db62167a22552120254802bc345a3cddda2f30dc0057
checksum/init-sysctl: cb4d6b67c1123dfcde6b074b0346c80f0d3938a8cb22b7138e1999e6c925732b
checksum/init-fs: f0ff3cf0adc0a4e0e1bad5642463c76befcca1f6d0bdeae5378dbf33bb02caed
checksum/config: 505964f6a2a7bb7d01a8952433a77e6b3dee2e772b4680aacc79950fcb84d03d
checksum/secret: 87d7d3096c3b63930e4aced97a689305d92650d13c06c4ea6d129a9fcade9a22
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,22 +153,38 @@ metadata:
heritage: Helm
data:
init_sysctl.sh: |-
if [[ "$(sysctl -n vm.max_map_count)" -lt 524288 ]]; then
sysctl -w vm.max_map_count=524288
set -o errexit
set -o xtrace
vmMaxMapCount=524288
if [[ "$(sysctl -n vm.max_map_count)" -lt $vmMaxMapCount ]]; then
sysctl -w vm.max_map_count=$vmMaxMapCount
if [[ "$(sysctl -n vm.max_map_count)" -lt $vmMaxMapCount ]]; then
echo "Failed to set initSysctl.vmMaxMapCount"; exit 1
fi
fi
if [[ "$(sysctl -n fs.file-max)" -lt 131072 ]]; then
sysctl -w fs.file-max=131072
fsFileMax=131072
if [[ "$(sysctl -n fs.file-max)" -lt $fsFileMax ]]; then
sysctl -w fs.file-max=$fsFileMax
if [[ "$(sysctl -n fs.file-max)" -lt $fsFileMax ]]; then
echo "Failed to set initSysctl.fsFileMax"; exit 1
fi
fi
nofile=131072
if [[ "$(ulimit -n)" != "unlimited" ]]; then
if [[ "$(ulimit -n)" -lt 131072 ]]; then
echo "ulimit -n 131072"
ulimit -n 131072
if [[ "$(ulimit -n)" -lt $nofile ]]; then
ulimit -n $nofile
if [[ "$(ulimit -n)" -lt $nofile ]]; then
echo "Failed to set initSysctl.nofile"; exit 1
fi
fi
fi
nproc=8192
if [[ "$(ulimit -u)" != "unlimited" ]]; then
if [[ "$(ulimit -u)" -lt 8192 ]]; then
echo "ulimit -u 8192"
ulimit -u 8192
if [[ "$(ulimit -u)" -lt $nproc ]]; then
ulimit -u $nproc
if [[ "$(ulimit -u)" -lt $nproc ]]; then
echo "Failed to set initSysctl.nproc"; exit 1
fi
fi
fi
---
Expand Down Expand Up @@ -780,8 +796,8 @@ spec:
release: ca-certificates-secret.yaml
sonarqube.datacenter/type: "search"
annotations:
checksum/init-sysctl: cf1bb146d5664b4cf17c4c2438b47894093595b853399733f474515bb967548d
checksum/init-fs: 514854c4f9b81c21ca03dfd03ee1623a0f67cf1d8d6e4824943011d206238335
checksum/init-sysctl: fdeaeb8a9f23075f221c5a3e431d81a493496366b12128c07af8da4803a27a09
checksum/init-fs: 63bd054d1cfb4763f79c8bf3ae6f8c0821b0ea7897673ab19068ba7ad66e3bda
checksum/config: aaad2d4c76a568e1dc188374784e606fbfe17fbc16a16f305464430b8a602789
checksum/secret: c8c6286ba925c623501f3ca5bbb8ba0ce67ca6d74338f4e6d72b2a36a8eb51fe
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,22 +166,38 @@ metadata:
heritage: Helm
data:
init_sysctl.sh: |-
if [[ "$(sysctl -n vm.max_map_count)" -lt 524288 ]]; then
sysctl -w vm.max_map_count=524288
set -o errexit
set -o xtrace
vmMaxMapCount=524288
if [[ "$(sysctl -n vm.max_map_count)" -lt $vmMaxMapCount ]]; then
sysctl -w vm.max_map_count=$vmMaxMapCount
if [[ "$(sysctl -n vm.max_map_count)" -lt $vmMaxMapCount ]]; then
echo "Failed to set initSysctl.vmMaxMapCount"; exit 1
fi
fi
if [[ "$(sysctl -n fs.file-max)" -lt 131072 ]]; then
sysctl -w fs.file-max=131072
fsFileMax=131072
if [[ "$(sysctl -n fs.file-max)" -lt $fsFileMax ]]; then
sysctl -w fs.file-max=$fsFileMax
if [[ "$(sysctl -n fs.file-max)" -lt $fsFileMax ]]; then
echo "Failed to set initSysctl.fsFileMax"; exit 1
fi
fi
nofile=131072
if [[ "$(ulimit -n)" != "unlimited" ]]; then
if [[ "$(ulimit -n)" -lt 131072 ]]; then
echo "ulimit -n 131072"
ulimit -n 131072
if [[ "$(ulimit -n)" -lt $nofile ]]; then
ulimit -n $nofile
if [[ "$(ulimit -n)" -lt $nofile ]]; then
echo "Failed to set initSysctl.nofile"; exit 1
fi
fi
fi
nproc=8192
if [[ "$(ulimit -u)" != "unlimited" ]]; then
if [[ "$(ulimit -u)" -lt 8192 ]]; then
echo "ulimit -u 8192"
ulimit -u 8192
if [[ "$(ulimit -u)" -lt $nproc ]]; then
ulimit -u $nproc
if [[ "$(ulimit -u)" -lt $nproc ]]; then
echo "Failed to set initSysctl.nproc"; exit 1
fi
fi
fi
---
Expand Down Expand Up @@ -766,8 +782,8 @@ spec:
release: change-admin-password-hook-values.yaml
sonarqube.datacenter/type: "search"
annotations:
checksum/init-sysctl: 48f7f8f4101d9be414e5ea6683709bf1b977875bd4512fb7ffa09b8f1d7e5fa7
checksum/init-fs: dd04b40f2141eb47ad1c4155a49633840ad4a089f7b9ad7cec681e23bba3e33d
checksum/init-sysctl: 273906e17732027dd496d7567313ef485443b1e566c8cb1e09395e79b1b2f431
checksum/init-fs: 07b91ff5ecd40ec430e700c5310a046e1be5d1a5a873f62644274c65e5e03f4c
checksum/config: 2868149d9336567ab9ed31a52549ed97f7dd2cb314c8433499e9d355e2ccf8e0
checksum/secret: d5f2125099d936848433c75a13ecda0a8c63c9e1addf2e628c3bdd584e32c434
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,22 +158,38 @@ metadata:
heritage: Helm
data:
init_sysctl.sh: |-
if [[ "$(sysctl -n vm.max_map_count)" -lt 524288 ]]; then
sysctl -w vm.max_map_count=524288
set -o errexit
set -o xtrace
vmMaxMapCount=524288
if [[ "$(sysctl -n vm.max_map_count)" -lt $vmMaxMapCount ]]; then
sysctl -w vm.max_map_count=$vmMaxMapCount
if [[ "$(sysctl -n vm.max_map_count)" -lt $vmMaxMapCount ]]; then
echo "Failed to set initSysctl.vmMaxMapCount"; exit 1
fi
fi
if [[ "$(sysctl -n fs.file-max)" -lt 131072 ]]; then
sysctl -w fs.file-max=131072
fsFileMax=131072
if [[ "$(sysctl -n fs.file-max)" -lt $fsFileMax ]]; then
sysctl -w fs.file-max=$fsFileMax
if [[ "$(sysctl -n fs.file-max)" -lt $fsFileMax ]]; then
echo "Failed to set initSysctl.fsFileMax"; exit 1
fi
fi
nofile=131072
if [[ "$(ulimit -n)" != "unlimited" ]]; then
if [[ "$(ulimit -n)" -lt 131072 ]]; then
echo "ulimit -n 131072"
ulimit -n 131072
if [[ "$(ulimit -n)" -lt $nofile ]]; then
ulimit -n $nofile
if [[ "$(ulimit -n)" -lt $nofile ]]; then
echo "Failed to set initSysctl.nofile"; exit 1
fi
fi
fi
nproc=8192
if [[ "$(ulimit -u)" != "unlimited" ]]; then
if [[ "$(ulimit -u)" -lt 8192 ]]; then
echo "ulimit -u 8192"
ulimit -u 8192
if [[ "$(ulimit -u)" -lt $nproc ]]; then
ulimit -u $nproc
if [[ "$(ulimit -u)" -lt $nproc ]]; then
echo "Failed to set initSysctl.nproc"; exit 1
fi
fi
fi
---
Expand Down Expand Up @@ -819,8 +835,8 @@ spec:
release: config-values.yaml
sonarqube.datacenter/type: "search"
annotations:
checksum/init-sysctl: b8f6e49977ffd27538e9592a04874483b40d820585d8bbc915590751519a0ca5
checksum/init-fs: c865f1f24f2cb24d9dd4728e3cc8371c332b514cfc9a43a1de24f35d9ca4f3b1
checksum/init-sysctl: a1f125927faeb90480e3875bf7d579430f31fcfed11a3cf26bc0d74ba58a34f5
checksum/init-fs: 048a2d65b056b7078e6684dda7aa117d3b37eed465ded5dfd77ff412bf6e6ccd
checksum/config: 5c6d4f84fa543a46c3a357bd6f073cb915e5766439137c2393f5bdaa4c64b8ea
checksum/secret: 7dd095ea51ae0edcaf73e07dd479e2dbfc9f0a2e080c66735e689211e325df71
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,22 +152,38 @@ metadata:
heritage: Helm
data:
init_sysctl.sh: |-
if [[ "$(sysctl -n vm.max_map_count)" -lt 524288 ]]; then
sysctl -w vm.max_map_count=524288
set -o errexit
set -o xtrace
vmMaxMapCount=524288
if [[ "$(sysctl -n vm.max_map_count)" -lt $vmMaxMapCount ]]; then
sysctl -w vm.max_map_count=$vmMaxMapCount
if [[ "$(sysctl -n vm.max_map_count)" -lt $vmMaxMapCount ]]; then
echo "Failed to set initSysctl.vmMaxMapCount"; exit 1
fi
fi
if [[ "$(sysctl -n fs.file-max)" -lt 131072 ]]; then
sysctl -w fs.file-max=131072
fsFileMax=131072
if [[ "$(sysctl -n fs.file-max)" -lt $fsFileMax ]]; then
sysctl -w fs.file-max=$fsFileMax
if [[ "$(sysctl -n fs.file-max)" -lt $fsFileMax ]]; then
echo "Failed to set initSysctl.fsFileMax"; exit 1
fi
fi
nofile=131072
if [[ "$(ulimit -n)" != "unlimited" ]]; then
if [[ "$(ulimit -n)" -lt 131072 ]]; then
echo "ulimit -n 131072"
ulimit -n 131072
if [[ "$(ulimit -n)" -lt $nofile ]]; then
ulimit -n $nofile
if [[ "$(ulimit -n)" -lt $nofile ]]; then
echo "Failed to set initSysctl.nofile"; exit 1
fi
fi
fi
nproc=8192
if [[ "$(ulimit -u)" != "unlimited" ]]; then
if [[ "$(ulimit -u)" -lt 8192 ]]; then
echo "ulimit -u 8192"
ulimit -u 8192
if [[ "$(ulimit -u)" -lt $nproc ]]; then
ulimit -u $nproc
if [[ "$(ulimit -u)" -lt $nproc ]]; then
echo "Failed to set initSysctl.nproc"; exit 1
fi
fi
fi
---
Expand Down Expand Up @@ -752,8 +768,8 @@ spec:
release: custom-image-values.yaml
sonarqube.datacenter/type: "search"
annotations:
checksum/init-sysctl: caab27390e88859055ade6fd066acd556d945dbd844837e23045ef10ade014c4
checksum/init-fs: 61d4b348a208251fab9834e3d6a85896913e7580e4d1540bf020a02b98319c5f
checksum/init-sysctl: 7b6c2d3a9f8bd9b9262bfd5dd7317d967b3710e87a10c92abdf01a8d7c02e99b
checksum/init-fs: d8ba15029e933930cd719867075462ec31b0360db30f02feb7174c1fcf2081c1
checksum/config: 9b3db69bcaa562652438a4004e82681a95f181da977b990d152630b6885262de
checksum/secret: 1ce885d93888ed0ff5fd5d0726f47a296d26755ccafffc2345daa2e314e99b2b
spec:
Expand Down
Loading

0 comments on commit 55ba5c2

Please sign in to comment.