diff --git a/charts/sonarqube-dce/CHANGELOG.md b/charts/sonarqube-dce/CHANGELOG.md index fb4191835..93fa96f98 100644 --- a/charts/sonarqube-dce/CHANGELOG.md +++ b/charts/sonarqube-dce/CHANGELOG.md @@ -9,6 +9,9 @@ All changes to this chart will be documented in this file. * Fix ENV variables not fetched when using extraConfig.configmaps * Support Gateway on different namespace in HTTPRoute * Change `ingress.ingressClassName` default, set it to `nginx` if `nginx.enabled` or `ingress-nginx.enabled` +* Ensure that ConfigMap resources are not created for `initFS` and `initSysctl` if not needed +* Ensure the Pod will stop at `init` stage if init_sysctl.sh failed to modify kernel parameters +* Replace the example images in initContainers, initSysctl and initFs from `busybox:1.36` to `ubuntu:24.04`, which are commented out by default ## [10.7.0] * Update Chart's version to 10.7.0 diff --git a/charts/sonarqube-dce/Chart.yaml b/charts/sonarqube-dce/Chart.yaml index 6691e4f38..cfa78e9d8 100644 --- a/charts/sonarqube-dce/Chart.yaml +++ b/charts/sonarqube-dce/Chart.yaml @@ -41,6 +41,12 @@ annotations: description: "Support Gateway on different namespace in HTTPRoute" - kind: changed description: "Change `ingress.ingressClassName` default, set it to `nginx` if `nginx.enabled` or `ingress-nginx.enabled`" + - kind: changed + 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" artifacthub.io/links: | - name: support url: https://community.sonarsource.com/ diff --git a/charts/sonarqube-dce/templates/init-fs.yaml b/charts/sonarqube-dce/templates/init-fs.yaml index 0c190ca9a..6218509b8 100644 --- a/charts/sonarqube-dce/templates/init-fs.yaml +++ b/charts/sonarqube-dce/templates/init-fs.yaml @@ -1,3 +1,4 @@ +{{- if and .Values.searchNodes.persistence.enabled .Values.initFs.enabled (not .Values.OpenShift.enabled) }} apiVersion: v1 kind: ConfigMap metadata: @@ -9,7 +10,6 @@ metadata: heritage: {{ .Release.Service }} data: init_fs.sh: |- - {{- if .Values.searchNodes.persistence.enabled }} chown -R {{ .Values.searchNodes.persistence.uid }}:{{ .Values.searchNodes.persistence.guid }} {{ .Values.sonarqubeFolder }}/data chown -R {{ .Values.searchNodes.persistence.uid }}:{{ .Values.searchNodes.persistence.guid }} {{ .Values.sonarqubeFolder }}/temp chown -R {{ .Values.searchNodes.persistence.uid }}:{{ .Values.searchNodes.persistence.guid }} {{ .Values.sonarqubeFolder }}/logs @@ -19,4 +19,4 @@ data: {{- range .Values.searchNodes.persistence.mounts }} chown -R {{ $.Values.searchNodes.persistence.uid }}:{{ $.Values.searchNodes.persistence.guid }} {{ .mountPath }} {{- end }} - {{- end }} \ No newline at end of file +{{- end }} \ No newline at end of file diff --git a/charts/sonarqube-dce/templates/init-sysctl.yaml b/charts/sonarqube-dce/templates/init-sysctl.yaml index b400ab42f..2a402652d 100644 --- a/charts/sonarqube-dce/templates/init-sysctl.yaml +++ b/charts/sonarqube-dce/templates/init-sysctl.yaml @@ -1,3 +1,4 @@ +{{- if and .Values.initSysctl.enabled (not .Values.OpenShift.enabled) }} apiVersion: v1 kind: ConfigMap metadata: @@ -9,29 +10,46 @@ metadata: heritage: {{ .Release.Service }} data: init_sysctl.sh: |- + set -o errexit + set -o xtrace {{- if .Values.initSysctl.vmMaxMapCount }} - if [[ "$(sysctl -n vm.max_map_count)" -lt {{ .Values.initSysctl.vmMaxMapCount }} ]]; then - sysctl -w vm.max_map_count={{ .Values.initSysctl.vmMaxMapCount }} + vmMaxMapCount={{ .Values.initSysctl.vmMaxMapCount | int }} + 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 {{- end }} {{- if .Values.initSysctl.fsFileMax }} - if [[ "$(sysctl -n fs.file-max)" -lt {{ .Values.initSysctl.fsFileMax }} ]]; then - sysctl -w fs.file-max={{ .Values.initSysctl.fsFileMax }} + fsFileMax={{ .Values.initSysctl.fsFileMax | int }} + 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 {{- end }} {{- if .Values.initSysctl.nofile }} + nofile={{ .Values.initSysctl.nofile | int }} if [[ "$(ulimit -n)" != "unlimited" ]]; then - if [[ "$(ulimit -n)" -lt {{ .Values.initSysctl.nofile }} ]]; then - echo "ulimit -n {{ .Values.initSysctl.nofile }}" - ulimit -n {{ .Values.initSysctl.nofile }} + 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 {{- end }} {{- if .Values.initSysctl.nproc }} + nproc={{ .Values.initSysctl.nproc | int }} if [[ "$(ulimit -u)" != "unlimited" ]]; then - if [[ "$(ulimit -u)" -lt {{ .Values.initSysctl.nproc }} ]]; then - echo "ulimit -u {{ .Values.initSysctl.nproc }}" - ulimit -u {{ .Values.initSysctl.nproc }} + 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 {{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/sonarqube-dce/values.yaml b/charts/sonarqube-dce/values.yaml index 354b1a7d2..c42f0679c 100644 --- a/charts/sonarqube-dce/values.yaml +++ b/charts/sonarqube-dce/values.yaml @@ -570,7 +570,8 @@ networkPolicy: # additionalNetworkPolicies: initContainers: - # image: busybox:1.36 + # all initContainers use SonarQube image by default, but you can override it by setting the image field (ex image: ubuntu:24.04) + # image: # Set the security context for the init containers # The current section contains the default values set in a generic Kubernetes cluster. If you are using OpenShift, you should not set any specific UID or GID to be used for the execution. # We allow the init containers to have a separate security context declaration because @@ -613,7 +614,8 @@ initSysctl: fsFileMax: 131072 nofile: 131072 nproc: 8192 - # image: busybox:1.36 + # all initContainers use SonarQube image by default, but you can override it by setting the image field (ex image: ubuntu:24.04) + # image: securityContext: # Compatible with podSecurity standard privileged privileged: true @@ -624,7 +626,8 @@ initSysctl: initFs: enabled: true - # image: busybox:1.36 + # all initContainers use SonarQube image by default, but you can override it by setting the image field (ex image: ubuntu:24.04) + # image: # Compatible with podSecurity standard baseline securityContext: privileged: false diff --git a/charts/sonarqube/CHANGELOG.md b/charts/sonarqube/CHANGELOG.md index 268471d89..3d5461293 100644 --- a/charts/sonarqube/CHANGELOG.md +++ b/charts/sonarqube/CHANGELOG.md @@ -12,6 +12,9 @@ All changes to this chart will be documented in this file. * Set `app.kubernetes.io/name` and `app.kubernetes.io/version` as selector labels * Support Gateway on different namespace in HTTPRoute * Change `ingress.ingressClassName` default, set it to `nginx` if `nginx.enabled` or `ingress-nginx.enabled` +* Ensure that ConfigMap resources are not created for `initFS` and `initSysctl` if not needed +* Ensure the Pod will stop at `init` stage if init_sysctl.sh failed to modify kernel parameters +* Replace the example images in initContainers, initSysctl and initFs from `busybox:1.36` to `ubuntu:24.04`, which are commented out by default ## [10.7.0] * Update Chart's version to 10.7.0 diff --git a/charts/sonarqube/Chart.yaml b/charts/sonarqube/Chart.yaml index ed4817911..816bf0c89 100644 --- a/charts/sonarqube/Chart.yaml +++ b/charts/sonarqube/Chart.yaml @@ -52,6 +52,12 @@ annotations: description: "Support Gateway on different namespace in HTTPRoute" - kind: changed description: "Change `ingress.ingressClassName` default, set it to `nginx` if `nginx.enabled` or `ingress-nginx.enabled`" + - kind: changed + 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" artifacthub.io/containsSecurityUpdates: "false" artifacthub.io/images: | - name: sonarqube diff --git a/charts/sonarqube/templates/init-fs.yaml b/charts/sonarqube/templates/init-fs.yaml index e5b2080a8..2a94f7bc9 100644 --- a/charts/sonarqube/templates/init-fs.yaml +++ b/charts/sonarqube/templates/init-fs.yaml @@ -1,3 +1,4 @@ +{{- if and .Values.persistence.enabled .Values.initFs.enabled (not .Values.OpenShift.enabled) }} apiVersion: v1 kind: ConfigMap metadata: @@ -5,7 +6,6 @@ metadata: labels: {{- include "sonarqube.labels" . | nindent 4 }} data: init_fs.sh: |- - {{- if .Values.persistence.enabled }} chown -R {{ .Values.persistence.uid }}:{{ .Values.persistence.guid }} {{ .Values.sonarqubeFolder }}/data chown -R {{ .Values.persistence.uid }}:{{ .Values.persistence.guid }} {{ .Values.sonarqubeFolder }}/temp chown -R {{ .Values.persistence.uid }}:{{ .Values.persistence.guid }} {{ .Values.sonarqubeFolder }}/logs @@ -18,4 +18,4 @@ data: {{- range .Values.persistence.mounts }} chown -R {{ $.Values.persistence.uid }}:{{ $.Values.persistence.guid }} {{ .mountPath }} {{- end }} - {{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/sonarqube/templates/init-sysctl.yaml b/charts/sonarqube/templates/init-sysctl.yaml index cc7a42a9b..3b89df486 100644 --- a/charts/sonarqube/templates/init-sysctl.yaml +++ b/charts/sonarqube/templates/init-sysctl.yaml @@ -1,3 +1,4 @@ +{{- if and .Values.initSysctl.enabled (not .Values.OpenShift.enabled) }} apiVersion: v1 kind: ConfigMap metadata: @@ -5,29 +6,46 @@ metadata: labels: {{- include "sonarqube.labels" . | nindent 4 }} data: init_sysctl.sh: |- + set -o errexit + set -o xtrace {{- if .Values.initSysctl.vmMaxMapCount }} - if [[ "$(sysctl -n vm.max_map_count)" -lt {{ .Values.initSysctl.vmMaxMapCount }} ]]; then - sysctl -w vm.max_map_count={{ .Values.initSysctl.vmMaxMapCount }} + vmMaxMapCount={{ .Values.initSysctl.vmMaxMapCount | int }} + 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 {{- end }} {{- if .Values.initSysctl.fsFileMax }} - if [[ "$(sysctl -n fs.file-max)" -lt {{ .Values.initSysctl.fsFileMax }} ]]; then - sysctl -w fs.file-max={{ .Values.initSysctl.fsFileMax }} + fsFileMax={{ .Values.initSysctl.fsFileMax | int }} + 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 {{- end }} {{- if .Values.initSysctl.nofile }} + nofile={{ .Values.initSysctl.nofile | int }} if [[ "$(ulimit -n)" != "unlimited" ]]; then - if [[ "$(ulimit -n)" -lt {{ .Values.initSysctl.nofile }} ]]; then - echo "ulimit -n {{ .Values.initSysctl.nofile }}" - ulimit -n {{ .Values.initSysctl.nofile }} + 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 {{- end }} {{- if .Values.initSysctl.nproc }} + nproc={{ .Values.initSysctl.nproc | int }} if [[ "$(ulimit -u)" != "unlimited" ]]; then - if [[ "$(ulimit -u)" -lt {{ .Values.initSysctl.nproc }} ]]; then - echo "ulimit -u {{ .Values.initSysctl.nproc }}" - ulimit -u {{ .Values.initSysctl.nproc }} + 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 {{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/sonarqube/values.yaml b/charts/sonarqube/values.yaml index 0890ff82c..140320034 100644 --- a/charts/sonarqube/values.yaml +++ b/charts/sonarqube/values.yaml @@ -266,7 +266,8 @@ startupProbe: # sonarWebContext: / initContainers: - # image: busybox:1.36 + # all initContainers use SonarQube image by default, but you can override it by setting the image field (ex image: ubuntu:24.04) + # image: # Set the security context for the init containers # The current section contains the default values set in a generic Kubernetes cluster. If you are using OpenShift, you should not set any specific UID or GID to be used for the execution. # We allow the init containers to have a separate security context declaration because @@ -320,7 +321,8 @@ initSysctl: fsFileMax: 131072 nofile: 131072 nproc: 8192 - # image: busybox:1.36 + # all initContainers use SonarQube image by default, but you can override it by setting the image field (ex image: ubuntu:24.04) + # image: securityContext: # Compatible with podSecurity standard privileged privileged: true @@ -332,7 +334,8 @@ initSysctl: # This should not be required anymore, used to chown/chmod folder created by faulty CSI driver that are not applying properly POSIX fsgroup. initFs: enabled: true - # Image: busybox:1.36 + # all initContainers use SonarQube image by default, but you can override it by setting the image field (ex image: ubuntu:24.04) + # image: # Compatible with podSecurity standard baseline. securityContext: privileged: false diff --git a/tests/unit-compatibility-test/fixtures/sonarqube-dce/application-values.yaml b/tests/unit-compatibility-test/fixtures/sonarqube-dce/application-values.yaml index e12e1a02b..9fa51028b 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube-dce/application-values.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube-dce/application-values.yaml @@ -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 --- @@ -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: diff --git a/tests/unit-compatibility-test/fixtures/sonarqube-dce/ca-certificates-configmap.yaml b/tests/unit-compatibility-test/fixtures/sonarqube-dce/ca-certificates-configmap.yaml index 4a56549db..b4851c9cc 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube-dce/ca-certificates-configmap.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube-dce/ca-certificates-configmap.yaml @@ -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 --- @@ -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: diff --git a/tests/unit-compatibility-test/fixtures/sonarqube-dce/ca-certificates-secret.yaml b/tests/unit-compatibility-test/fixtures/sonarqube-dce/ca-certificates-secret.yaml index 33b546fca..d88fbff96 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube-dce/ca-certificates-secret.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube-dce/ca-certificates-secret.yaml @@ -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 --- @@ -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: diff --git a/tests/unit-compatibility-test/fixtures/sonarqube-dce/change-admin-password-hook-values.yaml b/tests/unit-compatibility-test/fixtures/sonarqube-dce/change-admin-password-hook-values.yaml index 551b18856..a4710882a 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube-dce/change-admin-password-hook-values.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube-dce/change-admin-password-hook-values.yaml @@ -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 --- @@ -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: diff --git a/tests/unit-compatibility-test/fixtures/sonarqube-dce/config-values.yaml b/tests/unit-compatibility-test/fixtures/sonarqube-dce/config-values.yaml index 9ee40649f..2f30ca2aa 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube-dce/config-values.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube-dce/config-values.yaml @@ -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 --- @@ -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: diff --git a/tests/unit-compatibility-test/fixtures/sonarqube-dce/custom-image-values.yaml b/tests/unit-compatibility-test/fixtures/sonarqube-dce/custom-image-values.yaml index a0f231851..0668101c7 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube-dce/custom-image-values.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube-dce/custom-image-values.yaml @@ -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 --- @@ -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: diff --git a/tests/unit-compatibility-test/fixtures/sonarqube-dce/default-values.yaml b/tests/unit-compatibility-test/fixtures/sonarqube-dce/default-values.yaml index fd291c2bb..e43509fc3 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube-dce/default-values.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube-dce/default-values.yaml @@ -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 --- @@ -752,8 +768,8 @@ spec: release: default-values.yaml sonarqube.datacenter/type: "search" annotations: - checksum/init-sysctl: f48466d486bcac9dbf10a2f31c5e47a2894a4de7a282a20598bbcdcd5651211a - checksum/init-fs: eb663fe85e120fdae86ac131c2829797369e96bcb958e742f5bed537a5463f1e + checksum/init-sysctl: 8e5ba22007e2deb0f6518a1228dfdeda378def2d5c730fcc74ceb0ed145acf97 + checksum/init-fs: 597ad455d803e323c3f1d36ff7d43324f5c48551a225d4eaceec272697fe6b74 checksum/config: 7207bc7f600ec748a752d85a22eaeaa2c026d1e8a278d131c2e2c899f466b873 checksum/secret: d5a3b5d63d6f6ac267e87652880b0e5c6fbf40b1e066069f2f0943f5c2e546a9 spec: diff --git a/tests/unit-compatibility-test/fixtures/sonarqube-dce/duplicated-env-values.yaml b/tests/unit-compatibility-test/fixtures/sonarqube-dce/duplicated-env-values.yaml index e88874aef..7a81b769f 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube-dce/duplicated-env-values.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube-dce/duplicated-env-values.yaml @@ -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 --- @@ -757,8 +773,8 @@ spec: release: duplicated-env-values.yaml sonarqube.datacenter/type: "search" annotations: - checksum/init-sysctl: 61ab38083ff426b72efcf01b0e0db5e03507c5b4f23ecfc24906fa948daeee19 - checksum/init-fs: 7c84dbce9260c0294ad50bb4e4eac5b8e69332b9881e642382d317e20b780cd7 + checksum/init-sysctl: 2fe6a7e2cbae425aa72c87227afc6917f83922731438505e4e571d86096b4f5a + checksum/init-fs: 341206062feb3e5bcf3b757527bfcf936fc04949b7194a1b558a332cbac5ff03 checksum/config: 4b695c4bbd53740bbfc21673a0698204c2debfdbce25c03837177ba91b0b01d1 checksum/secret: c9ff7fe6908dbc4a745aeb2aef0794cdf92051d51c1ebf40705e77a3cebe9917 spec: diff --git a/tests/unit-compatibility-test/fixtures/sonarqube-dce/extraConfig-values.yaml b/tests/unit-compatibility-test/fixtures/sonarqube-dce/extraConfig-values.yaml index e99c95e6b..1ce23492a 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube-dce/extraConfig-values.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube-dce/extraConfig-values.yaml @@ -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 --- @@ -756,8 +772,8 @@ spec: release: extraconfig-values.yaml sonarqube.datacenter/type: "search" annotations: - checksum/init-sysctl: 5bd188affc95c69c10eb97185921428340843288458da7eacb0169ef20811558 - checksum/init-fs: 7ac857768db96d96a321e57162267cff96ade3c281f5076b1ba9181801902d22 + checksum/init-sysctl: 6cdd4ee44b05cdb85dca171afc82fe152283864c7a310ce2ecf24a652ca0139d + checksum/init-fs: fb33179829fc43ab2e747a25f9db44cf43dc1fa6dc9f42b43c005ece1a971674 checksum/config: a09f15686b325d66858f0adab408c67bcb73e194a34dd6173593a2d465253607 checksum/secret: 016a44d4264ccfddd4247fa15a176b07854562c4ea5ac0aa2aa0391cda2503d5 spec: diff --git a/tests/unit-compatibility-test/fixtures/sonarqube-dce/hpa-values.yaml b/tests/unit-compatibility-test/fixtures/sonarqube-dce/hpa-values.yaml index 2a863c7dd..41aa5d316 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube-dce/hpa-values.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube-dce/hpa-values.yaml @@ -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 --- @@ -786,8 +802,8 @@ spec: release: hpa-values.yaml sonarqube.datacenter/type: "search" annotations: - checksum/init-sysctl: 62a7729db6143da91db4e05b76104999ad39656b50980afe378f1e4c3abe5073 - checksum/init-fs: a07a07a23b4a3fc2e7ca07a029ce572740fe3f73e07523bdf1065d9abf4d131b + checksum/init-sysctl: 2950933aa52d750d989d95fc447ec60eaf81fd46d549f488570a7bd1b58bad01 + checksum/init-fs: d223de9443b728fd96ddb88d350af5b6f1ead8d7c32a4ae8af90c1c8c994bb1c checksum/config: f73438d05a4d5a1428db23b49cb15a38a145395b3da433559bb0a93653af37d1 checksum/secret: e3e0b9f8b4c5e5d6d8663e19abc97f84feeb831b3daa0603b8550d9ec537211d spec: diff --git a/tests/unit-compatibility-test/fixtures/sonarqube-dce/http-routes-default-values.yaml b/tests/unit-compatibility-test/fixtures/sonarqube-dce/http-routes-default-values.yaml index 128ad753d..a8c2ceb16 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube-dce/http-routes-default-values.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube-dce/http-routes-default-values.yaml @@ -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 --- @@ -752,8 +768,8 @@ spec: release: http-routes-default-values.yaml sonarqube.datacenter/type: "search" annotations: - checksum/init-sysctl: e0c19d2a236e4e1cf3ae304ae5dbb052b39cce6836e8a4281e0748e7d52c533b - checksum/init-fs: cbe7b753aedf8d33601882a1cae15378d95e79928120ae579fa9d5a43d07fafa + checksum/init-sysctl: e2242e4c73072b97ebc0ee44da9ae1e8e5d839e07f763e6c2db3cff15bb64baa + checksum/init-fs: 8d1880f3d50d7533fc450161842832976a0695bbb1bd45fa2a41801338eeb8d1 checksum/config: 1b56e51864e895049e63f464e440505f58b24bcf466141d506277b94aef64ecf checksum/secret: d390d7c43d76d6d8aaaf0ad8039b8d432b8af54acaaab553a72cf5085d76061f spec: diff --git a/tests/unit-compatibility-test/fixtures/sonarqube-dce/http-routes-values.yaml b/tests/unit-compatibility-test/fixtures/sonarqube-dce/http-routes-values.yaml index 74748f409..69183cf42 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube-dce/http-routes-values.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube-dce/http-routes-values.yaml @@ -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 --- @@ -752,8 +768,8 @@ spec: release: http-routes-values.yaml sonarqube.datacenter/type: "search" annotations: - checksum/init-sysctl: 21c4555ebf10cfb9d450ebabe5e67ef941f89a470a7433d5da14b2619d7a5ff8 - checksum/init-fs: 0808079cc1f6df65d03e1be25d957907a0167a0aa4febbe93e0ba8b4774bd35b + checksum/init-sysctl: 6aba2f6bef2b45fc8df4493f00f2a61d912548c0399b8e6f7e240f53a94592fe + checksum/init-fs: 264e449236c1c7b390164d0e7316407c1c9f8a749db2dee49169a8c676f42a88 checksum/config: 5426f5b9ea768010fc3a56b6ad84421858e6399bb901432aa2ecd43d5ad26cb4 checksum/secret: e86625604af89c02df772438ee5c5dab19f93f9bac19078c5699667ddc0b5140 spec: diff --git a/tests/unit-compatibility-test/fixtures/sonarqube-dce/ingress-values.yaml b/tests/unit-compatibility-test/fixtures/sonarqube-dce/ingress-values.yaml index f5ea10fff..e2b1835d4 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube-dce/ingress-values.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube-dce/ingress-values.yaml @@ -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 --- @@ -752,8 +768,8 @@ spec: release: ingress-values.yaml sonarqube.datacenter/type: "search" annotations: - checksum/init-sysctl: 4dbe47f4e2bc79d2cf1dbf0db955f19bbbc89429b86ddaaabeb3d883bc2a20ab - checksum/init-fs: 6e16e495a66f45244ca953f0d21a85079ef5074f4c124158582282f80ef54fa0 + checksum/init-sysctl: c8be4f033c3f5af59aad54c20094ea370ae7978a0e2b12baa9f34b293f5dfbf3 + checksum/init-fs: dd57d17edf44440d9de77c81b46cef06d8712218c50e69bef6b1bdcd82ea4521 checksum/config: 60b5a7fcf1d68f27cdf007ce2f814d276a52da653b556d01d87d1d2eaaa010f4 checksum/secret: 2edd01797c3e25fe29997e58b8e71907c5e3f337cb420b0fb7d4d19e26344000 spec: diff --git a/tests/unit-compatibility-test/fixtures/sonarqube-dce/ingress-with-controller.yaml b/tests/unit-compatibility-test/fixtures/sonarqube-dce/ingress-with-controller.yaml index d511e494b..7f9ee9678 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube-dce/ingress-with-controller.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube-dce/ingress-with-controller.yaml @@ -185,22 +185,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 --- @@ -1194,8 +1210,8 @@ spec: release: ingress-with-controller.yaml sonarqube.datacenter/type: "search" annotations: - checksum/init-sysctl: e790ce07175257a846fd4cae5bad4b341b0ed871bd7eb0a446201f199a4a5389 - checksum/init-fs: 569020cc17a8564ac164b758c5ab81ecbd4745bd58cea8a5e4ba86f028d57299 + checksum/init-sysctl: b42fa4e59b26f5cc057eeeb4e85ddcba3e2899926ae54d58adb538094d449efd + checksum/init-fs: b70afd1e97ba884fb0a8ffe54a6eb8f09005e2520210e201ea8213b5cb6fb67d checksum/config: 0802efffd324447d65231ce4f307b84a5d15911e978fc43eabbde1b30a09a13a checksum/secret: 69cfffcdde0e1ac2a3321ee164a9b6b14fd650bd24843aced925625acd8cc7ff spec: diff --git a/tests/unit-compatibility-test/fixtures/sonarqube-dce/install-plugins-values.yaml b/tests/unit-compatibility-test/fixtures/sonarqube-dce/install-plugins-values.yaml index a0b08b473..9aae354da 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube-dce/install-plugins-values.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube-dce/install-plugins-values.yaml @@ -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 --- @@ -799,8 +815,8 @@ spec: release: install-plugins-values.yaml sonarqube.datacenter/type: "search" annotations: - checksum/init-sysctl: 60d7cf1065b3c16bedfc82efd490a8e28897109aac32ef6451735caeaad4ee81 - checksum/init-fs: 1e5cf248e025200ddaece3c4a4c8db432e75ba77816b7473a34fcdbd4d995a4d + checksum/init-sysctl: 558c8216537708865ffba0d2f5f6dcec4bac35c0364883e66546761af7c97ed9 + checksum/init-fs: f759926a03ce11478809c6981aa513b6723683d3d60951d774e63c157a049192 checksum/config: c8035aa4dfa690c629ad6f5beb9774fffdc4c94d77f4f2418f0e70cc6ff55a1f checksum/secret: 8a1127981fc985ee5c2d406dc734bb766b0ee9641e9b782329ad5708ac12fbda spec: diff --git a/tests/unit-compatibility-test/fixtures/sonarqube-dce/jdbc-config-values.yaml b/tests/unit-compatibility-test/fixtures/sonarqube-dce/jdbc-config-values.yaml index 2cb43edc8..9d27fb326 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube-dce/jdbc-config-values.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube-dce/jdbc-config-values.yaml @@ -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 --- @@ -752,8 +768,8 @@ spec: release: jdbc-config-values.yaml sonarqube.datacenter/type: "search" annotations: - checksum/init-sysctl: 1e31d0c520417f1aea8ccb2d10c9d95db41575d0f4faac0e3e69ebafccc88ca0 - checksum/init-fs: 95533971de7ed927214372baa109dd1bd8e72165e6a2dbf19657a47dd25f80ad + checksum/init-sysctl: 94e608b1dc507cbcee17e927057ce66c2ff0f6831f1061deb819eacfa21ef526 + checksum/init-fs: bd5cbda1412b883132a815a461018074b611725a108c6a54ffd86c840f7942a7 checksum/config: a8faf2e4db9f6c23edb8a5e8ea09539b8d1a844b4e29d114ed3abd01d29b723d checksum/secret: 518ef37f6d79a6c53b5b7b4547bfc5f0e58d149baa4f5d6008dac3fa702f8765 spec: diff --git a/tests/unit-compatibility-test/fixtures/sonarqube-dce/networkpolicy-new-values.yaml b/tests/unit-compatibility-test/fixtures/sonarqube-dce/networkpolicy-new-values.yaml index bc4153dbe..a1edf5434 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube-dce/networkpolicy-new-values.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube-dce/networkpolicy-new-values.yaml @@ -345,22 +345,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 --- @@ -945,8 +961,8 @@ spec: release: networkpolicy-new-values.yaml sonarqube.datacenter/type: "search" annotations: - checksum/init-sysctl: 62e2c09253953ac8059acc5bfd31f8657e9261b342f0a818dae7435d0304a5ee - checksum/init-fs: 1eb7e5711c2c3593565f4ade443a201b64ff7b60c5612011cf9573b6a69e9a5c + checksum/init-sysctl: aad04f1406e8e8bddcf8bcc258866377d386066c8484f2f299fd1b73431b9eae + checksum/init-fs: 5f964345dcd3ac2b6ed833f3cfb6497d832e249d488fad23ee556c6c300eb2a4 checksum/config: df9b35835b7c466c937329986e67e4bb423782ac8d60375095bd87ceac7b0365 checksum/secret: 642bf0372459a589b6c33820dcc5c5f060da834c046b3b954b20afd6d59ecaba spec: diff --git a/tests/unit-compatibility-test/fixtures/sonarqube-dce/networkpolicy-values.yaml b/tests/unit-compatibility-test/fixtures/sonarqube-dce/networkpolicy-values.yaml index becb85b80..e976dfed5 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube-dce/networkpolicy-values.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube-dce/networkpolicy-values.yaml @@ -345,22 +345,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 --- @@ -945,8 +961,8 @@ spec: release: networkpolicy-values.yaml sonarqube.datacenter/type: "search" annotations: - checksum/init-sysctl: c6812019c2da3661f4f7ae822ae09180514ceb89c9d00f82e5e4ddd23ed00cc9 - checksum/init-fs: e3aea058a184916b7387f41617e87306c6285e53185510056a62aa15d40edf23 + checksum/init-sysctl: bcc985d38c214e0fe762646b75e66c99843dbfb18c2ef9b57ed873ca748156ff + checksum/init-fs: 22bc850a532624ed00bd00303467c9b6dc40103783e90200cad9723ba4b397c7 checksum/config: 1252c5f2a2300ad5b882ecbefbab1ed226773dd333de98882b17f13ef9493b26 checksum/secret: 54e04e09a56a3e350e1f91a05d1642b031bab4e4154608a1dae96bd05294effa spec: diff --git a/tests/unit-compatibility-test/fixtures/sonarqube-dce/node-topology-per-process-values.yaml b/tests/unit-compatibility-test/fixtures/sonarqube-dce/node-topology-per-process-values.yaml index 3de7275b3..5d372dd0e 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube-dce/node-topology-per-process-values.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube-dce/node-topology-per-process-values.yaml @@ -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 --- @@ -767,8 +783,8 @@ spec: release: node-topology-per-process-values.yaml sonarqube.datacenter/type: "search" annotations: - checksum/init-sysctl: fc7959394ab47359223574e2345de25241d7d2b38a93a6e4c021c2a5d6c6b38d - checksum/init-fs: 3a0f59ccaed807322063982a29d70c07d35740845fa265e8bc7ea1dedc0a3798 + checksum/init-sysctl: 8def58c9462b84905ba14919eba2f259dda51f886291fc15e98f884633ca30e0 + checksum/init-fs: 5daf1cd324ed31505d9eebd782e1ece78afe801685a68258bf0ce0e63d4d2a6c checksum/config: 7a60a3cd192b91e68502f30998bfc65229670eb3efa940a4853090688d3ee8fd checksum/secret: 80fb575d13110ee3c06078b1b2b5ac9f91b20757f0e3a22dccfbc1b964e5bca6 spec: diff --git a/tests/unit-compatibility-test/fixtures/sonarqube-dce/node-topology-values.yml b/tests/unit-compatibility-test/fixtures/sonarqube-dce/node-topology-values.yml index 97d56ff07..acf6cbc13 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube-dce/node-topology-values.yml +++ b/tests/unit-compatibility-test/fixtures/sonarqube-dce/node-topology-values.yml @@ -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 --- @@ -767,8 +783,8 @@ spec: release: node-topology-values.yml sonarqube.datacenter/type: "search" annotations: - checksum/init-sysctl: cbbda60f694d65c41a7d0d855c4ce546257d9354f124bb48beeb6d76a87fa383 - checksum/init-fs: 49a2eb5ea7b9bceb9ae3cae3448814f32361a6fcd9ecd6fd6040b5b9f3f880d4 + checksum/init-sysctl: 54fa93a5f248211d7d3d6bdb1c2a608e6fbe859902db6e37412dfbb31f575d22 + checksum/init-fs: 59223944280d4434acd3a6e978b997343d2fe6a88811fdee0d3d6d572e04e3ca checksum/config: da0fe5d5f5c96d9d785fa09330ad7b7dcd46b95638af7a1dbdb5e76b2a8a5dee checksum/secret: 734af971715a17de3aca4ef792271f2173fb99c771453802a3778954b61aa185 spec: diff --git a/tests/unit-compatibility-test/fixtures/sonarqube-dce/prometheus-monitoring-values.yaml b/tests/unit-compatibility-test/fixtures/sonarqube-dce/prometheus-monitoring-values.yaml index dc1ab5577..790200e06 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube-dce/prometheus-monitoring-values.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube-dce/prometheus-monitoring-values.yaml @@ -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 --- @@ -752,8 +768,8 @@ spec: release: prometheus-monitoring-values.yaml sonarqube.datacenter/type: "search" annotations: - checksum/init-sysctl: c2c7589ad3a3ed345b512ce980e264e64f129850a583c5e94e838100f0e01d13 - checksum/init-fs: 187a9fb783916c6f85e7e90fee3e6308a8abb0f530d67992444c84d445815fc1 + checksum/init-sysctl: b757916bc7bc7d680c9acf8fbd60733fcf57dc9191c96f7fd761ddc27e360312 + checksum/init-fs: 7d1da28cf118c0f34ccbfed069816011809a9f2bd7c28cb6431dc235db83b67f checksum/config: 61a8486b58412bfe4c47629fdd9d1b5f775861b6ad7836376f2f25707b08b81e checksum/secret: 62eb5556e5e3f133aeb8e1b98c1ee3168287ea3e2065fb6186cf0a578a00b5db spec: diff --git a/tests/unit-compatibility-test/fixtures/sonarqube-dce/proxies-secret-values.yaml b/tests/unit-compatibility-test/fixtures/sonarqube-dce/proxies-secret-values.yaml index 5354a636d..4e1f9c0b0 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube-dce/proxies-secret-values.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube-dce/proxies-secret-values.yaml @@ -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 --- @@ -799,8 +815,8 @@ spec: release: proxies-secret-values.yaml sonarqube.datacenter/type: "search" annotations: - checksum/init-sysctl: 9f9d03dcfe6bae0efe84f7dd6e6e5a67a3c1abc61363aaf9f6f24b8e99771a1a - checksum/init-fs: 5e3f17b0e204f68ae9583479267338eff84971605f35ba5f7c0c078aed87a952 + checksum/init-sysctl: 7e476ba75b146e7ed2ed920e5598e96621ea381971d166e05ea082c6a5dcc92a + checksum/init-fs: cd51b9413a43fa2e904ddb2c43dda6de5ca4c6db24084137b4ba9d5c51af53a4 checksum/config: 947a27ead9fc629c739ffc7bfb66e9392784decfd196ec1fb63225dacc43d6cf checksum/secret: d75356966e3ff1dda69edc9f3187a2299c97fa4ff75815bbe9496c2b7cbe3751 spec: diff --git a/tests/unit-compatibility-test/fixtures/sonarqube-dce/proxies-values.yaml b/tests/unit-compatibility-test/fixtures/sonarqube-dce/proxies-values.yaml index 7f1860f18..cbac78909 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube-dce/proxies-values.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube-dce/proxies-values.yaml @@ -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 --- @@ -893,8 +909,8 @@ spec: release: proxies-values.yaml sonarqube.datacenter/type: "search" annotations: - checksum/init-sysctl: 98bc61d1be25aa77d0ed421dbe149255a1c8425649704ef45c8f080dbc7d1045 - checksum/init-fs: 32dcd7c1959dfe14af21ce9aef7dd4f72c9527d6fbc47f5e7bdfc9cff04cf426 + checksum/init-sysctl: a75ac53927999d2e14753fec536110541b0165d24a186dde7251a70ee0708004 + checksum/init-fs: b5263be2ef938b638dcb9d3238d9eb0fd395221a659418ce5dc349d5e7e3f9e5 checksum/config: 65e9a02807c680f8d91d4de2b2e348b4ce2456ee838e627d68ef4f9d76673a3d checksum/secret: 425d01e6a5e14326c45adff9e8bae426131efebc2b97b59672437085fe02079c spec: diff --git a/tests/unit-compatibility-test/fixtures/sonarqube-dce/pvc-values.yaml b/tests/unit-compatibility-test/fixtures/sonarqube-dce/pvc-values.yaml index c292d5953..6e4dd3e71 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube-dce/pvc-values.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube-dce/pvc-values.yaml @@ -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 --- @@ -754,8 +770,8 @@ spec: release: pvc-values.yaml sonarqube.datacenter/type: "search" annotations: - checksum/init-sysctl: 20f0b7cfcf2fbdca602441759a392d814a7b98ee267b1c7b347f3a74094cdc60 - checksum/init-fs: a1787148ebfce60f0cf222dd63d0e7a1f19c2a3e60296284cfae38dc6805c5c6 + checksum/init-sysctl: abc7e01f2b6241cfae1cf385b59edb48308745648ab8f1836b26e7d8132f04e0 + checksum/init-fs: 8f2b056e7c17feeba880adbaafac5679d9f6f448fb5eca5f8689015af788b2d0 checksum/config: b698bfd1a974756539fc7d4faaeaf32a5ef36be90d153e826c9a15e388e01003 checksum/secret: e43191b569d78f8bd9e212b5ae0286132020601b703555368f90eafa459bad21 spec: diff --git a/tests/unit-compatibility-test/fixtures/sonarqube-dce/restricted-openshift.yaml b/tests/unit-compatibility-test/fixtures/sonarqube-dce/restricted-openshift.yaml index 7ed9ac47d..e5a9b29a9 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube-dce/restricted-openshift.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube-dce/restricted-openshift.yaml @@ -123,53 +123,6 @@ data: sonar.properties: | sonar.forceAuthentication=true --- -# Source: sonarqube-dce/templates/init-fs.yaml -apiVersion: v1 -kind: ConfigMap -metadata: - name: restricted-openshift.yaml-sonarqube-dce-init-fs - labels: - app: sonarqube-dce - chart: sonarqube-dce-10.8.0 - release: restricted-openshift.yaml - heritage: Helm -data: - init_fs.sh: |- - chown -R 1000:0 /opt/sonarqube/data - chown -R 1000:0 /opt/sonarqube/temp - chown -R 1000:0 /opt/sonarqube/logs ---- -# Source: sonarqube-dce/templates/init-sysctl.yaml -apiVersion: v1 -kind: ConfigMap -metadata: - name: restricted-openshift.yaml-sonarqube-dce-init-sysctl - labels: - app: sonarqube-dce - chart: sonarqube-dce-10.8.0 - release: restricted-openshift.yaml - heritage: Helm -data: - init_sysctl.sh: |- - if [[ "$(sysctl -n vm.max_map_count)" -lt 524288 ]]; then - sysctl -w vm.max_map_count=524288 - fi - if [[ "$(sysctl -n fs.file-max)" -lt 131072 ]]; then - sysctl -w fs.file-max=131072 - fi - if [[ "$(ulimit -n)" != "unlimited" ]]; then - if [[ "$(ulimit -n)" -lt 131072 ]]; then - echo "ulimit -n 131072" - ulimit -n 131072 - fi - fi - if [[ "$(ulimit -u)" != "unlimited" ]]; then - if [[ "$(ulimit -u)" -lt 8192 ]]; then - echo "ulimit -u 8192" - ulimit -u 8192 - fi - fi ---- # Source: sonarqube-dce/templates/install-plugins.yaml apiVersion: v1 kind: ConfigMap diff --git a/tests/unit-compatibility-test/fixtures/sonarqube-dce/secret-values.yaml b/tests/unit-compatibility-test/fixtures/sonarqube-dce/secret-values.yaml index 3a361748b..a88e9a17b 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube-dce/secret-values.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube-dce/secret-values.yaml @@ -163,22 +163,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 --- @@ -530,8 +546,8 @@ spec: release: secret-values.yaml sonarqube.datacenter/type: "search" annotations: - checksum/init-sysctl: 3270bd1dcfa90993ede47a5a47bac061f0cd6b704f2b2c9898e651854b7bcd1b - checksum/init-fs: bb8e122f30f2490f44314c4f8792ff9ee636bd6166412d9c17074bab06457971 + checksum/init-sysctl: 0800142dc99ce73387c0e5fa48c5cae0c5ea1ce11c09da72daaa236a8f7e66f3 + checksum/init-fs: 8c52d488054c868bc3faad241eeec4f513c7a40d8c36dbe2814b946a25efc4cc checksum/config: d4b2cfb16773344be7eb4dc6f9bf390f8362c7daea5bd325ccb9dfda4e0126d3 checksum/secret: 2001ee13e3d260ac4b1bc0dd70a8b6042cf43612cc947c3746702ed8c04f8398 spec: diff --git a/tests/unit-compatibility-test/fixtures/sonarqube-dce/service-values.yaml b/tests/unit-compatibility-test/fixtures/sonarqube-dce/service-values.yaml index 5e696d98b..6ac2fe017 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube-dce/service-values.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube-dce/service-values.yaml @@ -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 --- @@ -770,8 +786,8 @@ spec: release: service-values.yaml sonarqube.datacenter/type: "search" annotations: - checksum/init-sysctl: c111f05bc8201c39b8c6cd33f9bf4e8909d1241444071fbcc5ac7a50e1382af7 - checksum/init-fs: f8e25c3fa99aabdf367fcf14272eb416905d063cfc4c79e1ec7b1beb8a2f14a9 + checksum/init-sysctl: 23d4ad3cd8a9aec8db820cb6f1d6f1a23f5163eb4dc5f126ef92c4dfe31369af + checksum/init-fs: a3af405fde3035a2e8509a393b792ab633ee598ad471f2587704b892beb8779c checksum/config: 7e335ff522c051071360b17f11b7701837eea0774638db7d9b6f4d1d500c12cc checksum/secret: 6241055a47252b32a87505c21c6436a431698354aac7c6abb88dca589fa71950 spec: diff --git a/tests/unit-compatibility-test/fixtures/sonarqube-dce/serviceaccount-values.yaml b/tests/unit-compatibility-test/fixtures/sonarqube-dce/serviceaccount-values.yaml index cf048304b..edbcab2e1 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube-dce/serviceaccount-values.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube-dce/serviceaccount-values.yaml @@ -161,22 +161,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 --- @@ -761,8 +777,8 @@ spec: release: serviceaccount-values.yaml sonarqube.datacenter/type: "search" annotations: - checksum/init-sysctl: 868c71860febadb36690c801c09795196296a295dd125deb679b7dd1676193b7 - checksum/init-fs: 81f41fc3bec7d3ad1d6914d6a960ae0efc5eecd90e726f460601d121400adf9d + checksum/init-sysctl: 1b139a2dc11bad8681c1f7fe479bb49d77b046ef4ff977af9a1ead3018ab0bda + checksum/init-fs: 0af6d6cd17d8b64a3378a7da4e2741825cae3e8ef3fbc16c4d0b3ab8d0156240 checksum/config: 3557e428746f7d919f86f5aa2c0c6199f7e6c356bf1095b2e508a893b5b23de9 checksum/secret: f66fb53a680c2fa2ded0780fc44f9eabe16ddadad7964aea87ef05f4c902b149 spec: diff --git a/tests/unit-compatibility-test/fixtures/sonarqube-dce/sonar-web-context-deprecated-values.yaml b/tests/unit-compatibility-test/fixtures/sonarqube-dce/sonar-web-context-deprecated-values.yaml index d91bedac0..74b70ff59 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube-dce/sonar-web-context-deprecated-values.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube-dce/sonar-web-context-deprecated-values.yaml @@ -167,22 +167,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 --- @@ -815,8 +831,8 @@ spec: release: sonar-web-context-deprecated-values.yaml sonarqube.datacenter/type: "search" annotations: - checksum/init-sysctl: a284de87ee3dff4c97d6537bfda54cfcd99ba3d0e7416c602436e2e5513c5997 - checksum/init-fs: 20b3efa31e19caace8596ba4a3d6551348a05dbd93b33d101ca1514fc93f777f + checksum/init-sysctl: c4cf083b6b63a1955b0938b50aaa14aaa29b591d494a16ca97c248c7972a17ee + checksum/init-fs: 45858640dd85c45b9544e10b42faf254ac12ab89cc436586949bbcbde5645529 checksum/config: 9250bb0a809aa091e79419bba6b0cc8057cf8c77c0e1a42a9604ec0e8d12b760 checksum/secret: b4e73643245492940e7b085f1acea4a3c0e4460f4eb763bc26b524522fd35b80 spec: diff --git a/tests/unit-compatibility-test/fixtures/sonarqube-dce/sonar-web-context-values.yaml b/tests/unit-compatibility-test/fixtures/sonarqube-dce/sonar-web-context-values.yaml index 3f2c15661..8980b6225 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube-dce/sonar-web-context-values.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube-dce/sonar-web-context-values.yaml @@ -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 --- @@ -766,8 +782,8 @@ spec: release: sonar-web-context-values.yaml sonarqube.datacenter/type: "search" annotations: - checksum/init-sysctl: a4d811eccabe7aabbc1db26b58c71ccceec1c3eba934e505d7b9dd4faaababe8 - checksum/init-fs: c41500050244c373b71bc38ba8e348b0ac3ad921900e83cc3f577fda66bb1df3 + checksum/init-sysctl: 19c4cb99e32efa769f1564ed409c647fdfbad94350bbd063770f69fda987774f + checksum/init-fs: 085e940af1622375d56b0292951e230bac4a428ea1a2b1655237139603361944 checksum/config: 4b7052ccc5d0ad70867a95240c848a212b41c5861e3bc0cb38250e0c3799b772 checksum/secret: 880335758074f9cf4c1cef8b40e438a2f8657b7a55c3c51d89e0a8eae76cbd75 spec: diff --git a/tests/unit-compatibility-test/fixtures/sonarqube/ca-certificates-configmap.yaml b/tests/unit-compatibility-test/fixtures/sonarqube/ca-certificates-configmap.yaml index 823000189..fddef27c0 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube/ca-certificates-configmap.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube/ca-certificates-configmap.yaml @@ -63,19 +63,6 @@ metadata: data: sonar.properties: | --- -# Source: sonarqube/templates/init-fs.yaml -apiVersion: v1 -kind: ConfigMap -metadata: - name: ca-certificates-configmap.yaml-sonarqube-init-fs - labels: - app: sonarqube - chart: sonarqube-10.8.0 - release: ca-certificates-configmap.yaml - heritage: Helm -data: - init_fs.sh: |- ---- # Source: sonarqube/templates/init-sysctl.yaml apiVersion: v1 kind: ConfigMap @@ -88,22 +75,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 --- @@ -416,7 +419,7 @@ spec: metadata: annotations: checksum/config: fd8620f3d126d9edcda2d866ac2aa1c5f77900ad8bc3abebb055b0f8ff3f8cb8 - checksum/init-sysctl: 5c2f901b11cced7d4574a22ea85fa2ba3af90915169e86c4883cb72674bd81b8 + checksum/init-sysctl: b07d6471875a365abeb56f674b8c39df8f4961058dc7848f1f5532d0561bfcee checksum/plugins: 94f18e9d40b3029286a2919aff105651ebf066f0e99d3b89411972c711a949c0 checksum/secret: 557d82f679b38b26b18efe52e31a696bdf0a5f42e7b8e24c298f545c9330729b labels: diff --git a/tests/unit-compatibility-test/fixtures/sonarqube/ca-certificates-secret.yaml b/tests/unit-compatibility-test/fixtures/sonarqube/ca-certificates-secret.yaml index e86ad115b..0b35e3300 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube/ca-certificates-secret.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube/ca-certificates-secret.yaml @@ -63,19 +63,6 @@ metadata: data: sonar.properties: | --- -# Source: sonarqube/templates/init-fs.yaml -apiVersion: v1 -kind: ConfigMap -metadata: - name: ca-certificates-secret.yaml-sonarqube-init-fs - labels: - app: sonarqube - chart: sonarqube-10.8.0 - release: ca-certificates-secret.yaml - heritage: Helm -data: - init_fs.sh: |- ---- # Source: sonarqube/templates/init-sysctl.yaml apiVersion: v1 kind: ConfigMap @@ -88,22 +75,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 --- @@ -400,7 +403,7 @@ spec: metadata: annotations: checksum/config: c1325b5ef9860c1cabcf92cc69a2849456264c22099729e9644ba670a7414894 - checksum/init-sysctl: 6e99b374b0e8e4f2d045ab497082412ee3c827e0494ab414bb2dba3c26cbca18 + checksum/init-sysctl: 4aa5872db29772e3c2e084ce01233c2289dbf690a076ffc41a009c509cf779b2 checksum/plugins: 801dd931236fe68d7a69f712f1af8a719c738da9dd7fa49112ec601b2e98b6a1 checksum/secret: 9f1b5a72efd30d18842ee3c6ce0226189b85bd45a08ccd8978b8c08a7b716db9 labels: diff --git a/tests/unit-compatibility-test/fixtures/sonarqube/change-admin-password-hook-values.yaml b/tests/unit-compatibility-test/fixtures/sonarqube/change-admin-password-hook-values.yaml index d5d3d95e3..bcbeb308e 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube/change-admin-password-hook-values.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube/change-admin-password-hook-values.yaml @@ -77,19 +77,6 @@ metadata: data: sonar.properties: | --- -# Source: sonarqube/templates/init-fs.yaml -apiVersion: v1 -kind: ConfigMap -metadata: - name: change-admin-password-hook-values.yaml-sonarqube-init-fs - labels: - app: sonarqube - chart: sonarqube-10.8.0 - release: change-admin-password-hook-values.yaml - heritage: Helm -data: - init_fs.sh: |- ---- # Source: sonarqube/templates/init-sysctl.yaml apiVersion: v1 kind: ConfigMap @@ -102,22 +89,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 --- @@ -414,7 +417,7 @@ spec: metadata: annotations: checksum/config: 1b477b7efce738197735b2e9f024e13e6720995a55cb18f8f042916cba21131b - checksum/init-sysctl: aab13db9c466b52a24626bad25876a476606f209609e42ccd6c5e5ba1af70007 + checksum/init-sysctl: 81ee2f1157a9856ed41bc0a7baba829988b9baaa5340c6ebf8137d8550cc35a5 checksum/plugins: 99d4e092c5a6fe173ee28b2701fa2ff8c39789afd97a210bf2115e5b5dc2ce72 checksum/secret: f6392654649ad0433a3f4aa119faf6c46e16a435c7a7f02cddd8050710fe6346 labels: diff --git a/tests/unit-compatibility-test/fixtures/sonarqube/community-build-values.yaml b/tests/unit-compatibility-test/fixtures/sonarqube/community-build-values.yaml index ddd4f6a48..23432dcf7 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube/community-build-values.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube/community-build-values.yaml @@ -63,19 +63,6 @@ metadata: data: sonar.properties: | --- -# Source: sonarqube/templates/init-fs.yaml -apiVersion: v1 -kind: ConfigMap -metadata: - name: community-build-values.yaml-sonarqube-init-fs - labels: - app: sonarqube - chart: sonarqube-10.8.0 - release: community-build-values.yaml - heritage: Helm -data: - init_fs.sh: |- ---- # Source: sonarqube/templates/init-sysctl.yaml apiVersion: v1 kind: ConfigMap @@ -88,22 +75,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 --- @@ -400,7 +403,7 @@ spec: metadata: annotations: checksum/config: 45f2fde695881ee02672d831e29a02e8a19d633acaabf3ed171f83f982304d0a - checksum/init-sysctl: 3286997a1f7f466a6c920f50222e7edd9c139db94fa5fc9f05f2db8a4b778424 + checksum/init-sysctl: 2143ad4b8b40cc7f088128f94950d936217826990873e4f4bd921aa3bbf06d60 checksum/plugins: 7488ba6cb4cdcb5b5c29b477bc9bb285a51880426ed7ee54eafaf2e71e43671c checksum/secret: ba0769df0fe82f06bcd8f9ae0e892081504530b7f3209941b76bd29f954bda0c labels: diff --git a/tests/unit-compatibility-test/fixtures/sonarqube/config-values.yaml b/tests/unit-compatibility-test/fixtures/sonarqube/config-values.yaml index 012a28584..c0fdca247 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube/config-values.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube/config-values.yaml @@ -67,19 +67,6 @@ data: sonar.es.bootstrap.checks.disable=true sonar.secretKeyPath=/opt/sonarqube/secret/sonar-secret.txt --- -# Source: sonarqube/templates/init-fs.yaml -apiVersion: v1 -kind: ConfigMap -metadata: - name: config-values.yaml-sonarqube-init-fs - labels: - app: sonarqube - chart: sonarqube-10.8.0 - release: config-values.yaml - heritage: Helm -data: - init_fs.sh: |- ---- # Source: sonarqube/templates/init-sysctl.yaml apiVersion: v1 kind: ConfigMap @@ -92,22 +79,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 --- @@ -404,7 +407,7 @@ spec: metadata: annotations: checksum/config: bf299de747bd641a972414f81baf157f4d16d3860528a5512ce629c36477ad8b - checksum/init-sysctl: 242ada611db3e089b564ee67d5d55f0410aa829558a3bd06c767b173ef1204ad + checksum/init-sysctl: 83b1a298b1f79036f039f03c86c4f62b3ad643e33b175890fc4598529fe3a7bb checksum/plugins: 4c7071abf03ef70430e791752c467a7cda11c5a674ce4da7d75ce55ee809e48e checksum/secret: bc40760b92dcd1c05d78de32646766cb6c46f20b1a4c1c5d9e32bc83314c8f82 labels: diff --git a/tests/unit-compatibility-test/fixtures/sonarqube/custom-image-values.yaml b/tests/unit-compatibility-test/fixtures/sonarqube/custom-image-values.yaml index d17f8a8d6..1d852097d 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube/custom-image-values.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube/custom-image-values.yaml @@ -63,19 +63,6 @@ metadata: data: sonar.properties: | --- -# Source: sonarqube/templates/init-fs.yaml -apiVersion: v1 -kind: ConfigMap -metadata: - name: custom-image-values.yaml-sonarqube-init-fs - labels: - app: sonarqube - chart: sonarqube-10.8.0 - release: custom-image-values.yaml - heritage: Helm -data: - init_fs.sh: |- ---- # Source: sonarqube/templates/init-sysctl.yaml apiVersion: v1 kind: ConfigMap @@ -88,22 +75,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 --- @@ -400,7 +403,7 @@ spec: metadata: annotations: checksum/config: 8c89a5a2296e711c6dd9a8042ab5db8f33ecd86d6b8018e4507f78d6a6f2f255 - checksum/init-sysctl: 9d0178cdc8e489fd364cbfb368a9ae294e7b4dc6ade3e57a37691d073ed19f59 + checksum/init-sysctl: b5b9a961a02026dff86567b97cf9a808fcabca3a44976d4682a8f054ba1e60a5 checksum/plugins: c32bdc6308ed9e206e572bc4bccbe8db9e2a7ec32bf6c906468c26eea21605ec checksum/secret: e282693ff2fc4a631553f693dcd9a9f4b3430efc4305fd3d8da0d953996b766c labels: diff --git a/tests/unit-compatibility-test/fixtures/sonarqube/default-values.yaml b/tests/unit-compatibility-test/fixtures/sonarqube/default-values.yaml index 04a0b1925..8225761ef 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube/default-values.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube/default-values.yaml @@ -63,19 +63,6 @@ metadata: data: sonar.properties: | --- -# Source: sonarqube/templates/init-fs.yaml -apiVersion: v1 -kind: ConfigMap -metadata: - name: default-values.yaml-sonarqube-init-fs - labels: - app: sonarqube - chart: sonarqube-10.8.0 - release: default-values.yaml - heritage: Helm -data: - init_fs.sh: |- ---- # Source: sonarqube/templates/init-sysctl.yaml apiVersion: v1 kind: ConfigMap @@ -88,22 +75,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 --- @@ -400,7 +403,7 @@ spec: metadata: annotations: checksum/config: 6ec79d5c0e51ab1c99283799db858d2bb3fef0bad79272beb12a3b65e0364178 - checksum/init-sysctl: d3ac165a4a5684798ef09d3ec2710394d1030bcda0bed07f832823b607a83411 + checksum/init-sysctl: 3a6cf6084c3c9fe0afe660c60b7e9100f28e0ad71984d36965a62c12b331356e checksum/plugins: 13449b7e0e2eebd530e4d0fea6108ab53fa6c03bf920c5460e7964418c87e5b6 checksum/secret: 99430d2608d45e9f5ed686dd89ca28df6f523140349bf7b52accc52ffbc4548b labels: diff --git a/tests/unit-compatibility-test/fixtures/sonarqube/deployment-values.yaml b/tests/unit-compatibility-test/fixtures/sonarqube/deployment-values.yaml index 4347ad185..c4b71619c 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube/deployment-values.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube/deployment-values.yaml @@ -63,19 +63,6 @@ metadata: data: sonar.properties: | --- -# Source: sonarqube/templates/init-fs.yaml -apiVersion: v1 -kind: ConfigMap -metadata: - name: deployment-values.yaml-sonarqube-init-fs - labels: - app: sonarqube - chart: sonarqube-10.8.0 - release: deployment-values.yaml - heritage: Helm -data: - init_fs.sh: |- ---- # Source: sonarqube/templates/init-sysctl.yaml apiVersion: v1 kind: ConfigMap @@ -88,22 +75,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 --- @@ -238,7 +241,7 @@ spec: metadata: annotations: checksum/config: c772af2c9ba4010c2059735ac67477f2ed7b0f1339ad86569e0c04d7dbb56305 - checksum/init-sysctl: 7599676bfc5eccc4224abcc0956467a358e772eaa1eb219702944af44597c208 + checksum/init-sysctl: 784d4ec33cee7f2159d3bea7cdeccf2ee7e30a2f8d11160a9da28be1a39aafab checksum/plugins: 6d62c8d95ea4932ad85aab499e9ff05372114756be38d1278984b866ed756ad4 checksum/secret: 2d5d9f6a18c1b3fda173d4aa82ddf17e61fd7fa5077cf70a81d8abe21f829cca labels: diff --git a/tests/unit-compatibility-test/fixtures/sonarqube/duplicated-env-values.yaml b/tests/unit-compatibility-test/fixtures/sonarqube/duplicated-env-values.yaml index d8fb0d4a7..bd5854595 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube/duplicated-env-values.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube/duplicated-env-values.yaml @@ -63,19 +63,6 @@ metadata: data: sonar.properties: | --- -# Source: sonarqube/templates/init-fs.yaml -apiVersion: v1 -kind: ConfigMap -metadata: - name: duplicated-env-values.yaml-sonarqube-init-fs - labels: - app: sonarqube - chart: sonarqube-10.8.0 - release: duplicated-env-values.yaml - heritage: Helm -data: - init_fs.sh: |- ---- # Source: sonarqube/templates/init-sysctl.yaml apiVersion: v1 kind: ConfigMap @@ -88,22 +75,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 --- @@ -430,7 +433,7 @@ spec: metadata: annotations: checksum/config: 793f997df436059f3f95cc87706776d80e461ecd53f8e2f963b2b3c386bbcd89 - checksum/init-sysctl: 36234c93b1a84a1f1d3436e4968e08b30fa10ba8eca277746b1ee8cb351ff932 + checksum/init-sysctl: f8c46a214605209379422255d339e5cf242d39038a3f397f71254ce2b92604f4 checksum/plugins: c16567e0efe91fb6f393ae7b245f1176a117c172b358d503699ff24792cb800e checksum/secret: cf7d13f96d1c9e152ae53c0eb48aa9990cf449e7a19bff144b6fe78f1978a7f2 checksum/prometheus-config: 98848b1e86a0ca197b4876e163e58145172f8bd96836d6765ccae7b1a4d5e45d diff --git a/tests/unit-compatibility-test/fixtures/sonarqube/http-routes-default-values.yaml b/tests/unit-compatibility-test/fixtures/sonarqube/http-routes-default-values.yaml index 60379e3b3..35ca06cf8 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube/http-routes-default-values.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube/http-routes-default-values.yaml @@ -63,19 +63,6 @@ metadata: data: sonar.properties: | --- -# Source: sonarqube/templates/init-fs.yaml -apiVersion: v1 -kind: ConfigMap -metadata: - name: http-routes-default-values.yaml-sonarqube-init-fs - labels: - app: sonarqube - chart: sonarqube-10.8.0 - release: http-routes-default-values.yaml - heritage: Helm -data: - init_fs.sh: |- ---- # Source: sonarqube/templates/init-sysctl.yaml apiVersion: v1 kind: ConfigMap @@ -88,22 +75,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 --- @@ -400,7 +403,7 @@ spec: metadata: annotations: checksum/config: 16ca10860295c3976e75547240a232c59da6bd5e68363e3c4944d6b3641a2f46 - checksum/init-sysctl: 2332ba658119a695893b7b3ace93c35da9e6d46c12057d5a4e9fc853a870e0ae + checksum/init-sysctl: 617d838839bab7a98919de7de06d2e88ace37475d9d79026a4ea3b5b60253e89 checksum/plugins: 609ba67273e297797aa896734ae3d410269f85550fc75202e3ad0c2a611fe4be checksum/secret: e50a0adcddaddab09b5fa02b1e91a5354c3d5fb09c6f3b05be9d5b0d93449610 labels: diff --git a/tests/unit-compatibility-test/fixtures/sonarqube/http-routes-values.yaml b/tests/unit-compatibility-test/fixtures/sonarqube/http-routes-values.yaml index 38f0f87c5..640164d40 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube/http-routes-values.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube/http-routes-values.yaml @@ -63,19 +63,6 @@ metadata: data: sonar.properties: | --- -# Source: sonarqube/templates/init-fs.yaml -apiVersion: v1 -kind: ConfigMap -metadata: - name: http-routes-values.yaml-sonarqube-init-fs - labels: - app: sonarqube - chart: sonarqube-10.8.0 - release: http-routes-values.yaml - heritage: Helm -data: - init_fs.sh: |- ---- # Source: sonarqube/templates/init-sysctl.yaml apiVersion: v1 kind: ConfigMap @@ -88,22 +75,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 --- @@ -400,7 +403,7 @@ spec: metadata: annotations: checksum/config: db4cea072037a49bd81653733dccc77ab978ee0cbfb82189009458ee5efe51f5 - checksum/init-sysctl: 7a514aa63460dacced4a7a6f2935daf4399bd1f768e1f9500f10aace00474609 + checksum/init-sysctl: 9c1bac9f9eb4797e21b05ebf4216463d1aaab860ebda427f9d4d896ebd9a114a checksum/plugins: f210e57f1d39a4db4955740138936b5c39a283efc825e133081175961f530b17 checksum/secret: 7712c1622c91b36b16c7e4c0301082c4a105472d84aaa3a85537234793b2e383 labels: diff --git a/tests/unit-compatibility-test/fixtures/sonarqube/ingress-values.yaml b/tests/unit-compatibility-test/fixtures/sonarqube/ingress-values.yaml index 0ce82c420..a7d1fd4f0 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube/ingress-values.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube/ingress-values.yaml @@ -63,19 +63,6 @@ metadata: data: sonar.properties: | --- -# Source: sonarqube/templates/init-fs.yaml -apiVersion: v1 -kind: ConfigMap -metadata: - name: ingress-values.yaml-sonarqube-init-fs - labels: - app: sonarqube - chart: sonarqube-10.8.0 - release: ingress-values.yaml - heritage: Helm -data: - init_fs.sh: |- ---- # Source: sonarqube/templates/init-sysctl.yaml apiVersion: v1 kind: ConfigMap @@ -88,22 +75,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 --- @@ -400,7 +403,7 @@ spec: metadata: annotations: checksum/config: 6707f31fa3ff89c24b861d6dd1b12f262688999d328a04903ae582826dfbbd52 - checksum/init-sysctl: e58c1a8e9a04277c0c95feddc4c9b6f1f2a4ad4ab3b02e0eb92e8f7b4e97ac3b + checksum/init-sysctl: 316b2a37ca684cebe5d8134924c747457654bee4ea3ec11f3e3f8aecc334ffbd checksum/plugins: 6dd1e153411635e3dc86893673b797df046cc77f73f2c70ab272d69ede0c6e4a checksum/secret: e90a1f709c32b504a01423ec97d04cba9af52acd6c5065f498135eb491660298 labels: diff --git a/tests/unit-compatibility-test/fixtures/sonarqube/ingress-with-controller.yaml b/tests/unit-compatibility-test/fixtures/sonarqube/ingress-with-controller.yaml index 5df588eb6..a2b7b996e 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube/ingress-with-controller.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube/ingress-with-controller.yaml @@ -96,19 +96,6 @@ metadata: data: sonar.properties: | --- -# Source: sonarqube/templates/init-fs.yaml -apiVersion: v1 -kind: ConfigMap -metadata: - name: ingress-with-controller.yaml-sonarqube-init-fs - labels: - app: sonarqube - chart: sonarqube-10.8.0 - release: ingress-with-controller.yaml - heritage: Helm -data: - init_fs.sh: |- ---- # Source: sonarqube/templates/init-sysctl.yaml apiVersion: v1 kind: ConfigMap @@ -121,22 +108,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 --- @@ -842,7 +845,7 @@ spec: metadata: annotations: checksum/config: 25099e6e526d3763aa95f4b54fadf9629562a6ce38bc25dfec69d7c9fe3863c9 - checksum/init-sysctl: 071c109f2b523f380abbb590825f11d96601c885891efdd87dde45d13c80e1b9 + checksum/init-sysctl: 4004af5203bc3b6c427ec8c7a7a4917d78a57802665bf6ea3a47fa8c95f4e4ed checksum/plugins: 5ef5952cbd551dbccd54b9de0c5e736a4ae699c87017ca2ac83f336f03b240c1 checksum/secret: 18dd23ce39e39f9d9414e5617d454413cef3e2d1c934030c421c3399feba0edf labels: diff --git a/tests/unit-compatibility-test/fixtures/sonarqube/install-plugins-values.yaml b/tests/unit-compatibility-test/fixtures/sonarqube/install-plugins-values.yaml index 515ba2a1a..b9c3e6896 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube/install-plugins-values.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube/install-plugins-values.yaml @@ -63,19 +63,6 @@ metadata: data: sonar.properties: | --- -# Source: sonarqube/templates/init-fs.yaml -apiVersion: v1 -kind: ConfigMap -metadata: - name: install-plugins-values.yaml-sonarqube-init-fs - labels: - app: sonarqube - chart: sonarqube-10.8.0 - release: install-plugins-values.yaml - heritage: Helm -data: - init_fs.sh: |- ---- # Source: sonarqube/templates/init-sysctl.yaml apiVersion: v1 kind: ConfigMap @@ -88,22 +75,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 --- @@ -403,7 +406,7 @@ spec: metadata: annotations: checksum/config: 3d192d1c21b4017ec1474c60d4487662b43ab84fba08c2ccf62891619161be09 - checksum/init-sysctl: ed4de81a2f1d036d9871e2d546165dc23c260110834f461403d3262e3f7285ff + checksum/init-sysctl: 4e75f5cc3fc8fc6e797efcdd0d95e42c72f61ad906865d084a76db90f6adfdc1 checksum/plugins: b96a29a42f330cc4792c18b2227062d69683318e92f5833441e954797562192f checksum/secret: 3556b9782a45e1d638d82d39d4b0196981f0dc84b5b684601c6011835826a3eb labels: diff --git a/tests/unit-compatibility-test/fixtures/sonarqube/jdbc-config-values.yaml b/tests/unit-compatibility-test/fixtures/sonarqube/jdbc-config-values.yaml index 6e3b0c7a8..f8ba72d5c 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube/jdbc-config-values.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube/jdbc-config-values.yaml @@ -63,19 +63,6 @@ metadata: data: sonar.properties: | --- -# Source: sonarqube/templates/init-fs.yaml -apiVersion: v1 -kind: ConfigMap -metadata: - name: jdbc-config-values.yaml-sonarqube-init-fs - labels: - app: sonarqube - chart: sonarqube-10.8.0 - release: jdbc-config-values.yaml - heritage: Helm -data: - init_fs.sh: |- ---- # Source: sonarqube/templates/init-sysctl.yaml apiVersion: v1 kind: ConfigMap @@ -88,22 +75,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 --- @@ -400,7 +403,7 @@ spec: metadata: annotations: checksum/config: 43ed886003a628c71349fc2862fffc342679a667414dd58a2f876884cd93cdbf - checksum/init-sysctl: 0496ffa9672e9238097179aeb130b1d52feb35b35c5d42eda17d93551b886cc3 + checksum/init-sysctl: 67c9d448737859aaa665cc2047dd8034728d2047afbd31fa1b8decb97f64dd28 checksum/plugins: 49835ba02b2e34b86e84df5becf84d0be12616708a92d996da5419519522f3a6 checksum/secret: 7caf137d9219207e63d0fc5990e73e0be06d66a1dc45c59bd5cc9ae79f98c40d labels: diff --git a/tests/unit-compatibility-test/fixtures/sonarqube/networkpolicy-new-values.yaml b/tests/unit-compatibility-test/fixtures/sonarqube/networkpolicy-new-values.yaml index 21bf7165d..968cbdb15 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube/networkpolicy-new-values.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube/networkpolicy-new-values.yaml @@ -185,19 +185,6 @@ metadata: data: sonar.properties: | --- -# Source: sonarqube/templates/init-fs.yaml -apiVersion: v1 -kind: ConfigMap -metadata: - name: networkpolicy-new-values.yaml-sonarqube-init-fs - labels: - app: sonarqube - chart: sonarqube-10.8.0 - release: networkpolicy-new-values.yaml - heritage: Helm -data: - init_fs.sh: |- ---- # Source: sonarqube/templates/init-sysctl.yaml apiVersion: v1 kind: ConfigMap @@ -210,22 +197,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 --- @@ -522,7 +525,7 @@ spec: metadata: annotations: checksum/config: 56ce34b636cd55076aac3adb9f4b8169f515233f003d8ca366cd833f8e1f053e - checksum/init-sysctl: 85621e3ec1192c35939006b9e09ccab5cc4eba675150b55512286947919f068b + checksum/init-sysctl: c6b66c011da0760667d1d44bcdf02de85f7828db37870306a3b2c7c96065f985 checksum/plugins: e840a38986d334216d74cd0405ddd6ce2dcfc9fb4c7b9941278c6315acb15239 checksum/secret: 729e3b69229b990cc4e79bf17bd02bbd0147e09bb2b559d7517f63037d84ac69 labels: diff --git a/tests/unit-compatibility-test/fixtures/sonarqube/networkpolicy-values.yaml b/tests/unit-compatibility-test/fixtures/sonarqube/networkpolicy-values.yaml index d3c555c2d..18434f76b 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube/networkpolicy-values.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube/networkpolicy-values.yaml @@ -185,19 +185,6 @@ metadata: data: sonar.properties: | --- -# Source: sonarqube/templates/init-fs.yaml -apiVersion: v1 -kind: ConfigMap -metadata: - name: networkpolicy-values.yaml-sonarqube-init-fs - labels: - app: sonarqube - chart: sonarqube-10.8.0 - release: networkpolicy-values.yaml - heritage: Helm -data: - init_fs.sh: |- ---- # Source: sonarqube/templates/init-sysctl.yaml apiVersion: v1 kind: ConfigMap @@ -210,22 +197,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 --- @@ -522,7 +525,7 @@ spec: metadata: annotations: checksum/config: aee9d06406fd22689852319e6e922ea056f7f49a255f3fdb0bce818c27ee6f9c - checksum/init-sysctl: bd8cd9f72467f35470fec1aa34c662f256535839c5133b84248bc81822a63b45 + checksum/init-sysctl: b45099dbd2c5c86896c7c734dd4e1fef5e99d8a042721e96d47d000a3ab158d5 checksum/plugins: b55000868754ece34420852f88f6203d5016d6a9b90be355c0b2bc064999069b checksum/secret: 5cd050fd16c7002923934cee1fe40e7087ea2e07c4924b41f7a946dc53c6c040 labels: diff --git a/tests/unit-compatibility-test/fixtures/sonarqube/non-default-security-context-values.yaml b/tests/unit-compatibility-test/fixtures/sonarqube/non-default-security-context-values.yaml index cd83832e5..7cedc2922 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube/non-default-security-context-values.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube/non-default-security-context-values.yaml @@ -77,19 +77,6 @@ metadata: data: sonar.properties: | --- -# Source: sonarqube/templates/init-fs.yaml -apiVersion: v1 -kind: ConfigMap -metadata: - name: non-default-security-context-values.yaml-sonarqube-init-fs - labels: - app: sonarqube - chart: sonarqube-10.8.0 - release: non-default-security-context-values.yaml - heritage: Helm -data: - init_fs.sh: |- ---- # Source: sonarqube/templates/init-sysctl.yaml apiVersion: v1 kind: ConfigMap @@ -102,22 +89,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 --- @@ -447,7 +450,7 @@ spec: metadata: annotations: checksum/config: 98a39e78ab7b59578fecdab3eeaa7e5c5ee90eb8a59be56a031f4fb8eb72c918 - checksum/init-sysctl: c494d1b854845bc2f8e46287236afa4ab75c6f64cc194bbc6733bbbce5ff6e23 + checksum/init-sysctl: 07dbd822360d409906ef598b9abe3fc7f9881f3629d7bd57c314433e524090fd checksum/plugins: adf8abbb8e595b0798d61c3e90aa89a5e3c7c8b885b2ce2f73365ef9e5f0a45d checksum/secret: 7deacec3e1f73df62e374b7433a2a41d0341849cd6f12b9b41216c5c4468619b checksum/prometheus-config: 03fedc595a6fcdc34bbce1799cffd9dfb0b09a1d75211448386e453b94ab2ad8 diff --git a/tests/unit-compatibility-test/fixtures/sonarqube/openshift-values.yaml b/tests/unit-compatibility-test/fixtures/sonarqube/openshift-values.yaml index c4d455662..0b489b767 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube/openshift-values.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube/openshift-values.yaml @@ -63,50 +63,6 @@ metadata: data: sonar.properties: | --- -# Source: sonarqube/templates/init-fs.yaml -apiVersion: v1 -kind: ConfigMap -metadata: - name: openshift-values.yaml-sonarqube-init-fs - labels: - app: sonarqube - chart: sonarqube-10.8.0 - release: openshift-values.yaml - heritage: Helm -data: - init_fs.sh: |- ---- -# Source: sonarqube/templates/init-sysctl.yaml -apiVersion: v1 -kind: ConfigMap -metadata: - name: openshift-values.yaml-sonarqube-init-sysctl - labels: - app: sonarqube - chart: sonarqube-10.8.0 - release: openshift-values.yaml - heritage: Helm -data: - init_sysctl.sh: |- - if [[ "$(sysctl -n vm.max_map_count)" -lt 524288 ]]; then - sysctl -w vm.max_map_count=524288 - fi - if [[ "$(sysctl -n fs.file-max)" -lt 131072 ]]; then - sysctl -w fs.file-max=131072 - fi - if [[ "$(ulimit -n)" != "unlimited" ]]; then - if [[ "$(ulimit -n)" -lt 131072 ]]; then - echo "ulimit -n 131072" - ulimit -n 131072 - fi - fi - if [[ "$(ulimit -u)" != "unlimited" ]]; then - if [[ "$(ulimit -u)" -lt 8192 ]]; then - echo "ulimit -u 8192" - ulimit -u 8192 - fi - fi ---- # Source: sonarqube/templates/install-plugins.yaml apiVersion: v1 kind: ConfigMap diff --git a/tests/unit-compatibility-test/fixtures/sonarqube/prometheus-monitoring-values.yaml b/tests/unit-compatibility-test/fixtures/sonarqube/prometheus-monitoring-values.yaml index 6a9c3cfe5..24d3cfadd 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube/prometheus-monitoring-values.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube/prometheus-monitoring-values.yaml @@ -63,19 +63,6 @@ metadata: data: sonar.properties: | --- -# Source: sonarqube/templates/init-fs.yaml -apiVersion: v1 -kind: ConfigMap -metadata: - name: prometheus-monitoring-values.yaml-sonarqube-init-fs - labels: - app: sonarqube - chart: sonarqube-10.8.0 - release: prometheus-monitoring-values.yaml - heritage: Helm -data: - init_fs.sh: |- ---- # Source: sonarqube/templates/init-sysctl.yaml apiVersion: v1 kind: ConfigMap @@ -88,22 +75,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 --- @@ -400,7 +403,7 @@ spec: metadata: annotations: checksum/config: 7b583c24cbb27b2c74108254cb68d186917558ad658999891db4c07f51546dd0 - checksum/init-sysctl: a750acf88e45b67f0752a8ba2b5ca0c50e5a978e9d6e034fb295d0008d50344a + checksum/init-sysctl: 09dc8cb4b954f5433dbf6c0b3eb6f997784d6a91e28cd28485daabbcb5bb7b97 checksum/plugins: 6ded7691c47097e3046f42795b3b7faa79027d2f44346358a88e2fdee1b110cc checksum/secret: 91a0762c3b5e9eb5a4e3cd7595bed38fe508b250af9a47a42e0785fbfaa44300 labels: diff --git a/tests/unit-compatibility-test/fixtures/sonarqube/proxies-secret-values.yaml b/tests/unit-compatibility-test/fixtures/sonarqube/proxies-secret-values.yaml index 0f3913dcc..5221d1162 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube/proxies-secret-values.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube/proxies-secret-values.yaml @@ -63,19 +63,6 @@ metadata: data: sonar.properties: | --- -# Source: sonarqube/templates/init-fs.yaml -apiVersion: v1 -kind: ConfigMap -metadata: - name: proxies-secret-values.yaml-sonarqube-init-fs - labels: - app: sonarqube - chart: sonarqube-10.8.0 - release: proxies-secret-values.yaml - heritage: Helm -data: - init_fs.sh: |- ---- # Source: sonarqube/templates/init-sysctl.yaml apiVersion: v1 kind: ConfigMap @@ -88,22 +75,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 --- @@ -403,7 +406,7 @@ spec: metadata: annotations: checksum/config: d28fcc2871a2d67e47ee65a5da664accb9622e96b73f3185eb519c579611aa39 - checksum/init-sysctl: cbc6c98fac68ca7dd83a761cb840cdfe536583c410e5395ec43bc19562f19d0a + checksum/init-sysctl: 9c745aaf7860200fa568b5bb7dea45bf82b85990e3ff7bb4386d92753136ff0b checksum/plugins: 9d7d759c0979b5db70d8898b51bc6159b82935f7ac7b0839e3c3e76a3dd7c8ae checksum/secret: d723b5bc843dfb1eb0f05368b9afa22bca8fe89b8dab3a3778a82f5941355ab8 labels: diff --git a/tests/unit-compatibility-test/fixtures/sonarqube/proxies-values.yaml b/tests/unit-compatibility-test/fixtures/sonarqube/proxies-values.yaml index dba8ee81c..cd9708ace 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube/proxies-values.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube/proxies-values.yaml @@ -63,19 +63,6 @@ metadata: data: sonar.properties: | --- -# Source: sonarqube/templates/init-fs.yaml -apiVersion: v1 -kind: ConfigMap -metadata: - name: proxies-values.yaml-sonarqube-init-fs - labels: - app: sonarqube - chart: sonarqube-10.8.0 - release: proxies-values.yaml - heritage: Helm -data: - init_fs.sh: |- ---- # Source: sonarqube/templates/init-sysctl.yaml apiVersion: v1 kind: ConfigMap @@ -88,22 +75,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 --- @@ -433,7 +436,7 @@ spec: metadata: annotations: checksum/config: a12b354481a21944c7cd35032a8008f50b693ea15ef3284360605bd9de02c56f - checksum/init-sysctl: f678c8325f810d6bccbe90acd0017c54a888e5fcd6630ce6f4bfe88f5c41c5a8 + checksum/init-sysctl: 341fe81ce00deb669c5f97a1fa427c1458a4037c7054e7d86e4aee973cf7ed4d checksum/plugins: a5d1251cf02dfb0f27baa386720159e744a35c290f9d1c31971702bfdf3917e2 checksum/secret: 4baa4897c1899085edf1b5c254ff945eb94be081446ce86e75df63a8ed3c273b checksum/prometheus-config: efd6763b541ee6b11348af0168dbad964ee0e2cd0a2c66378ffb58da43378c42 diff --git a/tests/unit-compatibility-test/fixtures/sonarqube/pvc-values.yaml b/tests/unit-compatibility-test/fixtures/sonarqube/pvc-values.yaml index 7907ab5ef..1c942e004 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube/pvc-values.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube/pvc-values.yaml @@ -91,22 +91,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 --- @@ -422,8 +438,8 @@ spec: metadata: annotations: checksum/config: 49f318981baf26b116e82be804008f5d3e1243ae44e76c85d0a5741106808a53 - checksum/init-fs: c7f40815c217ac700c13449e5a4f0f35ba8330b0a18878d6ebf38a0cecc7e497 - checksum/init-sysctl: b24d53c3a57874d11db3a427d9187d92f0fad5680679ab11d5fab42de6e1d676 + checksum/init-fs: 3c6fead050158338458c642167bed17b9455f2ad2c139188c70753a8b1637935 + checksum/init-sysctl: 17703a62c334c33dd0a344965db7785a520598a8edd0fc2950ae02d817bee05c checksum/plugins: 0dd5ce415a8f411803332480799c6e163c9887836fb559e24d7f6f33235929b2 checksum/secret: 7c8483b1ae0ba62babeae964bec5955b6476d2caf3e28b861ff2ebe8f145dd7a labels: diff --git a/tests/unit-compatibility-test/fixtures/sonarqube/secret-values.yaml b/tests/unit-compatibility-test/fixtures/sonarqube/secret-values.yaml index 0c322338e..00a5686d3 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube/secret-values.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube/secret-values.yaml @@ -74,19 +74,6 @@ metadata: data: sonar.properties: | --- -# Source: sonarqube/templates/init-fs.yaml -apiVersion: v1 -kind: ConfigMap -metadata: - name: secret-values.yaml-sonarqube-init-fs - labels: - app: sonarqube - chart: sonarqube-10.8.0 - release: secret-values.yaml - heritage: Helm -data: - init_fs.sh: |- ---- # Source: sonarqube/templates/init-sysctl.yaml apiVersion: v1 kind: ConfigMap @@ -99,22 +86,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 --- @@ -196,7 +199,7 @@ spec: metadata: annotations: checksum/config: 4563d23468ccc9913f9d57c3ac5ba765d5011d37ae045a20ec5b1fdfa6eaad2e - checksum/init-sysctl: 9db3a7fa21333afcd31826a95c4154c57310faf593ebd705ae0105ed4af535e3 + checksum/init-sysctl: be931f6bc503c794b8777f4a7fec5ca88bb574436a4855aa9ae8e446c54153cd checksum/plugins: d04ea664d2da595762b4332e7a8357166b0e2f09447d4edb8c901971abd432b4 checksum/secret: d4030bf498378a2849483d5ce9d2ff703659580cf5b9ace0538f6d881c36936a labels: diff --git a/tests/unit-compatibility-test/fixtures/sonarqube/service-values.yaml b/tests/unit-compatibility-test/fixtures/sonarqube/service-values.yaml index 447af714e..af4c85d9b 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube/service-values.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube/service-values.yaml @@ -63,19 +63,6 @@ metadata: data: sonar.properties: | --- -# Source: sonarqube/templates/init-fs.yaml -apiVersion: v1 -kind: ConfigMap -metadata: - name: service-values.yaml-sonarqube-init-fs - labels: - app: sonarqube - chart: sonarqube-10.8.0 - release: service-values.yaml - heritage: Helm -data: - init_fs.sh: |- ---- # Source: sonarqube/templates/init-sysctl.yaml apiVersion: v1 kind: ConfigMap @@ -88,22 +75,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 --- @@ -407,7 +410,7 @@ spec: metadata: annotations: checksum/config: d58e38479620dc3f7747347cad61b7444a93a576f96fa4af92f0cb12f8db4666 - checksum/init-sysctl: b952e162b1f2b9d9f16c882c3b6fa23e795735f763b4cc329305e9764a123c99 + checksum/init-sysctl: a5a21b93136d96a149c53c9dc9e8f3be6979a1f8d67265053f735bc8bf2eb369 checksum/plugins: 86055795524bdb318103ce1359bfdf78dfbe6bca2f5a36052630b802ec96050b checksum/secret: 2b9ed3e56f6bd08d96783f9afdf79e7f5543b383eac6640b44c1fc84edfc9100 labels: diff --git a/tests/unit-compatibility-test/fixtures/sonarqube/serviceaccount-values.yaml b/tests/unit-compatibility-test/fixtures/sonarqube/serviceaccount-values.yaml index 9777b8d3e..25db4517a 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube/serviceaccount-values.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube/serviceaccount-values.yaml @@ -77,19 +77,6 @@ metadata: data: sonar.properties: | --- -# Source: sonarqube/templates/init-fs.yaml -apiVersion: v1 -kind: ConfigMap -metadata: - name: serviceaccount-values.yaml-sonarqube-init-fs - labels: - app: sonarqube - chart: sonarqube-10.8.0 - release: serviceaccount-values.yaml - heritage: Helm -data: - init_fs.sh: |- ---- # Source: sonarqube/templates/init-sysctl.yaml apiVersion: v1 kind: ConfigMap @@ -102,22 +89,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 --- @@ -414,7 +417,7 @@ spec: metadata: annotations: checksum/config: fa2ff53d2bcc9b26f35ea08e3d6e2c7731384e2d93bae5feddc276b6ebe09b9d - checksum/init-sysctl: cc6c42bad0039c1c23c411361869954861df642f71243d8cc0e16c7691d7fef0 + checksum/init-sysctl: 91e8b02757d1113e8c20d4bfa1f52308eab5d75d509d87590e3faf773daef0d6 checksum/plugins: a4cad0d9a4677157364c04db23dc33a82b38a8d0a4e501f0c0721ce89ac6d839 checksum/secret: 62931e85d00bd745aac86227c6bb12717a69b8621143b90c91231e47e55c9811 labels: diff --git a/tests/unit-compatibility-test/fixtures/sonarqube/sonar-web-context-deployment-deprecated-values.yaml b/tests/unit-compatibility-test/fixtures/sonarqube/sonar-web-context-deployment-deprecated-values.yaml index b9687fdc3..ba53fb737 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube/sonar-web-context-deployment-deprecated-values.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube/sonar-web-context-deployment-deprecated-values.yaml @@ -77,19 +77,6 @@ metadata: data: sonar.properties: | --- -# Source: sonarqube/templates/init-fs.yaml -apiVersion: v1 -kind: ConfigMap -metadata: - name: sonar-web-context-deployment-deprecated-values.yaml-sonarqube-init-fs - labels: - app: sonarqube - chart: sonarqube-10.8.0 - release: sonar-web-context-deployment-deprecated-values.yaml - heritage: Helm -data: - init_fs.sh: |- ---- # Source: sonarqube/templates/init-sysctl.yaml apiVersion: v1 kind: ConfigMap @@ -102,22 +89,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 --- @@ -252,7 +255,7 @@ spec: metadata: annotations: checksum/config: 83d23e835621e8550aac7df4b62f60a5f9b5fe4df52b15143d2a4815bc9d8e2d - checksum/init-sysctl: 3071b2a85ebd835e18ff06ba418a1582180045d6158dfd9298d01bdb1f3a89ce + checksum/init-sysctl: c810d71278aac508ef538d3b926a3dbdffe044e1cef70e14d949a8d55033b7bf checksum/plugins: 564927565047ac25a8a3ec87d12f35e70a710b92c130877f4a871d8b8b263e44 checksum/secret: ec0277fb153c63936e081d9676e508d7601dc6da32d70172fb67d74a24539556 labels: diff --git a/tests/unit-compatibility-test/fixtures/sonarqube/sonar-web-context-sts-deprecated-values.yaml b/tests/unit-compatibility-test/fixtures/sonarqube/sonar-web-context-sts-deprecated-values.yaml index af6657553..cbab3495f 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube/sonar-web-context-sts-deprecated-values.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube/sonar-web-context-sts-deprecated-values.yaml @@ -77,19 +77,6 @@ metadata: data: sonar.properties: | --- -# Source: sonarqube/templates/init-fs.yaml -apiVersion: v1 -kind: ConfigMap -metadata: - name: sonar-web-context-sts-deprecated-values.yaml-sonarqube-init-fs - labels: - app: sonarqube - chart: sonarqube-10.8.0 - release: sonar-web-context-sts-deprecated-values.yaml - heritage: Helm -data: - init_fs.sh: |- ---- # Source: sonarqube/templates/init-sysctl.yaml apiVersion: v1 kind: ConfigMap @@ -102,22 +89,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 --- @@ -414,7 +417,7 @@ spec: metadata: annotations: checksum/config: f7ef68f1f42fbc5c159077a48b62140d1f230830e173963cb2f4e1ce867209c8 - checksum/init-sysctl: 85805d4bdf9e647ad8c96eae54871a38f0fc3cc4c727e2db1e828b1720969a48 + checksum/init-sysctl: 3a1214cdaf2dbfadaa14a72b058344f1cdebb019e48018e5cc2c8b321d43946f checksum/plugins: 8a1358bb74a520ff0437ed0f54ad638b35dd297b1ecf93434dbdda9e7aae01b7 checksum/secret: f465577e3c516dfd311e4c5f642cab8d1a6e838b3f2038e60c7b1771ef24ed16 labels: diff --git a/tests/unit-compatibility-test/fixtures/sonarqube/sonar-web-context-values.yaml b/tests/unit-compatibility-test/fixtures/sonarqube/sonar-web-context-values.yaml index 50d8c4795..77a028a0c 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube/sonar-web-context-values.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube/sonar-web-context-values.yaml @@ -77,19 +77,6 @@ metadata: data: sonar.properties: | --- -# Source: sonarqube/templates/init-fs.yaml -apiVersion: v1 -kind: ConfigMap -metadata: - name: sonar-web-context-values.yaml-sonarqube-init-fs - labels: - app: sonarqube - chart: sonarqube-10.8.0 - release: sonar-web-context-values.yaml - heritage: Helm -data: - init_fs.sh: |- ---- # Source: sonarqube/templates/init-sysctl.yaml apiVersion: v1 kind: ConfigMap @@ -102,22 +89,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 --- @@ -414,7 +417,7 @@ spec: metadata: annotations: checksum/config: 235ea0aecb418f31a8795adfe5946e7b0469bf12a80602c184f2ba8002a638c3 - checksum/init-sysctl: 47ab5c6d2edd4a8a92e6b361a70c6919e140b120d97b19fa3a0a8931584069e5 + checksum/init-sysctl: 1f2196fa5495f593f10377b836df5fbb2852406cde39e755d4b873fdeee0250c checksum/plugins: 6227a104e33e6694b96b639f76d867eb7bec84d77210d3a8599ddd1bb456fb51 checksum/secret: d5d5c7043b324c7583b60cacf48a982696184c704e3f03cea33f5f1b2ba66279 labels: diff --git a/tests/unit-compatibility-test/fixtures/sonarqube/template-refactoring-values.yaml b/tests/unit-compatibility-test/fixtures/sonarqube/template-refactoring-values.yaml index 88ea2e0fc..015e4ab55 100644 --- a/tests/unit-compatibility-test/fixtures/sonarqube/template-refactoring-values.yaml +++ b/tests/unit-compatibility-test/fixtures/sonarqube/template-refactoring-values.yaml @@ -91,22 +91,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 --- @@ -420,8 +436,8 @@ spec: metadata: annotations: checksum/config: 184088cec069add83bf28a001d594da39752e76628700027b8bc762cea30a88e - checksum/init-fs: 34ca2b0d3d444857432c1df8e68440100264eddfccd1d5e9d57bfaa9178ad4c7 - checksum/init-sysctl: ef5d387153ec5afc002b87b29388b1c47563c00b4b0376e952b4f850a93ecb37 + checksum/init-fs: 15c28e0593b79f19d5babb0114614da600e2d35d4f5a5f844aa3736bd4d02e3d + checksum/init-sysctl: 293f81a573a4f3d75686af8d7867a4b82f66668a8c45218c099df74fab6a98a5 checksum/plugins: 8e50c5c09611c13e4bd5e93af0fbfa311b22c6c252fbb79423017613ba9a0220 checksum/secret: 2c6a1bba7d620819b2890d4f01b338ab019491be038d1484fc047695be1f003c labels: diff --git a/tests/unit-compatibility-test/sonarqube/non-default-security-context-values.yaml b/tests/unit-compatibility-test/sonarqube/non-default-security-context-values.yaml index 05e72ee93..bf9408640 100644 --- a/tests/unit-compatibility-test/sonarqube/non-default-security-context-values.yaml +++ b/tests/unit-compatibility-test/sonarqube/non-default-security-context-values.yaml @@ -61,7 +61,7 @@ initSysctl: fsFileMax: 131072 nofile: 131072 nproc: 8192 - # image: busybox:1.36 + # image: ubuntu:24.04 securityContext: {} initFs: