From 467b1fa8a57d2ecf1da2467ae700eb5e494ed202 Mon Sep 17 00:00:00 2001 From: Amro Misbah Date: Thu, 21 Mar 2024 14:40:42 +0200 Subject: [PATCH 1/5] feat: add java memory arguments Signed-off-by: Amro Misbah --- .../charts/auth-server/templates/_helpers.tpl | 14 ++++++++++++++ .../charts/auth-server/templates/deployment.yml | 2 ++ charts/janssen/charts/casa/templates/_helpers.tpl | 13 +++++++++++++ .../janssen/charts/casa/templates/deployment.yaml | 2 ++ .../charts/config-api/templates/_helpers.tpl | 14 ++++++++++++++ .../charts/config-api/templates/deployment.yaml | 2 ++ .../janssen/charts/fido2/templates/_helpers.tpl | 13 +++++++++++++ .../janssen/charts/fido2/templates/deployment.yml | 2 ++ charts/janssen/charts/link/templates/_helpers.tpl | 13 +++++++++++++ .../janssen/charts/link/templates/deployment.yaml | 2 ++ charts/janssen/charts/saml/templates/_helpers.tpl | 13 +++++++++++++ .../janssen/charts/saml/templates/deployment.yaml | 2 ++ charts/janssen/charts/scim/templates/_helpers.tpl | 13 +++++++++++++ .../janssen/charts/scim/templates/deployment.yml | 2 ++ charts/janssen/values.yaml | 15 ++++++++++++++- 15 files changed, 121 insertions(+), 1 deletion(-) diff --git a/charts/janssen/charts/auth-server/templates/_helpers.tpl b/charts/janssen/charts/auth-server/templates/_helpers.tpl index 2712f9870a8..65bf2e534cb 100644 --- a/charts/janssen/charts/auth-server/templates/_helpers.tpl +++ b/charts/janssen/charts/auth-server/templates/_helpers.tpl @@ -67,6 +67,20 @@ Create user custom defined secret envs {{- end }} {{- end }} +{{/* +Create JAVA_OPTIONS ENV for passing custom work and detailed logs +*/}} +{{- define "auth-server.customJavaOptions"}} +{{ $custom := "" }} +{{- $cnCustomJavaOptions := index .Values.global "auth-server" "cnCustomJavaOptions" }} +{{- $custom := printf "%s" $cnCustomJavaOptions }} +{{ $memory := .Values.resources.limits.memory | replace "Mi" "" | int -}} +{{- $maxDirectMemory := printf "-XX:MaxDirectMemorySize=%dm" $memory -}} +{{- $xmx := printf "-Xmx%dm" (sub $memory 300) -}} +{{- $customJavaOptions := printf "%s %s" $maxDirectMemory $xmx -}} +{{ $customJavaOptions | trimSuffix " " | quote }} +{{- end }} + {{/* Create topologySpreadConstraints lists */}} diff --git a/charts/janssen/charts/auth-server/templates/deployment.yml b/charts/janssen/charts/auth-server/templates/deployment.yml index 333dfaf3e7e..09951ceae3c 100644 --- a/charts/janssen/charts/auth-server/templates/deployment.yml +++ b/charts/janssen/charts/auth-server/templates/deployment.yml @@ -46,6 +46,8 @@ spec: imagePullPolicy: {{ .Values.image.pullPolicy }} image: {{ .Values.image.repository }}:{{ .Values.image.tag }} env: + - name: CN_AUTH_JAVA_OPTIONS + value: {{ include "auth-server.customJavaOptions" . | trim }} {{- include "auth-server.usr-envs" . | indent 12 }} {{- include "auth-server.usr-secret-envs" . | indent 12 }} securityContext: diff --git a/charts/janssen/charts/casa/templates/_helpers.tpl b/charts/janssen/charts/casa/templates/_helpers.tpl index 4fc7d069e4a..a8b5194e864 100644 --- a/charts/janssen/charts/casa/templates/_helpers.tpl +++ b/charts/janssen/charts/casa/templates/_helpers.tpl @@ -78,6 +78,19 @@ Create user custom defined secret envs {{- end }} {{- end }} +{{/* +Create JAVA_OPTIONS ENV for passing custom work and detailed logs +*/}} +{{- define "casa.customJavaOptions"}} +{{ $custom := "" }} +{{ $custom = printf "%s" .Values.global.casa.cnCustomJavaOptions }} +{{ $memory := .Values.resources.limits.memory | replace "Mi" "" | int -}} +{{- $maxDirectMemory := printf "-XX:MaxDirectMemorySize=%dm" $memory -}} +{{- $xmx := printf "-Xmx%dm" (sub $memory 300) -}} +{{- $customJavaOptions := printf "%s %s" $maxDirectMemory $xmx -}} +{{ $customJavaOptions | trimSuffix " " | quote }} +{{- end }} + {{/* Create topologySpreadConstraints lists */}} diff --git a/charts/janssen/charts/casa/templates/deployment.yaml b/charts/janssen/charts/casa/templates/deployment.yaml index 30d82a2662d..3f132229a10 100644 --- a/charts/janssen/charts/casa/templates/deployment.yaml +++ b/charts/janssen/charts/casa/templates/deployment.yaml @@ -52,6 +52,8 @@ spec: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" env: + - name: CN_CASA_JAVA_OPTIONS + value: {{ include "casa.customJavaOptions" . | trim }} {{- include "casa.usr-envs" . | indent 12 }} {{- include "casa.usr-secret-envs" . | indent 12 }} {{- if or (eq .Values.global.storageClass.provisioner "kubernetes.io/aws-ebs") (eq .Values.global.storageClass.provisioner "openebs.io/local") ( .Values.customScripts) }} diff --git a/charts/janssen/charts/config-api/templates/_helpers.tpl b/charts/janssen/charts/config-api/templates/_helpers.tpl index a32d54db37f..55948f3a912 100644 --- a/charts/janssen/charts/config-api/templates/_helpers.tpl +++ b/charts/janssen/charts/config-api/templates/_helpers.tpl @@ -67,6 +67,20 @@ Create user custom defined secret envs {{- end }} {{- end }} +{{/* +Create JAVA_OPTIONS ENV for passing custom work and detailed logs +*/}} +{{- define "config-api.customJavaOptions"}} +{{ $custom := "" }} +{{- $cnCustomJavaOptions := index .Values.global "config-api" "cnCustomJavaOptions" }} +{{- $custom := printf "%s" $cnCustomJavaOptions }} +{{ $memory := .Values.resources.limits.memory | replace "Mi" "" | int -}} +{{- $maxDirectMemory := printf "-XX:MaxDirectMemorySize=%dm" $memory -}} +{{- $xmx := printf "-Xmx%dm" (sub $memory 300) -}} +{{- $customJavaOptions := printf "%s %s" $maxDirectMemory $xmx -}} +{{ $customJavaOptions | trimSuffix " " | quote }} +{{- end }} + {{/* Create topologySpreadConstraints lists */}} diff --git a/charts/janssen/charts/config-api/templates/deployment.yaml b/charts/janssen/charts/config-api/templates/deployment.yaml index 24cba420996..f7047cbd822 100644 --- a/charts/janssen/charts/config-api/templates/deployment.yaml +++ b/charts/janssen/charts/config-api/templates/deployment.yaml @@ -45,6 +45,8 @@ spec: - name: {{ include "config-api.name" . }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" env: + - name: CN_CONFIG_API_JAVA_OPTIONS + value: {{ include "config-api.customJavaOptions" . | trim }} {{- include "config-api.usr-envs" . | indent 12 }} {{- include "config-api.usr-secret-envs" . | indent 12 }} securityContext: diff --git a/charts/janssen/charts/fido2/templates/_helpers.tpl b/charts/janssen/charts/fido2/templates/_helpers.tpl index 10484b1e979..9a436e4c945 100644 --- a/charts/janssen/charts/fido2/templates/_helpers.tpl +++ b/charts/janssen/charts/fido2/templates/_helpers.tpl @@ -67,6 +67,19 @@ Create user custom defined secret envs {{- end }} {{- end }} +{{/* +Create JAVA_OPTIONS ENV for passing custom work and detailed logs +*/}} +{{- define "fido2.customJavaOptions"}} +{{ $custom := "" }} +{{ $custom = printf "%s" .Values.global.fido2.cnCustomJavaOptions }} +{{ $memory := .Values.resources.limits.memory | replace "Mi" "" | int -}} +{{- $maxDirectMemory := printf "-XX:MaxDirectMemorySize=%dm" $memory -}} +{{- $xmx := printf "-Xmx%dm" (sub $memory 300) -}} +{{- $customJavaOptions := printf "%s %s" $maxDirectMemory $xmx -}} +{{ $customJavaOptions | trimSuffix " " | quote }} +{{- end }} + {{/* Create topologySpreadConstraints lists */}} diff --git a/charts/janssen/charts/fido2/templates/deployment.yml b/charts/janssen/charts/fido2/templates/deployment.yml index e136571b570..1c29be01a0c 100644 --- a/charts/janssen/charts/fido2/templates/deployment.yml +++ b/charts/janssen/charts/fido2/templates/deployment.yml @@ -49,6 +49,8 @@ spec: runAsUser: 1000 runAsNonRoot: true env: + - name: CN_FIDO2_JAVA_OPTIONS + value: {{ include "fido2.customJavaOptions" . | trim }} {{- include "fido2.usr-envs" . | indent 12 }} {{- include "fido2.usr-secret-envs" . | indent 12 }} {{- if or (eq .Values.global.storageClass.provisioner "kubernetes.io/aws-ebs") (eq .Values.global.storageClass.provisioner "openebs.io/local") ( .Values.customScripts) }} diff --git a/charts/janssen/charts/link/templates/_helpers.tpl b/charts/janssen/charts/link/templates/_helpers.tpl index 42e2f3184f4..5544f1fe31b 100644 --- a/charts/janssen/charts/link/templates/_helpers.tpl +++ b/charts/janssen/charts/link/templates/_helpers.tpl @@ -67,6 +67,19 @@ Create user custom defined secret envs {{- end }} {{- end }} +{{/* +Create JAVA_OPTIONS ENV for passing custom work and detailed logs +*/}} +{{- define "link.customJavaOptions"}} +{{ $custom := "" }} +{{ $custom = printf "%s" .Values.global.link.cnCustomJavaOptions }} +{{ $memory := .Values.resources.limits.memory | replace "Mi" "" | int -}} +{{- $maxDirectMemory := printf "-XX:MaxDirectMemorySize=%dm" $memory -}} +{{- $xmx := printf "-Xmx%dm" (sub $memory 300) -}} +{{- $customJavaOptions := printf "%s %s" $maxDirectMemory $xmx -}} +{{ $customJavaOptions | trimSuffix " " | quote }} +{{- end }} + {{/* Create topologySpreadConstraints lists */}} diff --git a/charts/janssen/charts/link/templates/deployment.yaml b/charts/janssen/charts/link/templates/deployment.yaml index 966d94fe6a8..f257ae7131c 100644 --- a/charts/janssen/charts/link/templates/deployment.yaml +++ b/charts/janssen/charts/link/templates/deployment.yaml @@ -45,6 +45,8 @@ spec: - name: {{ include "link.name" . }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" env: + - name: CN_LINK_JAVA_OPTIONS + value: {{ include "link.customJavaOptions" . | trim }} {{- include "link.usr-envs" . | indent 12 }} {{- include "link.usr-secret-envs" . | indent 12 }} securityContext: diff --git a/charts/janssen/charts/saml/templates/_helpers.tpl b/charts/janssen/charts/saml/templates/_helpers.tpl index 784308f4b8a..5da71dcfaa8 100644 --- a/charts/janssen/charts/saml/templates/_helpers.tpl +++ b/charts/janssen/charts/saml/templates/_helpers.tpl @@ -78,6 +78,19 @@ Create user custom defined secret envs {{- end }} {{- end }} +{{/* +Create JAVA_OPTIONS ENV for passing custom work and detailed logs +*/}} +{{- define "saml.customJavaOptions"}} +{{ $custom := "" }} +{{ $custom = printf "%s" .Values.global.saml.cnCustomJavaOptions }} +{{ $memory := .Values.resources.limits.memory | replace "Mi" "" | int -}} +{{- $maxDirectMemory := printf "-XX:MaxDirectMemorySize=%dm" $memory -}} +{{- $xmx := printf "-Xmx%dm" (sub $memory 300) -}} +{{- $customJavaOptions := printf "%s %s" $maxDirectMemory $xmx -}} +{{ $customJavaOptions | trimSuffix " " | quote }} +{{- end }} + {{/* Create topologySpreadConstraints lists */}} diff --git a/charts/janssen/charts/saml/templates/deployment.yaml b/charts/janssen/charts/saml/templates/deployment.yaml index 935d0b525b1..8f6b22c3cf0 100644 --- a/charts/janssen/charts/saml/templates/deployment.yaml +++ b/charts/janssen/charts/saml/templates/deployment.yaml @@ -52,6 +52,8 @@ spec: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" env: + - name: CN_SAML_JAVA_OPTIONS + value: {{ include "saml.customJavaOptions" . | trim }} {{- include "saml.usr-envs" . | indent 12 }} {{- include "saml.usr-secret-envs" . | indent 12 }} {{- if or (eq .Values.global.storageClass.provisioner "kubernetes.io/aws-ebs") (eq .Values.global.storageClass.provisioner "openebs.io/local") ( .Values.customScripts) }} diff --git a/charts/janssen/charts/scim/templates/_helpers.tpl b/charts/janssen/charts/scim/templates/_helpers.tpl index 04b66d5afd9..65746f90753 100644 --- a/charts/janssen/charts/scim/templates/_helpers.tpl +++ b/charts/janssen/charts/scim/templates/_helpers.tpl @@ -67,6 +67,19 @@ Create user custom defined secret envs {{- end }} {{- end }} +{{/* +Create JAVA_OPTIONS ENV for passing custom work and detailed logs +*/}} +{{- define "scim.customJavaOptions"}} +{{ $custom := "" }} +{{ $custom = printf "%s" .Values.global.scim.cnCustomJavaOptions }} +{{ $memory := .Values.resources.limits.memory | replace "Mi" "" | int -}} +{{- $maxDirectMemory := printf "-XX:MaxDirectMemorySize=%dm" $memory -}} +{{- $xmx := printf "-Xmx%dm" (sub $memory 300) -}} +{{- $customJavaOptions := printf "%s %s" $maxDirectMemory $xmx -}} +{{ $customJavaOptions | trimSuffix " " | quote }} +{{- end }} + {{/* Create topologySpreadConstraints lists */}} diff --git a/charts/janssen/charts/scim/templates/deployment.yml b/charts/janssen/charts/scim/templates/deployment.yml index 96c29cce90c..1b5b6edf124 100644 --- a/charts/janssen/charts/scim/templates/deployment.yml +++ b/charts/janssen/charts/scim/templates/deployment.yml @@ -49,6 +49,8 @@ spec: runAsUser: 1000 runAsNonRoot: true env: + - name: CN_SCIM_JAVA_OPTIONS + value: {{ include "scim.customJavaOptions" . | trim }} {{- include "scim.usr-envs" . | indent 12 }} {{- include "scim.usr-secret-envs" . | indent 12 }} {{- if or (eq .Values.global.storageClass.provisioner "kubernetes.io/aws-ebs") (eq .Values.global.storageClass.provisioner "openebs.io/local") ( .Values.customScripts) }} diff --git a/charts/janssen/values.yaml b/charts/janssen/values.yaml index 1f4ebfde41d..72b52f26ad2 100644 --- a/charts/janssen/values.yaml +++ b/charts/janssen/values.yaml @@ -730,6 +730,8 @@ global: authServerServiceName: auth-server # -- Boolean flag to enable/disable auth-server chart. You should never set this to false. enabled: true + # -- passing custom java options to auth-server. Notice you do not need to pass in any loggers optoins as they are introduced below in appLoggers. DO NOT PASS JAVA_OPTIONS in envs. + cnCustomJavaOptions: "" # -- App loggers can be configured to define where the logs will be redirected to and the level of each in which it should be displayed. appLoggers: # -- Enable log prefixing which enables prepending the STDOUT logs with the file name. i.e auth-server-script ===> 2022-12-20 17:49:55,744 INFO @@ -799,6 +801,8 @@ global: # -- Azure storage kind if using Azure disks azureStorageKind: Managed casa: + # -- passing custom java options to casa. Notice you do not need to pass in any loggers optoins as they are introduced below in appLoggers. DO NOT PASS JAVA_OPTIONS in envs. + cnCustomJavaOptions: "" # -- App loggers can be configured to define where the logs will be redirected to and the level of each in which it should be displayed. appLoggers: # -- Enable log prefixing which enables prepending the STDOUT logs with the file name. i.e casa ===> 2022-12-20 17:49:55,744 INFO @@ -850,6 +854,8 @@ global: configApiServerServiceName: config-api # -- Boolean flag to enable/disable the config-api chart. enabled: true + # -- passing custom java options to config-api. Notice you do not need to pass in any loggers optoins as they are introduced below in appLoggers. DO NOT PASS JAVA_OPTIONS in envs. + cnCustomJavaOptions: "" # -- App loggers can be configured to define where the logs will be redirected to and the level of each in which it should be displayed. appLoggers: # -- Enable log prefixing which enables prepending the STDOUT logs with the file name. i.e config-api_persistence ===> 2022-12-20 17:49:55,744 INFO @@ -887,6 +893,8 @@ global: fido2ServiceName: fido2 # -- Boolean flag to enable/disable the fido2 chart. enabled: true + # -- passing custom java options to fido2. Notice you do not need to pass in any loggers optoins as they are introduced below in appLoggers. DO NOT PASS JAVA_OPTIONS in envs. + cnCustomJavaOptions: "" # -- App loggers can be configured to define where the logs will be redirected to and the level of each in which it should be displayed. appLoggers: # -- Enable log prefixing which enables prepending the STDOUT logs with the file name. i.e fido2 ===> 2022-12-20 17:49:55,744 INFO @@ -948,6 +956,8 @@ global: scimServiceName: scim # -- Boolean flag to enable/disable the SCIM chart. enabled: true + # -- passing custom java options to scim. Notice you do not need to pass in any loggers optoins as they are introduced below in appLoggers. DO NOT PASS JAVA_OPTIONS in envs. + cnCustomJavaOptions: "" # -- App loggers can be configured to define where the logs will be redirected to and the level of each in which it should be displayed. appLoggers: # -- Enable log prefixing which enables prepending the STDOUT logs with the file name. i.e jans-scim ===> 2022-12-20 17:49:55,744 INFO @@ -999,6 +1009,8 @@ global: linkServiceName: link # -- Boolean flag to enable/disable the link chart. enabled: false + # -- passing custom java options to link. Notice you do not need to pass in any loggers optoins as they are introduced below in appLoggers. DO NOT PASS JAVA_OPTIONS in envs. + cnCustomJavaOptions: "" # -- App loggers can be configured to define where the logs will be redirected to and the level of each in which it should be displayed. appLoggers: # -- Enable log prefixing which enables prepending the STDOUT logs with the file name. i.e link-persistence ===> 2022-12-20 17:49:55,744 INFO @@ -1036,7 +1048,8 @@ global: ingress: # Enable saml endpoints /kc samlEnabled: false - + # -- passing custom java options to saml. DO NOT PASS JAVA_OPTIONS in envs. + cnCustomJavaOptions: "" # -- Path to SQL password file cnSqlPasswordFile: /etc/jans/conf/sql_password # -- Path to Couchbase password file From 2deb5de37323f457cee4a8da55a323a2869ab50b Mon Sep 17 00:00:00 2001 From: Amro Misbah Date: Thu, 21 Mar 2024 23:47:34 +0200 Subject: [PATCH 2/5] fix: print custom arguments in values Signed-off-by: Amro Misbah --- charts/janssen/charts/auth-server/templates/_helpers.tpl | 2 +- charts/janssen/charts/casa/templates/_helpers.tpl | 2 +- charts/janssen/charts/config-api/templates/_helpers.tpl | 2 +- charts/janssen/charts/fido2/templates/_helpers.tpl | 2 +- charts/janssen/charts/link/templates/_helpers.tpl | 2 +- charts/janssen/charts/saml/templates/_helpers.tpl | 2 +- charts/janssen/charts/scim/templates/_helpers.tpl | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/charts/janssen/charts/auth-server/templates/_helpers.tpl b/charts/janssen/charts/auth-server/templates/_helpers.tpl index 65bf2e534cb..58af90566eb 100644 --- a/charts/janssen/charts/auth-server/templates/_helpers.tpl +++ b/charts/janssen/charts/auth-server/templates/_helpers.tpl @@ -77,7 +77,7 @@ Create JAVA_OPTIONS ENV for passing custom work and detailed logs {{ $memory := .Values.resources.limits.memory | replace "Mi" "" | int -}} {{- $maxDirectMemory := printf "-XX:MaxDirectMemorySize=%dm" $memory -}} {{- $xmx := printf "-Xmx%dm" (sub $memory 300) -}} -{{- $customJavaOptions := printf "%s %s" $maxDirectMemory $xmx -}} +{{- $customJavaOptions := printf "%s %s " $custom (printf "%s %s" $maxDirectMemory $xmx) -}} {{ $customJavaOptions | trimSuffix " " | quote }} {{- end }} diff --git a/charts/janssen/charts/casa/templates/_helpers.tpl b/charts/janssen/charts/casa/templates/_helpers.tpl index a8b5194e864..16796fc5f39 100644 --- a/charts/janssen/charts/casa/templates/_helpers.tpl +++ b/charts/janssen/charts/casa/templates/_helpers.tpl @@ -87,7 +87,7 @@ Create JAVA_OPTIONS ENV for passing custom work and detailed logs {{ $memory := .Values.resources.limits.memory | replace "Mi" "" | int -}} {{- $maxDirectMemory := printf "-XX:MaxDirectMemorySize=%dm" $memory -}} {{- $xmx := printf "-Xmx%dm" (sub $memory 300) -}} -{{- $customJavaOptions := printf "%s %s" $maxDirectMemory $xmx -}} +{{- $customJavaOptions := printf "%s %s " $custom (printf "%s %s" $maxDirectMemory $xmx) -}} {{ $customJavaOptions | trimSuffix " " | quote }} {{- end }} diff --git a/charts/janssen/charts/config-api/templates/_helpers.tpl b/charts/janssen/charts/config-api/templates/_helpers.tpl index 55948f3a912..fe01669dd6e 100644 --- a/charts/janssen/charts/config-api/templates/_helpers.tpl +++ b/charts/janssen/charts/config-api/templates/_helpers.tpl @@ -77,7 +77,7 @@ Create JAVA_OPTIONS ENV for passing custom work and detailed logs {{ $memory := .Values.resources.limits.memory | replace "Mi" "" | int -}} {{- $maxDirectMemory := printf "-XX:MaxDirectMemorySize=%dm" $memory -}} {{- $xmx := printf "-Xmx%dm" (sub $memory 300) -}} -{{- $customJavaOptions := printf "%s %s" $maxDirectMemory $xmx -}} +{{- $customJavaOptions := printf "%s %s " $custom (printf "%s %s" $maxDirectMemory $xmx) -}} {{ $customJavaOptions | trimSuffix " " | quote }} {{- end }} diff --git a/charts/janssen/charts/fido2/templates/_helpers.tpl b/charts/janssen/charts/fido2/templates/_helpers.tpl index 9a436e4c945..7dda4c2a85e 100644 --- a/charts/janssen/charts/fido2/templates/_helpers.tpl +++ b/charts/janssen/charts/fido2/templates/_helpers.tpl @@ -76,7 +76,7 @@ Create JAVA_OPTIONS ENV for passing custom work and detailed logs {{ $memory := .Values.resources.limits.memory | replace "Mi" "" | int -}} {{- $maxDirectMemory := printf "-XX:MaxDirectMemorySize=%dm" $memory -}} {{- $xmx := printf "-Xmx%dm" (sub $memory 300) -}} -{{- $customJavaOptions := printf "%s %s" $maxDirectMemory $xmx -}} +{{- $customJavaOptions := printf "%s %s " $custom (printf "%s %s" $maxDirectMemory $xmx) -}} {{ $customJavaOptions | trimSuffix " " | quote }} {{- end }} diff --git a/charts/janssen/charts/link/templates/_helpers.tpl b/charts/janssen/charts/link/templates/_helpers.tpl index 5544f1fe31b..cf741c3d215 100644 --- a/charts/janssen/charts/link/templates/_helpers.tpl +++ b/charts/janssen/charts/link/templates/_helpers.tpl @@ -76,7 +76,7 @@ Create JAVA_OPTIONS ENV for passing custom work and detailed logs {{ $memory := .Values.resources.limits.memory | replace "Mi" "" | int -}} {{- $maxDirectMemory := printf "-XX:MaxDirectMemorySize=%dm" $memory -}} {{- $xmx := printf "-Xmx%dm" (sub $memory 300) -}} -{{- $customJavaOptions := printf "%s %s" $maxDirectMemory $xmx -}} +{{- $customJavaOptions := printf "%s %s " $custom (printf "%s %s" $maxDirectMemory $xmx) -}} {{ $customJavaOptions | trimSuffix " " | quote }} {{- end }} diff --git a/charts/janssen/charts/saml/templates/_helpers.tpl b/charts/janssen/charts/saml/templates/_helpers.tpl index 5da71dcfaa8..f27960c7cd2 100644 --- a/charts/janssen/charts/saml/templates/_helpers.tpl +++ b/charts/janssen/charts/saml/templates/_helpers.tpl @@ -87,7 +87,7 @@ Create JAVA_OPTIONS ENV for passing custom work and detailed logs {{ $memory := .Values.resources.limits.memory | replace "Mi" "" | int -}} {{- $maxDirectMemory := printf "-XX:MaxDirectMemorySize=%dm" $memory -}} {{- $xmx := printf "-Xmx%dm" (sub $memory 300) -}} -{{- $customJavaOptions := printf "%s %s" $maxDirectMemory $xmx -}} +{{- $customJavaOptions := printf "%s %s " $custom (printf "%s %s" $maxDirectMemory $xmx) -}} {{ $customJavaOptions | trimSuffix " " | quote }} {{- end }} diff --git a/charts/janssen/charts/scim/templates/_helpers.tpl b/charts/janssen/charts/scim/templates/_helpers.tpl index 65746f90753..e578667c380 100644 --- a/charts/janssen/charts/scim/templates/_helpers.tpl +++ b/charts/janssen/charts/scim/templates/_helpers.tpl @@ -76,7 +76,7 @@ Create JAVA_OPTIONS ENV for passing custom work and detailed logs {{ $memory := .Values.resources.limits.memory | replace "Mi" "" | int -}} {{- $maxDirectMemory := printf "-XX:MaxDirectMemorySize=%dm" $memory -}} {{- $xmx := printf "-Xmx%dm" (sub $memory 300) -}} -{{- $customJavaOptions := printf "%s %s" $maxDirectMemory $xmx -}} +{{- $customJavaOptions := printf "%s %s " $custom (printf "%s %s" $maxDirectMemory $xmx) -}} {{ $customJavaOptions | trimSuffix " " | quote }} {{- end }} From c4ce9861e29305eb980d3bddfd0e77813918d141 Mon Sep 17 00:00:00 2001 From: Amro Misbah Date: Fri, 22 Mar 2024 12:43:02 +0200 Subject: [PATCH 3/5] docs: fix typo Signed-off-by: Amro Misbah --- charts/janssen/values.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/charts/janssen/values.yaml b/charts/janssen/values.yaml index 72b52f26ad2..619e22c6a03 100644 --- a/charts/janssen/values.yaml +++ b/charts/janssen/values.yaml @@ -730,7 +730,7 @@ global: authServerServiceName: auth-server # -- Boolean flag to enable/disable auth-server chart. You should never set this to false. enabled: true - # -- passing custom java options to auth-server. Notice you do not need to pass in any loggers optoins as they are introduced below in appLoggers. DO NOT PASS JAVA_OPTIONS in envs. + # -- passing custom java options to auth-server. Notice you do not need to pass in any loggers options as they are introduced below in appLoggers. DO NOT PASS JAVA_OPTIONS in envs. cnCustomJavaOptions: "" # -- App loggers can be configured to define where the logs will be redirected to and the level of each in which it should be displayed. appLoggers: @@ -801,7 +801,7 @@ global: # -- Azure storage kind if using Azure disks azureStorageKind: Managed casa: - # -- passing custom java options to casa. Notice you do not need to pass in any loggers optoins as they are introduced below in appLoggers. DO NOT PASS JAVA_OPTIONS in envs. + # -- passing custom java options to casa. Notice you do not need to pass in any loggers options as they are introduced below in appLoggers. DO NOT PASS JAVA_OPTIONS in envs. cnCustomJavaOptions: "" # -- App loggers can be configured to define where the logs will be redirected to and the level of each in which it should be displayed. appLoggers: @@ -854,7 +854,7 @@ global: configApiServerServiceName: config-api # -- Boolean flag to enable/disable the config-api chart. enabled: true - # -- passing custom java options to config-api. Notice you do not need to pass in any loggers optoins as they are introduced below in appLoggers. DO NOT PASS JAVA_OPTIONS in envs. + # -- passing custom java options to config-api. Notice you do not need to pass in any loggers options as they are introduced below in appLoggers. DO NOT PASS JAVA_OPTIONS in envs. cnCustomJavaOptions: "" # -- App loggers can be configured to define where the logs will be redirected to and the level of each in which it should be displayed. appLoggers: @@ -893,7 +893,7 @@ global: fido2ServiceName: fido2 # -- Boolean flag to enable/disable the fido2 chart. enabled: true - # -- passing custom java options to fido2. Notice you do not need to pass in any loggers optoins as they are introduced below in appLoggers. DO NOT PASS JAVA_OPTIONS in envs. + # -- passing custom java options to fido2. Notice you do not need to pass in any loggers options as they are introduced below in appLoggers. DO NOT PASS JAVA_OPTIONS in envs. cnCustomJavaOptions: "" # -- App loggers can be configured to define where the logs will be redirected to and the level of each in which it should be displayed. appLoggers: @@ -956,7 +956,7 @@ global: scimServiceName: scim # -- Boolean flag to enable/disable the SCIM chart. enabled: true - # -- passing custom java options to scim. Notice you do not need to pass in any loggers optoins as they are introduced below in appLoggers. DO NOT PASS JAVA_OPTIONS in envs. + # -- passing custom java options to scim. Notice you do not need to pass in any loggers options as they are introduced below in appLoggers. DO NOT PASS JAVA_OPTIONS in envs. cnCustomJavaOptions: "" # -- App loggers can be configured to define where the logs will be redirected to and the level of each in which it should be displayed. appLoggers: @@ -1009,7 +1009,7 @@ global: linkServiceName: link # -- Boolean flag to enable/disable the link chart. enabled: false - # -- passing custom java options to link. Notice you do not need to pass in any loggers optoins as they are introduced below in appLoggers. DO NOT PASS JAVA_OPTIONS in envs. + # -- passing custom java options to link. Notice you do not need to pass in any loggers options as they are introduced below in appLoggers. DO NOT PASS JAVA_OPTIONS in envs. cnCustomJavaOptions: "" # -- App loggers can be configured to define where the logs will be redirected to and the level of each in which it should be displayed. appLoggers: From 7c29e5f535d46c58d60b112cc0c1c82964b4191a Mon Sep 17 00:00:00 2001 From: Amro Misbah Date: Tue, 26 Mar 2024 01:06:02 +0200 Subject: [PATCH 4/5] fix: remove whitespace and simplify command Signed-off-by: Amro Misbah --- charts/janssen/charts/auth-server/templates/_helpers.tpl | 4 ++-- charts/janssen/charts/casa/templates/_helpers.tpl | 4 ++-- charts/janssen/charts/config-api/templates/_helpers.tpl | 4 ++-- charts/janssen/charts/fido2/templates/_helpers.tpl | 4 ++-- charts/janssen/charts/link/templates/_helpers.tpl | 4 ++-- charts/janssen/charts/saml/templates/_helpers.tpl | 4 ++-- charts/janssen/charts/scim/templates/_helpers.tpl | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/charts/janssen/charts/auth-server/templates/_helpers.tpl b/charts/janssen/charts/auth-server/templates/_helpers.tpl index 58af90566eb..663d48faa50 100644 --- a/charts/janssen/charts/auth-server/templates/_helpers.tpl +++ b/charts/janssen/charts/auth-server/templates/_helpers.tpl @@ -77,8 +77,8 @@ Create JAVA_OPTIONS ENV for passing custom work and detailed logs {{ $memory := .Values.resources.limits.memory | replace "Mi" "" | int -}} {{- $maxDirectMemory := printf "-XX:MaxDirectMemorySize=%dm" $memory -}} {{- $xmx := printf "-Xmx%dm" (sub $memory 300) -}} -{{- $customJavaOptions := printf "%s %s " $custom (printf "%s %s" $maxDirectMemory $xmx) -}} -{{ $customJavaOptions | trimSuffix " " | quote }} +{{- $customJavaOptions := printf "%s %s %s" $custom $maxDirectMemory $xmx -}} +{{ $customJavaOptions | trim | quote }} {{- end }} {{/* diff --git a/charts/janssen/charts/casa/templates/_helpers.tpl b/charts/janssen/charts/casa/templates/_helpers.tpl index 16796fc5f39..efdb4a46058 100644 --- a/charts/janssen/charts/casa/templates/_helpers.tpl +++ b/charts/janssen/charts/casa/templates/_helpers.tpl @@ -87,8 +87,8 @@ Create JAVA_OPTIONS ENV for passing custom work and detailed logs {{ $memory := .Values.resources.limits.memory | replace "Mi" "" | int -}} {{- $maxDirectMemory := printf "-XX:MaxDirectMemorySize=%dm" $memory -}} {{- $xmx := printf "-Xmx%dm" (sub $memory 300) -}} -{{- $customJavaOptions := printf "%s %s " $custom (printf "%s %s" $maxDirectMemory $xmx) -}} -{{ $customJavaOptions | trimSuffix " " | quote }} +{{- $customJavaOptions := printf "%s %s %s" $custom $maxDirectMemory $xmx -}} +{{ $customJavaOptions | trim | quote }} {{- end }} {{/* diff --git a/charts/janssen/charts/config-api/templates/_helpers.tpl b/charts/janssen/charts/config-api/templates/_helpers.tpl index fe01669dd6e..0fee22c05ca 100644 --- a/charts/janssen/charts/config-api/templates/_helpers.tpl +++ b/charts/janssen/charts/config-api/templates/_helpers.tpl @@ -77,8 +77,8 @@ Create JAVA_OPTIONS ENV for passing custom work and detailed logs {{ $memory := .Values.resources.limits.memory | replace "Mi" "" | int -}} {{- $maxDirectMemory := printf "-XX:MaxDirectMemorySize=%dm" $memory -}} {{- $xmx := printf "-Xmx%dm" (sub $memory 300) -}} -{{- $customJavaOptions := printf "%s %s " $custom (printf "%s %s" $maxDirectMemory $xmx) -}} -{{ $customJavaOptions | trimSuffix " " | quote }} +{{- $customJavaOptions := printf "%s %s %s" $custom $maxDirectMemory $xmx -}} +{{ $customJavaOptions | trim | quote }} {{- end }} {{/* diff --git a/charts/janssen/charts/fido2/templates/_helpers.tpl b/charts/janssen/charts/fido2/templates/_helpers.tpl index 7dda4c2a85e..622416f343f 100644 --- a/charts/janssen/charts/fido2/templates/_helpers.tpl +++ b/charts/janssen/charts/fido2/templates/_helpers.tpl @@ -76,8 +76,8 @@ Create JAVA_OPTIONS ENV for passing custom work and detailed logs {{ $memory := .Values.resources.limits.memory | replace "Mi" "" | int -}} {{- $maxDirectMemory := printf "-XX:MaxDirectMemorySize=%dm" $memory -}} {{- $xmx := printf "-Xmx%dm" (sub $memory 300) -}} -{{- $customJavaOptions := printf "%s %s " $custom (printf "%s %s" $maxDirectMemory $xmx) -}} -{{ $customJavaOptions | trimSuffix " " | quote }} +{{- $customJavaOptions := printf "%s %s %s" $custom $maxDirectMemory $xmx -}} +{{ $customJavaOptions | trim | quote }} {{- end }} {{/* diff --git a/charts/janssen/charts/link/templates/_helpers.tpl b/charts/janssen/charts/link/templates/_helpers.tpl index cf741c3d215..49c1621e5bd 100644 --- a/charts/janssen/charts/link/templates/_helpers.tpl +++ b/charts/janssen/charts/link/templates/_helpers.tpl @@ -76,8 +76,8 @@ Create JAVA_OPTIONS ENV for passing custom work and detailed logs {{ $memory := .Values.resources.limits.memory | replace "Mi" "" | int -}} {{- $maxDirectMemory := printf "-XX:MaxDirectMemorySize=%dm" $memory -}} {{- $xmx := printf "-Xmx%dm" (sub $memory 300) -}} -{{- $customJavaOptions := printf "%s %s " $custom (printf "%s %s" $maxDirectMemory $xmx) -}} -{{ $customJavaOptions | trimSuffix " " | quote }} +{{- $customJavaOptions := printf "%s %s %s" $custom $maxDirectMemory $xmx -}} +{{ $customJavaOptions | trim | quote }} {{- end }} {{/* diff --git a/charts/janssen/charts/saml/templates/_helpers.tpl b/charts/janssen/charts/saml/templates/_helpers.tpl index f27960c7cd2..a32043c8b91 100644 --- a/charts/janssen/charts/saml/templates/_helpers.tpl +++ b/charts/janssen/charts/saml/templates/_helpers.tpl @@ -87,8 +87,8 @@ Create JAVA_OPTIONS ENV for passing custom work and detailed logs {{ $memory := .Values.resources.limits.memory | replace "Mi" "" | int -}} {{- $maxDirectMemory := printf "-XX:MaxDirectMemorySize=%dm" $memory -}} {{- $xmx := printf "-Xmx%dm" (sub $memory 300) -}} -{{- $customJavaOptions := printf "%s %s " $custom (printf "%s %s" $maxDirectMemory $xmx) -}} -{{ $customJavaOptions | trimSuffix " " | quote }} +{{- $customJavaOptions := printf "%s %s %s" $custom $maxDirectMemory $xmx -}} +{{ $customJavaOptions | trimS " " | quote }} {{- end }} {{/* diff --git a/charts/janssen/charts/scim/templates/_helpers.tpl b/charts/janssen/charts/scim/templates/_helpers.tpl index e578667c380..5c23b42a6aa 100644 --- a/charts/janssen/charts/scim/templates/_helpers.tpl +++ b/charts/janssen/charts/scim/templates/_helpers.tpl @@ -76,8 +76,8 @@ Create JAVA_OPTIONS ENV for passing custom work and detailed logs {{ $memory := .Values.resources.limits.memory | replace "Mi" "" | int -}} {{- $maxDirectMemory := printf "-XX:MaxDirectMemorySize=%dm" $memory -}} {{- $xmx := printf "-Xmx%dm" (sub $memory 300) -}} -{{- $customJavaOptions := printf "%s %s " $custom (printf "%s %s" $maxDirectMemory $xmx) -}} -{{ $customJavaOptions | trimSuffix " " | quote }} +{{- $customJavaOptions := printf "%s %s %s" $custom $maxDirectMemory $xmx -}} +{{ $customJavaOptions | trim | quote }} {{- end }} {{/* From 4c30fdc2c7b973077e0095d96895243c66084ca1 Mon Sep 17 00:00:00 2001 From: Amro Misbah Date: Tue, 26 Mar 2024 01:22:28 +0200 Subject: [PATCH 5/5] fix(saml): whitespace removal Signed-off-by: Amro Misbah --- charts/janssen/charts/saml/templates/_helpers.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/janssen/charts/saml/templates/_helpers.tpl b/charts/janssen/charts/saml/templates/_helpers.tpl index a32043c8b91..8139686d8b7 100644 --- a/charts/janssen/charts/saml/templates/_helpers.tpl +++ b/charts/janssen/charts/saml/templates/_helpers.tpl @@ -88,7 +88,7 @@ Create JAVA_OPTIONS ENV for passing custom work and detailed logs {{- $maxDirectMemory := printf "-XX:MaxDirectMemorySize=%dm" $memory -}} {{- $xmx := printf "-Xmx%dm" (sub $memory 300) -}} {{- $customJavaOptions := printf "%s %s %s" $custom $maxDirectMemory $xmx -}} -{{ $customJavaOptions | trimS " " | quote }} +{{ $customJavaOptions | trim | quote }} {{- end }} {{/*