adutra commented on code in PR #2002:
URL: https://github.com/apache/polaris/pull/2002#discussion_r2200773035


##########
helm/polaris/templates/_helpers.tpl:
##########
@@ -181,13 +181,34 @@ Prints the config volume definition for deployments and 
jobs.
           name: {{ tpl .Values.authentication.tokenBroker.secret.name . }}
           items:
           {{- if eq .Values.authentication.tokenBroker.type "rsa-key-pair" }}
-            - key: {{ tpl .Values.authentication.tokenBroker.secret.publicKey 
. }}
+            {{- /* Backward compatibility for publicKey: new takes precedence 
*/ -}}
+            {{- $publicKey := "" }}
+            {{- if 
.Values.authentication.tokenBroker.secret.rsaKeyPair.publicKey }}
+              {{- $publicKey = 
.Values.authentication.tokenBroker.secret.rsaKeyPair.publicKey }}
+            {{- else if .Values.authentication.tokenBroker.secret.publicKey }}
+              {{- $publicKey = 
.Values.authentication.tokenBroker.secret.publicKey }}
+            {{- end }}

Review Comment:
   ```suggestion
               {{- $publicKey := coalesce 
.Values.authentication.tokenBroker.secret.rsaKeyPair.publicKey 
.Values.authentication.tokenBroker.secret.publicKey }}
   ```



##########
helm/polaris/templates/_helpers.tpl:
##########
@@ -181,13 +181,34 @@ Prints the config volume definition for deployments and 
jobs.
           name: {{ tpl .Values.authentication.tokenBroker.secret.name . }}
           items:
           {{- if eq .Values.authentication.tokenBroker.type "rsa-key-pair" }}
-            - key: {{ tpl .Values.authentication.tokenBroker.secret.publicKey 
. }}
+            {{- /* Backward compatibility for publicKey: new takes precedence 
*/ -}}
+            {{- $publicKey := "" }}
+            {{- if 
.Values.authentication.tokenBroker.secret.rsaKeyPair.publicKey }}
+              {{- $publicKey = 
.Values.authentication.tokenBroker.secret.rsaKeyPair.publicKey }}
+            {{- else if .Values.authentication.tokenBroker.secret.publicKey }}
+              {{- $publicKey = 
.Values.authentication.tokenBroker.secret.publicKey }}
+            {{- end }}
+            {{- /* Backward compatibility for privateKey: new takes precedence 
*/ -}}
+            {{- $privateKey := "" }}
+            {{- if 
.Values.authentication.tokenBroker.secret.rsaKeyPair.privateKey }}
+              {{- $privateKey = 
.Values.authentication.tokenBroker.secret.rsaKeyPair.privateKey }}
+            {{- else if .Values.authentication.tokenBroker.secret.privateKey }}
+              {{- $privateKey = 
.Values.authentication.tokenBroker.secret.privateKey -}}
+            {{- end }}
+            - key: {{ tpl $publicKey . }}
               path: public.pem
-            - key: {{ tpl .Values.authentication.tokenBroker.secret.privateKey 
. }}
+            - key: {{ tpl $privateKey . }}
               path: private.pem
           {{- end }}
           {{- if eq .Values.authentication.tokenBroker.type "symmetric-key" }}
-            - key: {{ tpl .Values.authentication.tokenBroker.secret.secretKey 
. }}
+            {{- /* Backward compatibility for symmetricKey: new takes 
precedence */ -}}
+            {{- $secretKey := "" }}
+            {{- if 
.Values.authentication.tokenBroker.secret.symmetricKey.secretKey }}
+              {{- $secretKey = 
.Values.authentication.tokenBroker.secret.symmetricKey.secretKey }}
+            {{- else if .Values.authentication.tokenBroker.secret.secretKey }}
+              {{- $secretKey = 
.Values.authentication.tokenBroker.secret.secretKey }}
+            {{- end }}

Review Comment:
   ```suggestion
               {{- $secretKey := coalesce 
.Values.authentication.tokenBroker.secret.symmetricKey.secretKey 
.Values.authentication.tokenBroker.secret.secretKey }}
   ```



##########
helm/polaris/templates/_helpers.tpl:
##########
@@ -181,13 +181,34 @@ Prints the config volume definition for deployments and 
jobs.
           name: {{ tpl .Values.authentication.tokenBroker.secret.name . }}
           items:
           {{- if eq .Values.authentication.tokenBroker.type "rsa-key-pair" }}
-            - key: {{ tpl .Values.authentication.tokenBroker.secret.publicKey 
. }}
+            {{- /* Backward compatibility for publicKey: new takes precedence 
*/ -}}
+            {{- $publicKey := "" }}
+            {{- if 
.Values.authentication.tokenBroker.secret.rsaKeyPair.publicKey }}
+              {{- $publicKey = 
.Values.authentication.tokenBroker.secret.rsaKeyPair.publicKey }}
+            {{- else if .Values.authentication.tokenBroker.secret.publicKey }}
+              {{- $publicKey = 
.Values.authentication.tokenBroker.secret.publicKey }}
+            {{- end }}
+            {{- /* Backward compatibility for privateKey: new takes precedence 
*/ -}}
+            {{- $privateKey := "" }}
+            {{- if 
.Values.authentication.tokenBroker.secret.rsaKeyPair.privateKey }}
+              {{- $privateKey = 
.Values.authentication.tokenBroker.secret.rsaKeyPair.privateKey }}
+            {{- else if .Values.authentication.tokenBroker.secret.privateKey }}
+              {{- $privateKey = 
.Values.authentication.tokenBroker.secret.privateKey -}}
+            {{- end }}

Review Comment:
   ```suggestion
               {{- $privateKey := coalesce 
.Values.authentication.tokenBroker.secret.rsaKeyPair.privateKey 
.Values.authentication.tokenBroker.secret.privateKey }}
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@polaris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to