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

zhongxjian pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-kubernetes.git


The following commit(s) were added to refs/heads/master by this push:
     new 983f0b0d [operator] filter helm txt file
983f0b0d is described below

commit 983f0b0d8d76713dd36a8ccbfbff4bb9f811a6eb
Author: mfordjody <[email protected]>
AuthorDate: Sun Dec 29 08:17:59 2024 +0800

    [operator] filter helm txt file
---
 manifests/charts/admin/templates/NOTES.txt | 76 +++++++++++++++---------------
 operator/pkg/helm/helm.go                  | 36 +++++++-------
 2 files changed, 56 insertions(+), 56 deletions(-)

diff --git a/manifests/charts/admin/templates/NOTES.txt 
b/manifests/charts/admin/templates/NOTES.txt
index 55ed94ef..02c5c911 100644
--- a/manifests/charts/admin/templates/NOTES.txt
+++ b/manifests/charts/admin/templates/NOTES.txt
@@ -1,63 +1,63 @@
-{{/*⏳ Please wait for all the activated components to be deployed.*/}}
+⏳ Please wait for all the activated components to be deployed.
 
-{{/*Core: Admin*/}}
-{{/*Version: {{ .Values.image.tag }}*/}}
+Core: Admin
+Version: {{ .Values.image.tag }}
 
-{{/*🔄 Please wait a few minutes for other dependent components to finish 
deploying.*/}}
+🔄 Please wait a few minutes for other dependent components to finish deploying.
 
-{{/*{{- if .Values.zookeeper.enabled }}*/}}
+{{- if .Values.zookeeper.enabled }}
 
-{{/*Dependency: ZooKeeper*/}}
-{{/*Version: {{ .Values.zookeeper.image.tag }}*/}}
+Dependency: ZooKeeper
+Version: {{ .Values.zookeeper.image.tag }}
 
-{{/*🚨 If you are using the Nacos registry, Please disable Zookeeper and enable 
Nacos.*/}}
-{{/*   Otherwise, Zookeeper is used by default.*/}}
+🚨 If you are using the Nacos registry, Please disable Zookeeper and enable 
Nacos.
+   Otherwise, Zookeeper is used by default.
 
-{{/*🎊 You have enabled the internal Register Center.*/}}
-{{/*{{- else if .Values.nacos.enabled }}*/}}
+🎊 You have enabled the internal Register Center.
+{{- else if .Values.nacos.enabled }}
 
-{{/*Dependency: Nacos*/}}
-{{/*Version: {{ .Values.nacos.image.tag }}*/}}
+Dependency: Nacos
+Version: {{ .Values.nacos.image.tag }}
 
-{{/*🎊 You have enabled the internal Register Center.*/}}
-{{/*{{- end }}*/}}
+🎊 You have enabled the internal Register Center.
+{{- end }}
 
-{{/*{{- if and (eq .Values.zookeeper.enabled false) (eq .Values.nacos.enabled 
false) }}*/}}
-{{/*Dependency: ❎*/}}
+{{- if and (eq .Values.zookeeper.enabled false) (eq .Values.nacos.enabled 
false) }}
+Dependency: ❎
 
-{{/*🚫 You have disabled the internal Register Center.*/}}
+🚫 You have disabled the internal Register Center.
 
-{{/*Please provide an external Register center to ensure proper service 
operation.*/}}
+Please provide an external Register center to ensure proper service operation.
 
-{{/*{{- end }}*/}}
+{{- end }}
 
-{{/*{{- if .Values.ingress.enabled }}*/}}
+{{- if .Values.ingress.enabled }}
 
-{{/*Exposer: ✅️*/}}
+Exposer: ✅️
 
-{{/*So you should be able to access the website at the following URL:*/}}
+So you should be able to access the website at the following URL:
 
-{{/*1. http://{{ .Values.ingress.hosts.admin }}*/}}
-{{/*2. http://{{ .Values.ingress.hosts.prometheus }}*/}}
-{{/*3. http://{{ .Values.ingress.hosts.grafana }}*/}}
+1. http://{{ .Values.ingress.hosts.admin }}
+2. http://{{ .Values.ingress.hosts.prometheus }}
+3. http://{{ .Values.ingress.hosts.grafana }}
 
-{{/*🎊 You have enabled the internal entrance controller.*/}}
+🎊 You have enabled the internal entrance controller.
 
-{{/*{{- else }}*/}}
+{{- else }}
 
-{{/*Exposer: ❎*/}}
+Exposer: ❎
 
-{{/*🚫 You have disabled the internal entrance controller.*/}}
+🚫 You have disabled the internal entrance controller.
 
-{{/*{{- end }}*/}}
+{{- end }}
 
-{{/*{{- if not .Values.persistence.enabled }}*/}}
+{{- if not .Values.persistence.enabled }}
 
-{{/*           #########################################################*/}}
-{{/*           #         ⚠ Not enabled for persistent storage.         #*/}}
-{{/*           #     If you have important data, please enable it.     #*/}}
-{{/*           #########################################################*/}}
+           #########################################################
+           #         ⚠ Not enabled for persistent storage.         #
+           #     If you have important data, please enable it.     #
+           #########################################################
 
-{{/*{{- end }}*/}}
+{{- end }}
 
-{{/*🌹 For more details, please visit https://dubbo.apache.org.*/}}
+🌹 For more details, please visit https://dubbo.apache.org.
diff --git a/operator/pkg/helm/helm.go b/operator/pkg/helm/helm.go
index 3563759a..0d848b13 100644
--- a/operator/pkg/helm/helm.go
+++ b/operator/pkg/helm/helm.go
@@ -28,6 +28,23 @@ const (
 
 type Warnings = util.Errors
 
+func Reader(namespace string, directory string, dop values.Map) 
([]manifest.Manifest, util.Errors, error) {
+       vals, ok := dop.GetPathMap("spec.values")
+       if !ok {
+               return nil, nil, fmt.Errorf("failed to get values from dop: 
%v", ok)
+       }
+       path := pathJoin("charts", directory)
+       pkgPath := dop.GetPathString("spec.packagePath")
+       f := manifests.BuiltinDir(pkgPath)
+       chrt, err := loadChart(f, path)
+       output, warnings, err := readerChart(namespace, vals, chrt)
+       if err != nil {
+               return nil, nil, fmt.Errorf("render chart: %v", err)
+       }
+       mfs, err := manifest.Parse(output)
+       return mfs, warnings, err
+}
+
 func readerChart(namespace string, chrtVals values.Map, chrt *chart.Chart) 
([]string, Warnings, error) {
        opts := chartutil.ReleaseOptions{
                Name:      "dubbo",
@@ -49,7 +66,7 @@ func readerChart(namespace string, chrtVals values.Map, chrt 
*chart.Chart) ([]st
        var warnings Warnings
        keys := make([]string, 0, len(files))
        for k := range files {
-               if strings.HasPrefix(k, NotesFileNameSuffix) {
+               if strings.HasSuffix(k, NotesFileNameSuffix) {
                        continue
                }
                keys = append(keys, k)
@@ -98,23 +115,6 @@ func stripPrefix(path, prefix string) string {
        return strings.Join(pv[pl:], "/")
 }
 
-func Reader(namespace string, directory string, dop values.Map) 
([]manifest.Manifest, util.Errors, error) {
-       vals, ok := dop.GetPathMap("spec.values")
-       if !ok {
-               return nil, nil, fmt.Errorf("failed to get values from dop: 
%v", ok)
-       }
-       path := pathJoin("charts", directory)
-       pkgPath := dop.GetPathString("spec.packagePath")
-       f := manifests.BuiltinDir(pkgPath)
-       chrt, err := loadChart(f, path)
-       output, warnings, err := readerChart(namespace, vals, chrt)
-       if err != nil {
-               return nil, nil, fmt.Errorf("render chart: %v", err)
-       }
-       mfs, err := manifest.Parse(output)
-       return mfs, warnings, err
-}
-
 func getFilesRecursive(f fs.FS, root string) ([]string, error) {
        result := []string{}
        err := fs.WalkDir(f, root, func(path string, d fs.DirEntry, err error) 
error {

Reply via email to