Skip to content

Commit 34601ea

Browse files
atoulmejvoravong
andauthored
[chart] use the ubi image to perform secret validation (#1635)
* [chart] use the ubi image to perform secret validation * Update helm-charts/splunk-otel-collector/values.yaml Co-authored-by: jvoravong <[email protected]> --------- Co-authored-by: jvoravong <[email protected]>
1 parent 2a6d764 commit 34601ea

File tree

6 files changed

+52
-3
lines changed

6 files changed

+52
-3
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
2+
change_type: enhancement
3+
# The name of the component, or a single word describing the area of concern, (e.g. agent, clusterReceiver, gateway, operator, chart, other)
4+
component: chart
5+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
6+
note: Offer to use the UBI image to perform secret validation
7+
# One or more tracking issues related to the change
8+
issues: [1635]
9+
# (Optional) One or more lines of additional information to render under the primary note.
10+
# These lines will be padded with 2 spaces and then inserted directly into the document.
11+
# Use pipe (|) for multiline entries.
12+
subtext:

examples/secret-validation/rendered_manifests/secret-splunk-validation-hook.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ spec:
2020
restartPolicy: Never
2121
containers:
2222
- name: validate-secret
23-
image: quay.io/signalfx/splunk-otel-collector:0.117.0
23+
image: registry.access.redhat.com/ubi9/ubi
2424
imagePullPolicy: IfNotPresent
2525
command: ["sh", "-c"]
2626
args:

helm-charts/splunk-otel-collector/templates/_helpers.tpl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,13 @@ Create the patch-log-dirs image name.
220220
{{- printf "%s:%s" .Values.image.initPatchLogDirs.repository .Values.image.initPatchLogDirs.tag | trimSuffix ":" -}}
221221
{{- end -}}
222222

223+
{{/*
224+
Create the validateSecret image name.
225+
*/}}
226+
{{- define "splunk-otel-collector.image.validateSecret" -}}
227+
{{- printf "%s:%s" .Values.image.initPatchLogDirs.repository .Values.image.initPatchLogDirs.tag | trimSuffix ":" -}}
228+
{{- end -}}
229+
223230
{{/*
224231
This helper converts the input value of memory to MiB.
225232
Input needs to be a valid value as supported by k8s memory resource field.

helm-charts/splunk-otel-collector/templates/secret-splunk-validation-hook.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ spec:
1515
restartPolicy: Never
1616
containers:
1717
- name: validate-secret
18-
image: {{ template "splunk-otel-collector.image.otelcol" . }}
19-
imagePullPolicy: {{ .Values.image.otelcol.pullPolicy }}
18+
image: {{ template "splunk-otel-collector.image.validateSecret" . }}
19+
imagePullPolicy: {{ .Values.image.validateSecret.pullPolicy }}
2020
command: ["sh", "-c"]
2121
args:
2222
- if [ "{{ include "splunk-otel-collector.splunkO11yEnabled" . }}" = "true" ] && [ ! -f /otel/secret/splunk_observability_access_token ]; then

helm-charts/splunk-otel-collector/values.schema.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,6 +1123,26 @@
11231123
]
11241124
}
11251125
}
1126+
},
1127+
"validateSecret": {
1128+
"type": "object",
1129+
"additionalProperties": false,
1130+
"properties": {
1131+
"repository": {
1132+
"type": "string"
1133+
},
1134+
"tag": {
1135+
"type": "string"
1136+
},
1137+
"pullPolicy": {
1138+
"type": "string",
1139+
"enum": [
1140+
"IfNotPresent",
1141+
"Always",
1142+
"Never"
1143+
]
1144+
}
1145+
}
11261146
}
11271147
}
11281148
},

helm-charts/splunk-otel-collector/values.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -975,6 +975,16 @@ image:
975975
# The policy that specifies when the user wants the Universal Base images to be pulled
976976
pullPolicy: IfNotPresent
977977

978+
# Image to be used by a container to validate the secret's presence ahead of starting a helm install or upgrade using pre-install and pre-upgrade Helm hooks.
979+
# Effective only if `secret.create` is set to false and `secret.validateSecret` is set to true (default).
980+
validateSecret:
981+
# The registry and name of the Universal Base Image 9 image to pull
982+
repository: registry.access.redhat.com/ubi9/ubi
983+
# The tag of the Universal Base Image 9, default value is latest
984+
tag: ""
985+
# The policy that specifies when the user wants the Universal Base images to be pulled
986+
pullPolicy: IfNotPresent
987+
978988

979989
################################################################################
980990
# Extra system configuration

0 commit comments

Comments
 (0)