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 a8946870 [operator] updat upgrade and delete proto json
a8946870 is described below

commit a8946870190233e2ea2daf8c8a1c2125223b7feb
Author: mfordjody <[email protected]>
AuthorDate: Sat Dec 14 10:27:05 2024 +0800

    [operator] updat upgrade and delete proto json
---
 operator/cmd/cluster/upgrade.go       | 25 ++++++------
 operator/pkg/apis/value_types_json.go | 72 -----------------------------------
 2 files changed, 14 insertions(+), 83 deletions(-)

diff --git a/operator/cmd/cluster/upgrade.go b/operator/cmd/cluster/upgrade.go
index 89136348..0abc4b53 100644
--- a/operator/cmd/cluster/upgrade.go
+++ b/operator/cmd/cluster/upgrade.go
@@ -2,6 +2,7 @@ package cluster
 
 import (
        "github.com/apache/dubbo-kubernetes/dubboctl/pkg/cli"
+       //"github.com/apache/dubbo-kubernetes/operator/pkg/util/clog"
        "github.com/spf13/cobra"
 )
 
@@ -10,22 +11,24 @@ type upgradeArgs struct {
 }
 
 func UpgradeCmd(ctx cli.Context) *cobra.Command {
-       rootArgs := &RootArgs{}
-       upArgs := &upgradeArgs{
-               installArgs: &installArgs{},
-       }
+       //rootArgs := &RootArgs{}
+       //upArgs := &upgradeArgs{
+       //      installArgs: &installArgs{},
+       //}
        cmd := &cobra.Command{
                Use:     "upgrade",
                Short:   "Upgrade the Dubbo Control Plane",
                Long:    "",
                Example: "",
-               RunE: func(cmd *cobra.Command, args []string) error {
-                       client, err := ctx.CLIClient()
-                       if err != nil {
-                               return err
-                       }
-                       return install(client, rootArgs, upArgs.installArgs)
-               },
+               //RunE: func(cmd *cobra.Command, args []string) error {
+               //      cl := clog.NewConsoleLogger(cmd.OutOrStdout(), 
cmd.ErrOrStderr(), installerScope)
+               //      p := NewPrinterForWriter(cmd.OutOrStderr())
+               //      client, err := ctx.CLIClient()
+               //      if err != nil {
+               //              return err
+               //      }
+               //      return nil
+               //},
        }
        return cmd
 }
diff --git a/operator/pkg/apis/value_types_json.go 
b/operator/pkg/apis/value_types_json.go
deleted file mode 100644
index 8d93099e..00000000
--- a/operator/pkg/apis/value_types_json.go
+++ /dev/null
@@ -1,72 +0,0 @@
-package apis
-
-import (
-       "bytes"
-       "encoding/json"
-
-       github_com_golang_protobuf_jsonpb "github.com/golang/protobuf/jsonpb" 
// nolint: depguard
-       "google.golang.org/protobuf/types/known/wrapperspb"
-       "k8s.io/apimachinery/pkg/util/intstr"
-)
-
-// nolint
-var _ github_com_golang_protobuf_jsonpb.JSONPBUnmarshaler = &IntOrString{}
-
-func (i *IntOrString) UnmarshalJSON(value []byte) error {
-       if value[0] == '"' {
-               i.Type = int64(intstr.String)
-               var s string
-               err := json.Unmarshal(value, &s)
-               if err != nil {
-                       return err
-               }
-               i.StrVal = &wrapperspb.StringValue{Value: s}
-               return nil
-       }
-       i.Type = int64(intstr.Int)
-       var s int32
-       err := json.Unmarshal(value, &s)
-       if err != nil {
-               return err
-       }
-       i.IntVal = &wrapperspb.Int32Value{Value: s}
-       return nil
-}
-
-func (i *IntOrString) MarshalJSONPB(_ 
*github_com_golang_protobuf_jsonpb.Marshaler) ([]byte, error) {
-       return i.MarshalJSON()
-}
-
-func (i *IntOrString) MarshalJSON() ([]byte, error) {
-       if i.IntVal != nil {
-               return json.Marshal(i.IntVal.GetValue())
-       }
-       return json.Marshal(i.StrVal.GetValue())
-}
-
-func (i *IntOrString) UnmarshalJSONPB(_ 
*github_com_golang_protobuf_jsonpb.Unmarshaler, value []byte) error {
-       return i.UnmarshalJSON(value)
-}
-
-func (i *IntOrString) ToKubernetes() intstr.IntOrString {
-       if i.IntVal != nil {
-               return intstr.FromInt32(i.GetIntVal().GetValue())
-       }
-       return intstr.FromString(i.GetStrVal().GetValue())
-}
-
-// MarshalJSON is a custom marshaler for Values
-func (in *Values) MarshalJSON() ([]byte, error) {
-       str, err := OperatorMarshaler.MarshalToString(in)
-       return []byte(str), err
-}
-
-// UnmarshalJSON is a custom unmarshaler for Values
-func (in *Values) UnmarshalJSON(b []byte) error {
-       return OperatorUnmarshaler.Unmarshal(bytes.NewReader(b), in)
-}
-
-var (
-       OperatorMarshaler   = &github_com_golang_protobuf_jsonpb.Marshaler{}
-       OperatorUnmarshaler = &github_com_golang_protobuf_jsonpb.Unmarshaler{}
-)

Reply via email to