Skip to content

Commit 7a4165a

Browse files
authored
fix(nexus3): prepare removal of chown-data-dir initContainer (#1238)
1 parent 9fdc2a4 commit 7a4165a

File tree

6 files changed

+18
-0
lines changed

6 files changed

+18
-0
lines changed

charts/nexus3/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@
1515

1616
## [UNRELEASED]
1717

18+
### Added
19+
20+
- Add `chownDataDir` chart value to allow for opting out of the _chown-data-dir_ init container. ([#1238](https://github.com/stevehipwell/helm-charts/pull/1238)) _@falltrades_
21+
22+
### Deprecated
23+
24+
- Deprecate the `chownDataDir` default chart value of `true`, the default value will be changed to `false` in the next chart major version. ([#1238](https://github.com/stevehipwell/helm-charts/pull/1238)) _@falltrades_
25+
1826
## [v5.13.1] - 2025-08-20
1927

2028
### Changed

charts/nexus3/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ helm upgrade --install nexus3 stevehipwell/nexus3 --version 5.13.1
5656
| bashImage.tag | string | `"latest"` | Image tag for bash containers, this will be omitted if set to `-`. |
5757
| caCerts.enabled | bool | `false` | If `true`, add the CA certificates in the provided secret to the JVM cacerts key store. |
5858
| caCerts.secret | string | `nil` | Name of the secret containing the CA certificates. |
59+
| chownDataDir | bool | `true` | If `true`, the _chown-data-dir_ init container will be enabled, this should not be required for most CSI drivers but is left in for backwards compatibility. For new chart installs this should be set to `false`. |
5960
| commonLabels | object | `{}` | Labels to add to all chart resources. |
6061
| config.anonymous.enabled | bool | `false` | If `true`, enable anonymous access. |
6162
| config.anonymous.roles | list | `["nx-anonymous","nx-metrics"]` | Roles for anonymous access. |

charts/nexus3/ci/kubeconform.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ plugins:
106106
- name: nexus-repository-composer
107107
url: https://repo1.maven.org/maven2/org/sonatype/nexus/plugins/nexus-repository-composer/0.0.29/nexus-repository-composer-0.0.29-bundle.kar
108108

109+
chownDataDir: true
110+
109111
rootPassword:
110112
secret: nexus3-creds
111113
key: password

charts/nexus3/templates/configmap-scripts.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ data:
2222
{{- range .Values.plugins }}
2323
curl -fLo /deploy/{{ .name }}.kar {{ .url }}
2424
{{- end }}
25+
{{- if .Values.chownDataDir }}
2526
chown-data-dir.sh: |
2627
#!/usr/bin/env bash
2728
set -euo pipefail
@@ -35,6 +36,7 @@ data:
3536
touch -a /nexus-data/log/request.log
3637
3738
chown -R {{ .Values.podSecurityContext.fsGroup }}:{{ .Values.podSecurityContext.fsGroup }} /nexus-data
39+
{{- end }}
3840
tail-logs.sh: |
3941
#!/usr/bin/env bash
4042
set -euo pipefail

charts/nexus3/templates/statefulset.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ spec:
113113
{{- with .Values.extraInitContainers }}
114114
{{- toYaml . | nindent 8 }}
115115
{{- end }}
116+
{{- if .Values.chownDataDir }}
116117
- name: chown-data-dir
117118
image: {{ include "nexus3.image" .Values.bashImage }}
118119
imagePullPolicy: {{ .Values.bashImage.pullPolicy }}
@@ -134,6 +135,7 @@ spec:
134135
subPath: chown-data-dir.sh
135136
- mountPath: /nexus-data
136137
name: data
138+
{{- end }}
137139
{{- if (semverCompare ">= 1.29-0" .Capabilities.KubeVersion.Version) }}
138140
- name: tail-request-log
139141
restartPolicy: Always

charts/nexus3/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,9 @@ plugins: []
292292
# - name: nexus-repository-composer
293293
# url: https://repo1.maven.org/maven2/org/sonatype/nexus/plugins/nexus-repository-composer/0.0.29/nexus-repository-composer-0.0.29-bundle.kar
294294

295+
# -- If `true`, the _chown-data-dir_ init container will be enabled, this should not be required for most CSI drivers but is left in for backwards compatibility. For new chart installs this should be set to `false`.
296+
chownDataDir: true
297+
295298
rootPassword:
296299
# -- (string) Name of the secret containing the root password.
297300
secret:

0 commit comments

Comments
 (0)