Skip to content

Commit 427fcbd

Browse files
authored
Merge branch 'main' into chore/remove-nexus
2 parents 0a43406 + 2864476 commit 427fcbd

File tree

4 files changed

+77
-4
lines changed

4 files changed

+77
-4
lines changed

.github/workflows/generate_prs.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,24 @@ on:
99
message:
1010
description: "Message to include in the generated commits:"
1111
required: true
12+
custom-pr-title:
13+
description: "Optionally a custom PR title. If unset, default will be used"
1214
dry-run:
1315
description: "Dry Run (PRs are not generated)"
1416
type: boolean
1517
default: true
18+
fail-fast:
19+
description: "Fail fast (if one job fails, all other are cancelled)"
20+
type: boolean
21+
default: false
1622

1723
permissions: {}
1824

1925
jobs:
2026
create-prs:
2127
runs-on: ubuntu-latest
2228
strategy:
29+
fail-fast: ${{ inputs.fail-fast }}
2330
# If you add a new repository here, also add it to config/repositories.yaml
2431
matrix:
2532
repository:
@@ -155,12 +162,18 @@ jobs:
155162
# Generate PRs
156163
- name: Run playbook
157164
if: ${{ !inputs.dry-run }}
165+
env:
166+
CUSTOM_PR_TITLE: ${{ inputs.custom-pr-title }}
167+
GH_ACCESS_TOKEN: ${{ secrets.gh_access_token }}
158168
run: |
159169
# Funnel via JSON to ensure that values are escaped properly
160-
echo '{}' | jq '{commit_hash: $ENV.GITHUB_SHA, author: $ENV.AUTHOR, reason: $ENV.REASON, base_dir: $pwd, gh_access_token: $ENV.GH_ACCESS_TOKEN}' --arg pwd "$(pwd)" > vars.json
170+
# Check if custom PR title is set. If so, insert it into the extra vars
171+
if [ -n "$CUSTOM_PR_TITLE" ]; then
172+
echo '{}' | jq '{commit_hash: $ENV.GITHUB_SHA, author: $ENV.AUTHOR, reason: $ENV.REASON, custom_pr_title: $ENV.CUSTOM_PR_TITLE, base_dir: $pwd, gh_access_token: $ENV.GH_ACCESS_TOKEN}' --arg pwd "$(pwd)" > vars.json
173+
else
174+
echo '{}' | jq '{commit_hash: $ENV.GITHUB_SHA, author: $ENV.AUTHOR, reason: $ENV.REASON, base_dir: $pwd, gh_access_token: $ENV.GH_ACCESS_TOKEN}' --arg pwd "$(pwd)" > vars.json
175+
fi
161176
ansible-playbook playbook/playbook.yaml --extra-vars "@vars.json"
162-
env:
163-
GH_ACCESS_TOKEN: ${{ secrets.gh_access_token }}
164177
165178
# Do Not Generate PRs
166179
- name: Run playbook (dry-run)

playbook/group_vars/all/vars

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ commit_message: |
1919
Reference-to: stackabletech/operator-templating@{{ commit_short_hash }} ({{ reason }})
2020

2121
# Title and body of created PRs
22-
pr_title: "chore: Update templated files ({{ commit_short_hash }})"
22+
pr_title: "{{ custom_pr_title | default('chore: Update templated files (' + commit_short_hash + ')') }}"
2323
pr_body: |
2424
> [!NOTE]
2525
> _Autogenerated PR to update templated files since the last template run up to stackabletech/operator-templating@{{ commit_hash }}._
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{{/*
2+
Create a list of telemetry related env vars.
3+
*/}}
4+
{{- define "telemetry.envVars" -}}
5+
{{- with .Values.telemetry }}
6+
{{- if not .consoleLog.enabled }}
7+
- name: CONSOLE_LOG_DISABLED
8+
value: "true"
9+
{{- end }}
10+
{{- if and .consoleLog.enabled .consoleLog.level }}
11+
- name: CONSOLE_LOG_LEVEL
12+
value: {{ .consoleLog.level }}
13+
{{ end }}
14+
{{- if and .consoleLog.enabled .consoleLog.format }}
15+
- name: CONSOLE_LOG_FORMAT
16+
value: {{ .consoleLog.format }}
17+
{{ end }}
18+
{{- if .fileLog.enabled }}
19+
- name: FILE_LOG_DIRECTORY
20+
value: /stackable/logs/{{ include "operator.appname" $ }}
21+
{{- end }}
22+
{{- if and .fileLog.enabled .fileLog.level }}
23+
- name: FILE_LOG_LEVEL
24+
value: {{ .fileLog.level }}
25+
{{- end }}
26+
{{- if and .fileLog.enabled .fileLog.rotationPeriod }}
27+
- name: FILE_LOG_ROTATION_PERIOD
28+
value: {{ .fileLog.rotationPeriod }}
29+
{{- end }}
30+
{{- if and .fileLog.enabled .fileLog.maxFiles }}
31+
- name: FILE_LOG_MAX_FILES
32+
value: {{ quote .fileLog.maxFiles }}
33+
{{- end }}
34+
{{- if .otelLogExporter.enabled }}
35+
- name: OTEL_LOG_EXPORTER_ENABLED
36+
value: "true"
37+
{{- end }}
38+
{{- if and .otelLogExporter.enabled .otelLogExporter.level }}
39+
- name: OTEL_LOG_EXPORTER_LEVEL
40+
value: {{ .otelLogExporter.level }}
41+
{{- end }}
42+
{{- if and .otelLogExporter.enabled .otelLogExporter.endpoint }}
43+
- name: OTEL_EXPORTER_OTLP_LOGS_ENDPOINT
44+
value: {{ .otelLogExporter.endpoint }}
45+
{{- end }}
46+
{{- if .otelTraceExporter.enabled }}
47+
- name: OTEL_TRACE_EXPORTER_ENABLED
48+
value: "true"
49+
{{- end }}
50+
{{- if and .otelTraceExporter.enabled .otelTraceExporter.level }}
51+
- name: OTEL_TRACE_EXPORTER_LEVEL
52+
value: {{ .otelTraceExporter.level }}
53+
{{- end }}
54+
{{- if and .otelTraceExporter.enabled .otelTraceExporter.endpoint }}
55+
- name: OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
56+
value: {{ .otelTraceExporter.endpoint }}
57+
{{- end }}
58+
{{- end }}
59+
{{- end }}

template/deploy/helm/[[operator]]/templates/deployment.yaml.j2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ spec:
5252
- name: KUBERNETES_CLUSTER_DOMAIN
5353
value: {{ .Values.kubernetesClusterDomain | quote }}
5454
{{- end }}
55+
{{- include "telemetry.envVars" . | nindent 12 }}
5556
{[% if operator.product_string in ['kafka'] %}]
5657
- name: KAFKA_BROKER_CLUSTERROLE
5758
value: {{ include "operator.fullname" . }}-kafka-broker-clusterrole

0 commit comments

Comments
 (0)