Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/ctrlplane/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: ctrlplane
description: Ctrlplane Helm chart for Kubernetes
type: application
version: 0.3.12
version: 0.3.13
appVersion: "1.16.0"

maintainers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,7 @@ spec:
{{- end }}
{{- include "ctrlplane.extraEnv" . | nindent 12 }}
{{- include "ctrlplane.extraEnvFrom" (dict "root" $ "local" .) | nindent 12 }}
- name: ENABLE_NEW_POLICY_ENGINE
value: {{ .Values.global.enableNewPolicyEngine | quote }}
Comment on lines +106 to +107
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Prevent nil pointer on .Values.global.enableNewPolicyEngine
As with the webservice subchart, a direct reference to the global flag can trigger a nil pointer. Either add a global entry in charts/event-worker/values.yaml or wrap this in an if guard and apply a default:

-            - name: ENABLE_NEW_POLICY_ENGINE
-              value: {{ .Values.global.enableNewPolicyEngine | quote }}
+{{- if .Values.global }}
+            - name: ENABLE_NEW_POLICY_ENGINE
+              value: {{ default false .Values.global.enableNewPolicyEngine | quote }}
+{{- end }}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: ENABLE_NEW_POLICY_ENGINE
value: {{ .Values.global.enableNewPolicyEngine | quote }}
{{- if .Values.global }}
- name: ENABLE_NEW_POLICY_ENGINE
value: {{ default false .Values.global.enableNewPolicyEngine | quote }}
{{- end }}

resources:
{{- toYaml .Values.resources | nindent 12 }}
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ spec:
# - name: OTEL_EXPORTER_OTLP_ENDPOINT
# value: http://{{ $.Release.Name }}-otel:4318
{{- end }}
- name: ENABLE_NEW_POLICY_ENGINE
value: {{ .Values.global.enableNewPolicyEngine | quote }}
{{- with (include "ctrlplane.azureApp" . | fromYaml) }}
- name: AZURE_APP_CLIENT_ID
value: {{ .clientId | quote }}
Expand Down
1 change: 1 addition & 0 deletions charts/ctrlplane/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ global:

extraEnvFrom: {}
extraEnv: {}
enableNewPolicyEngine: false

authProviders:
google:
Expand Down