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 6243f226 [operator] Uninstall logic completed
6243f226 is described below

commit 6243f22624227b7e4d08a90d6049a397edf099cf
Author: mfordjody <[email protected]>
AuthorDate: Tue Dec 24 19:29:31 2024 +0800

    [operator] Uninstall logic completed
---
 operator/cmd/cluster/install.go       |  2 +-
 operator/pkg/uninstall/uninstaller.go | 10 ++++++----
 operator/pkg/util/clog/clog.go        |  2 +-
 operator/pkg/util/clog/log/default.go |  2 +-
 operator/pkg/util/clog/log/scope.go   |  6 +++---
 5 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/operator/cmd/cluster/install.go b/operator/cmd/cluster/install.go
index 4f882737..9fd1a95f 100644
--- a/operator/cmd/cluster/install.go
+++ b/operator/cmd/cluster/install.go
@@ -17,7 +17,7 @@ import (
        "strings"
 )
 
-var installerScope = log.RegisterScope("installer", "installer")
+var installerScope = log.RegisterScope("installer")
 
 type installArgs struct {
        files            []string
diff --git a/operator/pkg/uninstall/uninstaller.go 
b/operator/pkg/uninstall/uninstaller.go
index 00b6f49a..0d019d21 100644
--- a/operator/pkg/uninstall/uninstaller.go
+++ b/operator/pkg/uninstall/uninstaller.go
@@ -82,10 +82,10 @@ func DeleteObjectsList(c kube.CLIClient, dryRun bool, log 
clog.Logger, objectsLi
        return errs.ToErrors()
 }
 
-func DeleteResource(kc kube.CLIClient, dryRun bool, log clog.Logger, obj 
*unstructured.Unstructured) error {
+func DeleteResource(kc kube.CLIClient, dryRun bool, _ clog.Logger, obj 
*unstructured.Unstructured) error {
        name := fmt.Sprintf("%v/%s.%s", obj.GroupVersionKind(), obj.GetName(), 
obj.GetNamespace())
        if dryRun {
-               log.LogAndPrintf("Not pruning object %s because of dry run.", 
name)
+               fmt.Printf("Not pruning object %s because of dry run.", name)
                return nil
        }
 
@@ -98,10 +98,12 @@ func DeleteResource(kc kube.CLIClient, dryRun bool, log 
clog.Logger, obj *unstru
                if !kerrors.IsNotFound(err) {
                        return err
                }
-               log.LogAndPrintf("object: %s is not being deleted because it no 
longer exists", name)
+               fmt.Printf("object: %s is not being deleted because it no 
longer exists", name)
+
                return nil
        }
 
-       log.LogAndPrintf(" ✔︎ Removed %s.", name)
+       fmt.Printf("✔︎ Removed %s.\n", name)
+
        return nil
 }
diff --git a/operator/pkg/util/clog/clog.go b/operator/pkg/util/clog/clog.go
index 89ff2107..1dbdbbf9 100644
--- a/operator/pkg/util/clog/clog.go
+++ b/operator/pkg/util/clog/clog.go
@@ -25,7 +25,7 @@ type Logger interface {
 func NewConsoleLogger(stdOut, stdErr io.Writer, scope *log.Scope) 
*ConsoleLogger {
        s := scope
        if s == nil {
-               s = log.RegisterScope(log.DefaultScopeName, 
log.DefaultScopeName)
+               s = log.RegisterScope(log.DefaultScopeName)
        }
        return &ConsoleLogger{
                stdOut: stdOut,
diff --git a/operator/pkg/util/clog/log/default.go 
b/operator/pkg/util/clog/log/default.go
index 717034c9..a0675095 100644
--- a/operator/pkg/util/clog/log/default.go
+++ b/operator/pkg/util/clog/log/default.go
@@ -1,7 +1,7 @@
 package log
 
 func registerDefaultScopes() (defaults *Scope) {
-       return registerScope(DefaultScopeName, "Unscoped logging messages.", 1)
+       return registerScope(DefaultScopeName, 1)
 }
 
 var defaultScope = registerDefaultScopes()
diff --git a/operator/pkg/util/clog/log/scope.go 
b/operator/pkg/util/clog/log/scope.go
index a42c8562..fb1012c9 100644
--- a/operator/pkg/util/clog/log/scope.go
+++ b/operator/pkg/util/clog/log/scope.go
@@ -27,11 +27,11 @@ var (
        lock   sync.RWMutex
 )
 
-func RegisterScope(name string, desc string) *Scope {
-       return registerScope(name, desc, 0)
+func RegisterScope(name string) *Scope {
+       return registerScope(name, 0)
 }
 
-func registerScope(name string, desc string, callerSkip int) *Scope {
+func registerScope(name string, callerSkip int) *Scope {
        if strings.ContainsAny(name, ":,.") {
                panic(fmt.Sprintf("scope name %s is invalid, it cannot contain 
colons, commas, or periods", name))
        }

Reply via email to