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 de22ec74 [operator] Add dubbo scheme logic
de22ec74 is described below

commit de22ec74d93711d6cac94ffe17785a459da9a33d
Author: mfordjody <[email protected]>
AuthorDate: Tue Dec 3 20:22:41 2024 +0800

    [operator] Add dubbo scheme logic
---
 pkg/kube/client.go | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/pkg/kube/client.go b/pkg/kube/client.go
index 62f7e9b7..22ae4a54 100644
--- a/pkg/kube/client.go
+++ b/pkg/kube/client.go
@@ -1,9 +1,15 @@
 package kube
 
 import (
+       apiextensionsv1 
"k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
        "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
+       "k8s.io/apimachinery/pkg/runtime"
        "k8s.io/apimachinery/pkg/runtime/schema"
+       "k8s.io/apimachinery/pkg/runtime/serializer"
+       utilruntime "k8s.io/apimachinery/pkg/util/runtime"
        "k8s.io/client-go/dynamic"
+       kubescheme "k8s.io/client-go/kubernetes/scheme"
+       "k8s.io/client-go/tools/clientcmd"
 )
 
 type client struct {
@@ -18,6 +24,12 @@ type CLIClient interface {
        DynamicClientFor(gvk schema.GroupVersionKind, obj 
*unstructured.Unstructured, namespace string) (dynamic.ResourceInterface, error)
 }
 
+type ClientOption func(cliClient CLIClient) CLIClient
+
+func NewClientClient(clientCfg clientcmd.ClientConfig) (CLIClient, error) {
+       return nil, nil
+}
+
 var (
        _ Client    = &client{}
        _ CLIClient = &client{}
@@ -31,3 +43,19 @@ func (c *client) DynamicClientFor(gvk 
schema.GroupVersionKind, obj *unstructured
        var dr dynamic.ResourceInterface
        return dr, nil
 }
+
+var (
+       DubboScheme = dubboScheme()
+       DubboCodec  = serializer.NewCodecFactory(DubboScheme)
+)
+
+func dubboScheme() *runtime.Scheme {
+       scheme := runtime.NewScheme()
+       utilruntime.Must(kubescheme.AddToScheme(scheme))
+       utilruntime.Must(apiextensionsv1.AddToScheme(scheme))
+       return scheme
+}
+
+func SlowConvertToRuntimeObject() {
+       return
+}

Reply via email to