This is an automated email from the ASF dual-hosted git repository.

jinsongzhou pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/amoro.git


The following commit(s) were added to refs/heads/master by this push:
     new 15e2471a2 [Hotfix] Fix apache rat check errors (#2952)
15e2471a2 is described below

commit 15e2471a2e92fb74090b6e88c33dbf088975a531
Author: ZhouJinsong <[email protected]>
AuthorDate: Thu Jun 20 15:16:01 2024 +0800

    [Hotfix] Fix apache rat check errors (#2952)
    
    * Fix apache rat check errors
    
    * Change heml secrets names
    
    * Remove not needed part from helm config.yaml configmap
    
    * fix heml test errors
---
 charts/amoro/templates/amoro-admin-secret.yaml     | 21 +++++++++++++++++++--
 charts/amoro/templates/amoro-configmap.yaml        |  4 ----
 charts/amoro/templates/amoro-database-secret.yaml  |  4 ++--
 charts/amoro/templates/amoro-deployment.yaml       |  8 ++++----
 charts/amoro/tests/amoro-configmap_test.yaml       | 12 ------------
 charts/amoro/tests/amoro-database-secret_test.yaml |  4 ++--
 charts/amoro/tests/amoro-deployment_test.yaml      |  8 ++++----
 7 files changed, 31 insertions(+), 30 deletions(-)

diff --git a/charts/amoro/templates/amoro-admin-secret.yaml 
b/charts/amoro/templates/amoro-admin-secret.yaml
index 90385db63..5e83e005c 100644
--- a/charts/amoro/templates/amoro-admin-secret.yaml
+++ b/charts/amoro/templates/amoro-admin-secret.yaml
@@ -1,3 +1,20 @@
+{{/*
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+*/}}
+
 apiVersion: v1
 kind: Secret
 metadata:
@@ -7,5 +24,5 @@ metadata:
 type: Opaque
 data:
   # use helm set dashboard username and password
-  username: {{ .Values.amoroConf.ams.adminUsername | b64enc | quote }}
-  password: {{ .Values.amoroConf.ams.adminPassword | b64enc | quote }}
\ No newline at end of file
+  AdminUsername: {{ .Values.amoroConf.ams.adminUsername | b64enc | quote }}
+  AdminPassword: {{ .Values.amoroConf.ams.adminPassword | b64enc | quote }}
\ No newline at end of file
diff --git a/charts/amoro/templates/amoro-configmap.yaml 
b/charts/amoro/templates/amoro-configmap.yaml
index 22bda0794..7330b980a 100644
--- a/charts/amoro/templates/amoro-configmap.yaml
+++ b/charts/amoro/templates/amoro-configmap.yaml
@@ -92,10 +92,6 @@ data:
         type: {{ .Values.amoroConf.database.type }}
         jdbc-driver-class: {{ .Values.amoroConf.database.driver | quote }}
         url: {{ .Values.amoroConf.database.url }}
-        {{- if or (eq .Values.amoroConf.database.type "mysql") (eq 
.Values.amoroConf.database.type "postgres") }}
-        username: {{ .Values.amoroConf.database.username | quote }}
-        password: {{ .Values.amoroConf.database.password | quote }}
-        {{- end }}
         connection-pool-max-total: 20
         connection-pool-max-idle: 16
         connection-pool-max-wait-millis: 1000
diff --git a/charts/amoro/templates/amoro-database-secret.yaml 
b/charts/amoro/templates/amoro-database-secret.yaml
index 022562e17..9d1065b4e 100644
--- a/charts/amoro/templates/amoro-database-secret.yaml
+++ b/charts/amoro/templates/amoro-database-secret.yaml
@@ -25,7 +25,7 @@ metadata:
 type: Opaque
 data:
   # use helm set username
-  username: {{ .Values.amoroConf.database.username | b64enc | quote }}
+  DatabaseUsername: {{ .Values.amoroConf.database.username | b64enc | quote }}
   # use helm set password
-  password: {{ .Values.amoroConf.database.password | b64enc | quote }}
+  DatabasePassword: {{ .Values.amoroConf.database.password | b64enc | quote }}
 {{- end }}
\ No newline at end of file
diff --git a/charts/amoro/templates/amoro-deployment.yaml 
b/charts/amoro/templates/amoro-deployment.yaml
index 465fc9d88..ee46076ec 100644
--- a/charts/amoro/templates/amoro-deployment.yaml
+++ b/charts/amoro/templates/amoro-deployment.yaml
@@ -55,23 +55,23 @@ spec: {{/* TODO If Support Replica can be use more than 1 
*/}}
               valueFrom:
                 secretKeyRef:
                   name: {{ include "common.names.fullname" . }}
-                  key: username
+                  key: DatabaseUsername
             - name: "AMS_DATABASE_PASSWORD"
               valueFrom:
                 secretKeyRef:
                   name: {{ include "common.names.fullname" . }}
-                  key: password
+                  key: DatabasePassword
             {{- end }}
             - name: "AMS_ADMIN__USERNAME"
               valueFrom:
                 secretKeyRef:
                   name: {{ include "common.names.fullname" . }}
-                  key: username
+                  key: AdminUsername
             - name: "AMS_ADMIN__PASSWORD"
               valueFrom:
                 secretKeyRef:
                   name: {{ include "common.names.fullname" . }}
-                  key: password
+                  key: AdminPassword
             {{- with .Values.env }}
             {{- tpl (toYaml .) $ | nindent 12 }}
             {{- end }}
diff --git a/charts/amoro/tests/amoro-configmap_test.yaml 
b/charts/amoro/tests/amoro-configmap_test.yaml
index 83d4eb1aa..d4fb8c265 100644
--- a/charts/amoro/tests/amoro-configmap_test.yaml
+++ b/charts/amoro/tests/amoro-configmap_test.yaml
@@ -49,18 +49,6 @@ tests:
           pattern:
             |
             bind-port: 1260
-  - it: Amoro configMap should reflect database.username if type is set to 
mysql
-    set:
-      amoroConf:
-        database:
-          type: mysql
-          username: aaa
-    asserts:
-      - matchRegex:
-          path: data["config.yaml"]
-          pattern:
-            |
-            username: "aaa"
   - it: Amoro configMap should reflect terminal iceberg params if 
terminal.backend is set to local
     set:
       amoroConf:
diff --git a/charts/amoro/tests/amoro-database-secret_test.yaml 
b/charts/amoro/tests/amoro-database-secret_test.yaml
index 9fba396f7..186e30c1f 100644
--- a/charts/amoro/tests/amoro-database-secret_test.yaml
+++ b/charts/amoro/tests/amoro-database-secret_test.yaml
@@ -69,7 +69,7 @@ tests:
           password: "123"
     asserts:
       - equal:
-          path: data.username
+          path: data.DatabaseUsername
           value: "abc"
           decodeBase64: true
   - it: Amoro database secret should reflect password if database type is set 
to mysql
@@ -81,6 +81,6 @@ tests:
           password: "123"
     asserts:
       - equal:
-          path: data.password
+          path: data.DatabasePassword
           value: "123"
           decodeBase64: true
\ No newline at end of file
diff --git a/charts/amoro/tests/amoro-deployment_test.yaml 
b/charts/amoro/tests/amoro-deployment_test.yaml
index d0d1d6ee4..5384e9bc5 100644
--- a/charts/amoro/tests/amoro-deployment_test.yaml
+++ b/charts/amoro/tests/amoro-deployment_test.yaml
@@ -117,7 +117,7 @@ tests:
             valueFrom:
               secretKeyRef:
                 name: test
-                key: username
+                key: DatabaseUsername
       - contains:
           path: spec.template.spec.containers[?(@.name == "amoro-ams")].env
           content:
@@ -125,7 +125,7 @@ tests:
             valueFrom:
               secretKeyRef:
                 name: test
-                key: password
+                key: DatabasePassword
   - it: Amoro Deployment should add env if database type is set to postgres
     template: amoro-deployment.yaml
     set:
@@ -141,7 +141,7 @@ tests:
             valueFrom:
               secretKeyRef:
                 name: test
-                key: username
+                key: DatabaseUsername
       - contains:
           path: spec.template.spec.containers[?(@.name == "amoro-ams")].env
           content:
@@ -149,7 +149,7 @@ tests:
             valueFrom:
               secretKeyRef:
                 name: test
-                key: password
+                key: DatabasePassword
   - it: Amoro Deployment should add env if set
     template: amoro-deployment.yaml
     set:

Reply via email to