You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by zh...@apache.org on 2024/12/13 10:48:27 UTC

(dubbo-kubernetes) branch master updated: [operator] update manifest and errs util

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 1724c106 [operator] update manifest and errs util
1724c106 is described below

commit 1724c1062c16f298172c92480ee8f18b7417454b
Author: mfordjody <11...@qq.com>
AuthorDate: Fri Dec 13 18:48:15 2024 +0800

    [operator] update manifest and errs util
---
 operator/pkg/render/manifest.go | 10 +++++++++-
 operator/pkg/util/errs.go       | 13 +++++++++----
 2 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/operator/pkg/render/manifest.go b/operator/pkg/render/manifest.go
index 4aa82411..3f49e668 100644
--- a/operator/pkg/render/manifest.go
+++ b/operator/pkg/render/manifest.go
@@ -3,6 +3,7 @@ package render
 import (
 	"fmt"
 	"github.com/apache/dubbo-kubernetes/operator/cmd/validation"
+	"github.com/apache/dubbo-kubernetes/operator/pkg/apis"
 	"github.com/apache/dubbo-kubernetes/operator/pkg/component"
 	"github.com/apache/dubbo-kubernetes/operator/pkg/manifest"
 	"github.com/apache/dubbo-kubernetes/operator/pkg/util"
@@ -63,7 +64,6 @@ func GenerateManifest(files []string, setFlags []string, logger clog.Logger) ([]
 			return nil, nil, fmt.Errorf("get component %v: %v", comp.UserFacingName, err)
 		}
 		for _, spec := range specs {
-
 		}
 	}
 	return nil, nil, nil
@@ -81,3 +81,11 @@ func validateDubboOperator(dop values.Map, logger clog.Logger) error {
 	}
 	return nil
 }
+
+func applyComponentValuesToHelmValues(comp component.Component, spec apis.MetadataCompSpec, merged values.Map) values.Map {
+	root := comp.HelmTreeRoot
+	if spec.Namespace != "" {
+		spec.Namespace = "dubbo-system"
+	}
+	return merged
+}
diff --git a/operator/pkg/util/errs.go b/operator/pkg/util/errs.go
index 15290087..d2d6cd10 100644
--- a/operator/pkg/util/errs.go
+++ b/operator/pkg/util/errs.go
@@ -1,5 +1,7 @@
 package util
 
+import "fmt"
+
 const (
 	defaultSeparator = ", "
 )
@@ -10,6 +12,13 @@ func (e Errors) Error() string {
 	return ToString(e, defaultSeparator)
 }
 
+func (e Errors) ToErrors() error {
+	if len(e) == 0 {
+		return nil
+	}
+	return fmt.Errorf("%s", e)
+}
+
 func ToString(errors []error, separator string) string {
 	var out string
 	for i, e := range errors {
@@ -24,10 +33,6 @@ func ToString(errors []error, separator string) string {
 	return out
 }
 
-func (e Errors) ToString() {
-
-}
-
 func NewErrs(err error) Errors {
 	if err == nil {
 		return nil