mirror of
https://github.com/rancher/types.git
synced 2025-09-27 21:15:04 +00:00
Add k8s dynamic client to management context
This commit is contained in:
@@ -29,6 +29,7 @@ import (
|
||||
"github.com/sirupsen/logrus"
|
||||
"k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
k8dynamic "k8s.io/client-go/dynamic"
|
||||
"k8s.io/client-go/kubernetes"
|
||||
"k8s.io/client-go/rest"
|
||||
)
|
||||
@@ -145,6 +146,7 @@ type ManagementContext struct {
|
||||
LocalConfig *rest.Config
|
||||
RESTConfig rest.Config
|
||||
UnversionedClient rest.Interface
|
||||
DynamicClient k8dynamic.Interface
|
||||
K8sClient kubernetes.Interface
|
||||
APIExtClient clientset.Interface
|
||||
Schemas *types.Schemas
|
||||
@@ -275,6 +277,11 @@ func NewManagementContext(config rest.Config) (*ManagementContext, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
context.DynamicClient, err = k8dynamic.NewForConfig(&config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
context.RBAC, err = rbacv1.NewForConfig(config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
Reference in New Issue
Block a user