Skip to content

Commit dee6339

Browse files
committed
feat(hyades): separate Job and Pod metadata for initializer
Split annotations and labels into Job-level and Pod-template-level to allow independent customization. Add support for custom labels on both Job and Pod. Wrap labels blocks in conditional to prevent rendering empty labels fields. Signed-off-by: rseleven <73898556+rseleven@users.noreply.github.com>
1 parent 1c2683d commit dee6339

5 files changed

Lines changed: 46 additions & 9 deletions

File tree

charts/hyades/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apiVersion: v2
22
name: hyades
3-
version: 0.22.0
3+
version: 0.22.1
44
type: application
55
appVersion: 5.0.2
66
description: |-

charts/hyades/README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# hyades
22

3-
![Version: 0.22.0](https://img.shields.io/badge/Version-0.22.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 5.0.2](https://img.shields.io/badge/AppVersion-5.0.2-informational?style=flat-square)
3+
![Version: 0.22.1](https://img.shields.io/badge/Version-0.22.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 5.0.2](https://img.shields.io/badge/AppVersion-5.0.2-informational?style=flat-square)
44

55
Hyades is the preview chart for Dependency-Track v5.
66

@@ -148,8 +148,11 @@ v2, or be ready to migrate when v2 is released.
148148
| initializer.image.registry | string | `""` | Override common.image.registry for the API server. |
149149
| initializer.image.repository | string | `"dependencytrack/apiserver"` | |
150150
| initializer.image.tag | string | `""` | Can be a tag name such as "latest", or an image digest prefixed with "sha256:". |
151+
| initializer.labels | object | `{}` | |
151152
| initializer.noHelmHook | bool | `false` | Whether to NOT deploy the initializer Job as `post-install` and `post-upgrade` Helm hook. Deploying as Helm hook can create deadlock situations when `helm install` and `helm upgrade` are executed with `--wait` flag. See <https://github.com/helm/helm/issues/10555>. Note that without hooks, `helm upgrade` may fail due to Job fields being immutable. |
152153
| initializer.nodeSelector | object | `{}` | |
154+
| initializer.podAnnotations | object | `{}` | |
155+
| initializer.podLabels | object | `{}` | |
153156
| initializer.resources.limits.memory | string | `"256Mi"` | |
154157
| initializer.resources.requests.cpu | string | `"150m"` | |
155158
| initializer.resources.requests.memory | string | `"256Mi"` | |
@@ -161,3 +164,5 @@ v2, or be ready to migrate when v2 is released.
161164
| initializer.waiter.image.repository | string | `"bitnami/kubectl"` | |
162165
| initializer.waiter.image.tag | string | `"latest"` | |
163166

167+
----------------------------------------------
168+
Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2)

charts/hyades/templates/initializer/job.yaml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,36 @@ kind: Job
55
metadata:
66
name: {{ include "hyades.initializerFullname" . }}
77
namespace: {{ .Release.Namespace }}
8-
labels: {{- include "hyades.initializerLabels" . | nindent 4 }}
9-
{{- if not .Values.initializer.noHelmHook }}
8+
{{- if or (not .Values.initializer.noHelmHook) .Values.initializer.annotations }}
109
annotations:
10+
{{- if not .Values.initializer.noHelmHook }}
1111
"helm.sh/hook": "post-install, post-upgrade"
1212
"helm.sh/hook-delete-policy": "before-hook-creation"
13+
{{- end }}
14+
{{- with .Values.initializer.annotations }}
15+
{{- toYaml . | nindent 4 }}
16+
{{- end }}
17+
{{- end }}
18+
{{- if or (include "hyades.initializerLabels" . | trim) .Values.initializer.labels }}
19+
labels:
20+
{{- include "hyades.initializerLabels" . | nindent 4 }}
21+
{{- with .Values.initializer.labels }}
22+
{{- toYaml . | nindent 4 }}
23+
{{- end }}
1324
{{- end }}
1425
spec:
1526
template:
1627
metadata:
17-
labels: {{- include "hyades.initializerSelectorLabels" . | nindent 8 }}
18-
{{- with .Values.initializer.annotations }}
28+
{{- with .Values.initializer.podAnnotations }}
1929
annotations: {{- toYaml . | nindent 8 }}
2030
{{- end }}
31+
{{- if or (include "hyades.initializerSelectorLabels" . | trim) .Values.initializer.podLabels }}
32+
labels:
33+
{{- include "hyades.initializerSelectorLabels" . | nindent 8 }}
34+
{{- with .Values.initializer.podLabels }}
35+
{{- toYaml . | nindent 8 }}
36+
{{- end }}
37+
{{- end }}
2138
spec:
2239
restartPolicy: Never
2340
serviceAccountName: {{ include "hyades.serviceAccountName" . }}
@@ -79,4 +96,4 @@ spec:
7996
volumes:
8097
- name: tmp
8198
emptyDir: {}
82-
{{- end }}
99+
{{- end }}

charts/hyades/values.schema.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,21 @@
144144
"enabled": {
145145
"type": "boolean"
146146
},
147+
"noHelmHook": {
148+
"type": "boolean"
149+
},
150+
"labels": {
151+
"type": "object"
152+
},
147153
"annotations": {
148154
"type": "object"
149155
},
156+
"podLabels": {
157+
"type": "object"
158+
},
159+
"podAnnotations": {
160+
"type": "object"
161+
},
150162
"image": {
151163
"$ref": "#/$defs/image"
152164
},

charts/hyades/values.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ apiServer:
5656
allowPrivilegeEscalation: false
5757
capabilities:
5858
drop:
59-
- ALL
59+
- ALL
6060
runAsNonRoot: true
6161
readOnlyRootFilesystem: true
6262
seccompProfile:
@@ -138,7 +138,10 @@ initializer:
138138
# and `helm upgrade` are executed with `--wait` flag. See <https://github.com/helm/helm/issues/10555>.
139139
# Note that without hooks, `helm upgrade` may fail due to Job fields being immutable.
140140
noHelmHook: false
141+
labels: {}
141142
annotations: {}
143+
podLabels: {}
144+
podAnnotations: {}
142145
image: *apiServerImage
143146
command: []
144147
args: []
@@ -203,7 +206,7 @@ frontend:
203206
allowPrivilegeEscalation: false
204207
capabilities:
205208
drop:
206-
- ALL
209+
- ALL
207210
runAsNonRoot: true
208211
# RO filesystems are not supported by the frontend
209212
readOnlyRootFilesystem: false

0 commit comments

Comments
 (0)