Skip to content
This repository was archived by the owner on Jun 24, 2022. It is now read-only.

Commit 8e7903c

Browse files
committed
more fixes to hook
1 parent 080faf8 commit 8e7903c

File tree

1 file changed

+21
-22
lines changed

1 file changed

+21
-22
lines changed

charts/sonatype-nexus/templates/initpwd-job.yaml

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,62 +3,61 @@
33
apiVersion: batch/v1
44
kind: Job
55
metadata:
6-
name: {{ template "nexus.name" . }}-initpwd-job
6+
name: {{ template "nexus.fullname" . }}-initpwd-job
77
annotations:
8-
helm.sh/hook: post-install
9-
helm.sh/hook-delete-policy: "hook-succeeded,before-hook-creation"
8+
helm.sh/hook: "post-install"
9+
helm.sh/hook-weight: "10"
10+
helm.sh/hook-delete-policy: "before-hook-creation"
1011
labels:
1112
{{ include "nexus.labels" . | indent 4 }}
1213
spec:
1314
backoffLimit: 5
1415
template:
1516
metadata:
16-
name: {{ template "nexus.name" . }}-initpwd
17+
name: {{ template "nexus.fullname" . }}-initpwd
1718
labels:
1819
app: {{ template "nexus.name" . }}
1920
release: {{ .Release.Name }}
2021
spec:
2122
restartPolicy: Never
2223
containers:
2324
- name: nexus-initpwd
24-
image: busybox:1.32.0
25+
image: curlimages/curl:7.73.0
2526
command:
26-
- /bin/bash
27-
- -c
28-
args:
29-
- >-
30-
curl -X PUT
31-
-H "Content-Type: text/plain"
32-
-H "Authorization: Basic $(NEXUS_AUTHORIZATION)"
33-
--fail
34-
-s
35-
-d "$(ADMIN_PASSWORD)"
36-
"http://$(NEXUS_HOST)/service/rest/beta/security/users/admin/change-password"
27+
- /bin/sh
28+
- -ec
29+
- |
30+
curl --fail -X PUT \
31+
http://$(NEXUS_HOST)/service/rest/beta/security/users/admin/change-password \
32+
-H "Content-Type: text/plain" \
33+
-H "Authorization: Basic $(NEXUS_AUTHORIZATION)" \
34+
-d "$(ADMIN_PASSWORD)"
3735
env:
3836
- name: NEXUS_AUTHORIZATION
3937
valueFrom:
4038
secretKeyRef:
4139
key: nexusAuthorization
42-
name: {{ template "nexus.name" . }}-initpwd-secret
40+
name: {{ template "nexus.fullname" . }}-initpwd-secret
4341
- name: NEXUS_HOST
44-
value: {{ template "nexus.name" . }}-service.{{ .Release.Namespace }}:{{ .Values.nexus.nexusPort }}
42+
value: {{ template "nexus.fullname" . }}.{{ .Release.Namespace }}:{{ .Values.nexus.nexusPort }}
4543
- name: ADMIN_PASSWORD
4644
valueFrom:
4745
secretKeyRef:
4846
key: adminPassword
49-
name: {{ template "nexus.name" . }}-initpwd-secret
47+
name: {{ template "nexus.fullname" . }}-initpwd-secret
5048
---
5149
apiVersion: v1
5250
kind: Secret
5351
metadata:
54-
name: {{ template "nexus.name" . }}-initpwd-secret
52+
name: {{ template "nexus.fullname" . }}-initpwd-secret
5553
annotations:
56-
helm.sh/hook: post-install
54+
helm.sh/hook: "post-install"
55+
helm.sh/hook-weight: "-10"
5756
helm.sh/hook-delete-policy: "hook-succeeded,before-hook-creation"
5857
labels:
5958
{{ include "nexus.labels" . | indent 4 }}
6059
type: Opaque
6160
data:
62-
nexusAuthorization: {{ printf "%s%s" "admin:" (default "admin123" .Values.initAdminPassword.defaultPasswordOverride) | b64enc }}
61+
nexusAuthorization: {{ printf "%s%s" "admin:" (default "admin123" .Values.initAdminPassword.defaultPasswordOverride) | b64enc | b64enc }}
6362
adminPassword: {{ .Values.initAdminPassword.password | b64enc }}
6463
{{- end }}

0 commit comments

Comments
 (0)