From d3cf5403fc3ee7e6f54d641664aa67bd55096d39 Mon Sep 17 00:00:00 2001 From: Dmytro Matviichuk Date: Wed, 10 Dec 2025 00:52:41 +0100 Subject: [PATCH] refactor(hyperswitch-card-vault): move locker log console config to values.yaml - Move LOCKER__LOG__CONSOLE__ENABLED, LOCKER__LOG__CONSOLE__LEVEL, and LOCKER__LOG__CONSOLE__LOG_FORMAT from hardcoded values to values.yaml - Add helper functions in _helpers.tpl using include pattern: - locker.log.console.enabled - locker.log.console.level - locker.log.console.log_format - Update deployment.yaml to use include functions instead of hardcoded values - Add server.log.console configuration section to values.yaml with defaults --- .../hyperswitch-card-vault/Chart.yaml | 2 +- .../hyperswitch-card-vault/README.md | 5 +++- .../templates/_helpers.tpl | 25 +++++++++++++++++++ .../templates/deployment.yaml | 6 ++--- .../hyperswitch-card-vault/values.yaml | 9 +++++++ 5 files changed, 42 insertions(+), 5 deletions(-) diff --git a/charts/incubator/hyperswitch-card-vault/Chart.yaml b/charts/incubator/hyperswitch-card-vault/Chart.yaml index 78b8a04e..696be77a 100644 --- a/charts/incubator/hyperswitch-card-vault/Chart.yaml +++ b/charts/incubator/hyperswitch-card-vault/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.5 +version: 0.1.6 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/incubator/hyperswitch-card-vault/README.md b/charts/incubator/hyperswitch-card-vault/README.md index 9772b279..c34bf8f1 100644 --- a/charts/incubator/hyperswitch-card-vault/README.md +++ b/charts/incubator/hyperswitch-card-vault/README.md @@ -1,6 +1,6 @@ # hyperswitch-card-vault -![Version: 0.1.5](https://img.shields.io/badge/Version-0.1.5-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.16.0](https://img.shields.io/badge/AppVersion-1.16.0-informational?style=flat-square) +![Version: 0.1.6](https://img.shields.io/badge/Version-0.1.6-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.16.0](https://img.shields.io/badge/AppVersion-1.16.0-informational?style=flat-square) "application" A Helm chart for creating Hyperswitch Card Vault @@ -175,6 +175,9 @@ external: | server.host | string | `"0.0.0.0"` | | | server.image | string | `"juspaydotin/hyperswitch-card-vault:v0.6.5-dev"` | | | server.imageRegistry | string | `"docker.juspay.io"` | | +| server.log.console.enabled | bool | `true` | Enable console logging | +| server.log.console.level | string | `"DEBUG"` | Log level for console logs (ERROR, WARN, INFO, DEBUG) | +| server.log.console.log_format | string | `"default"` | Log format for console logs (default or json) | | server.pod.annotations | object | `{}` | | | server.port | string | `"8080"` | | | server.vault.url | string | `"http://127.0.0.1:8200"` | | diff --git a/charts/incubator/hyperswitch-card-vault/templates/_helpers.tpl b/charts/incubator/hyperswitch-card-vault/templates/_helpers.tpl index 6a9fb203..674d6c60 100644 --- a/charts/incubator/hyperswitch-card-vault/templates/_helpers.tpl +++ b/charts/incubator/hyperswitch-card-vault/templates/_helpers.tpl @@ -149,6 +149,31 @@ LOCKER server port {{- default "8080" .Values.server.port | quote }} {{- end }} +{{/* +LOCKER log console enabled +*/}} +{{- define "locker.log.console.enabled" -}} +{{- if hasKey .Values.server.log.console "enabled" -}} +{{- .Values.server.log.console.enabled | toString | lower | quote }} +{{- else -}} +{{- "true" | quote }} +{{- end -}} +{{- end }} + +{{/* +LOCKER log console level +*/}} +{{- define "locker.log.console.level" -}} +{{- default "DEBUG" .Values.server.log.console.level | quote }} +{{- end }} + +{{/* +LOCKER log console format +*/}} +{{- define "locker.log.console.log_format" -}} +{{- default "default" .Values.server.log.console.log_format | quote }} +{{- end }} + {{- define "locker.externalKeyManager.url" -}} {{- default "http://localhost:5000" .Values.server.externalKeyManager.url -}} {{- end -}} diff --git a/charts/incubator/hyperswitch-card-vault/templates/deployment.yaml b/charts/incubator/hyperswitch-card-vault/templates/deployment.yaml index 5b990087..505c5dcf 100644 --- a/charts/incubator/hyperswitch-card-vault/templates/deployment.yaml +++ b/charts/incubator/hyperswitch-card-vault/templates/deployment.yaml @@ -43,11 +43,11 @@ spec: containers: - env: - name: LOCKER__LOG__CONSOLE__ENABLED - value: "true" + value: {{ include "locker.log.console.enabled" . }} - name: LOCKER__LOG__CONSOLE__LEVEL - value: DEBUG + value: {{ include "locker.log.console.level" . }} - name: LOCKER__LOG__CONSOLE__LOG_FORMAT - value: default + value: {{ include "locker.log.console.log_format" . }} - name: LOCKER__SERVER__HOST value: {{ include "locker.server.host" . }} - name: LOCKER__SERVER__PORT diff --git a/charts/incubator/hyperswitch-card-vault/values.yaml b/charts/incubator/hyperswitch-card-vault/values.yaml index d03379de..c9442d24 100644 --- a/charts/incubator/hyperswitch-card-vault/values.yaml +++ b/charts/incubator/hyperswitch-card-vault/values.yaml @@ -64,6 +64,15 @@ server: vault: url: "http://127.0.0.1:8200" + log: + console: + # -- Enable console logging + enabled: true + # -- Log level for console logs (ERROR, WARN, INFO, DEBUG) + level: DEBUG + # -- Log format for console logs (default or json) + log_format: default + # Secrets configuration secrets: # Core secrets