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 04b3a631 [operator] Change emoji and art logo (#639)
04b3a631 is described below
commit 04b3a631d77411302386638f510cb009c03d1fa5
Author: Jian Zhong <[email protected]>
AuthorDate: Mon Mar 10 11:45:55 2025 +0800
[operator] Change emoji and art logo (#639)
---
operator/pkg/component/component.go | 17 +++----
operator/pkg/helm/helm.go | 99 +------------------------------------
pkg/art/art.go | 2 +-
pkg/art/dubbo-ascii.txt | 10 ++--
4 files changed, 16 insertions(+), 112 deletions(-)
diff --git a/operator/pkg/component/component.go
b/operator/pkg/component/component.go
index 72eaadd2..ca35a31a 100644
--- a/operator/pkg/component/component.go
+++ b/operator/pkg/component/component.go
@@ -27,9 +27,9 @@ type Name string
const (
BaseComponentName Name = "Base"
- AdminComponentName Name = "Admin"
NacosRegisterComponentName Name = "Nacos"
ZookeeperRegisterComponentName Name = "Zookeeper"
+ AdminComponentName Name = "Admin"
)
type Component struct {
@@ -87,17 +87,16 @@ var AllComponents = []Component{
var (
userFacingCompNames = map[Name]string{
BaseComponentName: "Dubbo Resource Core",
- AdminComponentName: "Dubbo Admin Dashboard",
- NacosRegisterComponentName: "Dubbo Nacos Register Plane",
- ZookeeperRegisterComponentName: "Dubbo Zookeeper Register
Plane",
+ AdminComponentName: "Admin Dashboard",
+ NacosRegisterComponentName: "Nacos Register Plane",
+ ZookeeperRegisterComponentName: "Zookeeper Register Plane",
}
Icons = map[Name]string{
- BaseComponentName: "🛸",
- // TODO DubbodComponentName: "📡",
- NacosRegisterComponentName: "🪝",
- ZookeeperRegisterComponentName: "⚓",
- AdminComponentName: "🛰",
+ BaseComponentName: "🔭",
+ NacosRegisterComponentName: "🚡",
+ ZookeeperRegisterComponentName: "🚠",
+ AdminComponentName: "🔬",
}
)
diff --git a/operator/pkg/helm/helm.go b/operator/pkg/helm/helm.go
index b5e6888a..03515614 100644
--- a/operator/pkg/helm/helm.go
+++ b/operator/pkg/helm/helm.go
@@ -30,7 +30,6 @@ import (
"helm.sh/helm/v3/pkg/chartutil"
"helm.sh/helm/v3/pkg/engine"
"io/fs"
- "io/ioutil"
"os"
"path/filepath"
"sort"
@@ -40,10 +39,8 @@ import (
const (
// NotesFileNameSuffix is the file name suffix for helm notes.
// see https://helm.sh/docs/chart_template_guide/notes_files/
- NotesFileNameSuffix = ".txt"
- BaseChartName = "base"
- profilesDirName = "profiles"
- DefaultProfileFilename = "default.yaml"
+ NotesFileNameSuffix = ".txt"
+ BaseChartName = "base"
)
type Warnings = util.Errors
@@ -149,95 +146,3 @@ func getFilesRecursive(f fs.FS, root string) ([]string,
error) {
})
return result, err
}
-
-func readProfiles(chartsDir string) (map[string]bool, error) {
- profiles := map[string]bool{}
- f := manifests.BuiltinDir(chartsDir)
- dir, err := fs.ReadDir(f, profilesDirName)
- if err != nil {
- return nil, err
- }
- for _, f := range dir {
- trimmedString := strings.TrimSuffix(f.Name(), ".yaml")
- if f.Name() != trimmedString {
- profiles[trimmedString] = true
- }
- }
- return profiles, nil
-}
-
-func ListProfiles(charts string) ([]string, error) {
- profiles, err := readProfiles(charts)
- if err != nil {
- return nil, err
- }
- return stringBoolMapToSlice(profiles), nil
-}
-
-func stringBoolMapToSlice(m map[string]bool) []string {
- s := make([]string, 0, len(m))
- for k, v := range m {
- if v {
- s = append(s, k)
- }
- }
- return s
-}
-
-func GetProfileYAML(installPackagePath, profileOrPath string) (string, error) {
- if profileOrPath == "" {
- profileOrPath = "default"
- }
- profiles, err := readProfiles(installPackagePath)
- if err != nil {
- return "", fmt.Errorf("failed to read profiles: %v", err)
- }
- if profiles[profileOrPath] && installPackagePath != "" {
- profileOrPath = filepath.Join(installPackagePath, "profiles",
profileOrPath+".yaml")
- }
- baseCRYAML, err := ReadProfileYAML(profileOrPath, installPackagePath)
- if err != nil {
- return "", err
- }
-
- return baseCRYAML, nil
-}
-
-func readFile(path string) (string, error) {
- b, err := ioutil.ReadFile(path)
- return string(b), err
-}
-
-func ReadProfileYAML(profile, manifestsPath string) (string, error) {
- var err error
- var globalValues string
-
- switch {
- case util.IsFilePath(profile):
- if globalValues, err = readFile(profile); err != nil {
- return "", err
- }
- default:
- if globalValues, err = LoadValues(profile, manifestsPath); err
!= nil {
- return "", fmt.Errorf("failed to read profile %v from
%v: %v", profile, manifestsPath, err)
- }
- }
-
- return globalValues, nil
-}
-
-func LoadValues(profileName string, chartsDir string) (string, error) {
- path := strings.Join([]string{profilesDirName,
builtinProfileToFilename(profileName)}, "/")
- by, err := fs.ReadFile(manifests.BuiltinDir(chartsDir), path)
- if err != nil {
- return "", err
- }
- return string(by), nil
-}
-
-func builtinProfileToFilename(name string) string {
- if name == "" {
- return DefaultProfileFilename
- }
- return name + ".yaml"
-}
diff --git a/pkg/art/art.go b/pkg/art/art.go
index 8c5c5d38..23734efd 100644
--- a/pkg/art/art.go
+++ b/pkg/art/art.go
@@ -9,5 +9,5 @@ import (
var dubboASCIIArt string
func DubboColoredArt() string {
- return color.New(color.FgHiBlue).Add(color.Bold).Sprint(dubboASCIIArt)
+ return color.New(color.FgBlue).Add(color.Bold).Sprint(dubboASCIIArt)
}
diff --git a/pkg/art/dubbo-ascii.txt b/pkg/art/dubbo-ascii.txt
index aea3d77e..b355bdc9 100644
--- a/pkg/art/dubbo-ascii.txt
+++ b/pkg/art/dubbo-ascii.txt
@@ -1,5 +1,5 @@
- ____ _ _
-| _ \ _ _ | |__ | |__ ___
-| | | | | | | | | |_ \ | |_ \ / _ \
-| |_| | | |_| | | |_| | | |_| | | |_| |
-|____/ \____| |____/ |____/ \___/
\ No newline at end of file
+ ____ _ _
+| _ \ _ _ | |__ | |__ ___
+| | | || | | || |_ \ | |_ \ / _ \
+| |_| || |_| || |_| || |_| || |_| |
+|____/ \____||____/ |____/ \___/
\ No newline at end of file