From a1cbfb50542ea17626e5e746bb450e0e0c67d2bc Mon Sep 17 00:00:00 2001 From: Preet Shah <48907607+preetsshah@users.noreply.github.com> Date: Mon, 8 Jan 2024 18:54:33 +0530 Subject: [PATCH] Fix null value secrets (#204) * Update secret and helper templates to avoid empty secret creation * Update secret template file with correct indentation * Update secret template file * Remove extra function from _helpers.tpl --- charts/openmetadata/templates/_helpers.tpl | 10 ++++++++++ charts/openmetadata/templates/secrets.yaml | 4 +++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/charts/openmetadata/templates/_helpers.tpl b/charts/openmetadata/templates/_helpers.tpl index 5aed5853..0a1d0f14 100644 --- a/charts/openmetadata/templates/_helpers.tpl +++ b/charts/openmetadata/templates/_helpers.tpl @@ -96,6 +96,16 @@ Warning to update openmetadata global keyword to openmetadata.config */}} {{- printf "Error: %s" . | fail }} {{- end }} +{{/* +Function to check if passed value is empty string or null value */}} +{{- define "OpenMetadata.utils.checkEmptyString" -}} +{{- if or (empty .) (eq . "") -}} +{{- false -}} +{{- else -}} +{{- true -}} +{{- end -}} +{{- end -}} + {{/* OpenMetadata Configurations Environment Variables*/}} {{- define "OpenMetadata.configs" -}} diff --git a/charts/openmetadata/templates/secrets.yaml b/charts/openmetadata/templates/secrets.yaml index 9b26f551..70be76e7 100644 --- a/charts/openmetadata/templates/secrets.yaml +++ b/charts/openmetadata/templates/secrets.yaml @@ -64,12 +64,14 @@ metadata: type: Opaque data: {{- with .Values.openmetadata.config.pipelineServiceClientConfig }} +{{- if eq (include "OpenMetadata.utils.checkEmptyString" .hostIp) "true" }} + PIPELINE_SERVICE_CLIENT_HOST_IP: {{ .hostIp | quote | b64enc }} +{{- end }} PIPELINE_SERVICE_CLIENT_ENABLED: {{ .enabled | quote | b64enc }} PIPELINE_SERVICE_CLIENT_CLASS_NAME: {{ .className | quote | b64enc }} PIPELINE_SERVICE_IP_INFO_ENABLED: {{ .ingestionIpInfoEnabled | quote | b64enc }} PIPELINE_SERVICE_CLIENT_ENDPOINT: {{ .apiEndpoint | b64enc }} PIPELINE_SERVICE_CLIENT_VERIFY_SSL: {{ .verifySsl | quote | b64enc }} - PIPELINE_SERVICE_CLIENT_HOST_IP: {{ .hostIp | b64enc }} PIPELINE_SERVICE_CLIENT_HEALTH_CHECK_INTERVAL: {{ .healthCheckInterval | quote | b64enc }} PIPELINE_SERVICE_CLIENT_SSL_CERT_PATH: {{ .sslCertificatePath | quote | b64enc }} SERVER_HOST_API_URL: {{ .metadataApiEndpoint | b64enc }}