Skip to content

Commit

Permalink
Add gvk for connectcluster
Browse files Browse the repository at this point in the history
Signed-off-by: sayedppqq <[email protected]>
  • Loading branch information
sayedppqq committed May 24, 2024
1 parent e9144db commit 163be05
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/monitor/dashboard/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"encoding/json"
"fmt"
"io"
kapi "kubedb.dev/apimachinery/apis/kafka/v1alpha1"
"log"
"net/http"
"os"
Expand All @@ -45,6 +46,12 @@ func getDB(f cmdutil.Factory, resource, ns, name string) (*unstructured.Unstruct
return nil, err
}

if resource == kapi.ResourcePluralConnectCluster {
kGvk := kapi.SchemeGroupVersion
kRes := schema.GroupVersionResource{Group: kGvk.Group, Version: kGvk.Version, Resource: resource}
return dc.Resource(kRes).Namespace(ns).Get(context.TODO(), name, metav1.GetOptions{})
}

gvk := api.SchemeGroupVersion
dbRes := schema.GroupVersionResource{Group: gvk.Group, Version: gvk.Version, Resource: resource}
return dc.Resource(dbRes).Namespace(ns).Get(context.TODO(), name, metav1.GetOptions{})
Expand Down

0 comments on commit 163be05

Please sign in to comment.