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 abe75313 [operator] Add apply dynamic client
abe75313 is described below

commit abe753133138b98cea1378a189b64392ff1b817a
Author: mfordjody <[email protected]>
AuthorDate: Tue Dec 3 20:11:45 2024 +0800

    [operator] Add apply dynamic client
---
 pkg/kube/client.go | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/pkg/kube/client.go b/pkg/kube/client.go
index ffe63086..62f7e9b7 100644
--- a/pkg/kube/client.go
+++ b/pkg/kube/client.go
@@ -1,15 +1,33 @@
 package kube
 
+import (
+       "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
+       "k8s.io/apimachinery/pkg/runtime/schema"
+       "k8s.io/client-go/dynamic"
+)
+
 type client struct {
+       dynamic dynamic.Interface
 }
 
 type Client interface {
+       Dynamic() dynamic.Interface
 }
 
 type CLIClient interface {
+       DynamicClientFor(gvk schema.GroupVersionKind, obj 
*unstructured.Unstructured, namespace string) (dynamic.ResourceInterface, error)
 }
 
 var (
        _ Client    = &client{}
        _ CLIClient = &client{}
 )
+
+func (c *client) Dynamic() dynamic.Interface {
+       return c.dynamic
+}
+
+func (c *client) DynamicClientFor(gvk schema.GroupVersionKind, obj 
*unstructured.Unstructured, namespace string) (dynamic.ResourceInterface, 
error) {
+       var dr dynamic.ResourceInterface
+       return dr, nil
+}

Reply via email to