diff --git a/apis/authorization.cattle.io/v1/schema/schema.go b/apis/authorization.cattle.io/v1/schema/schema.go index 855b61f8..9ec486a9 100644 --- a/apis/authorization.cattle.io/v1/schema/schema.go +++ b/apis/authorization.cattle.io/v1/schema/schema.go @@ -28,7 +28,6 @@ var ( schema.SubContext = "projects" }). MustImport(&Version, v1.ProjectRoleTemplate{}). - MustImport(&Version, v1.ProjectRoleTemplateBinding{}). MustImport(&Version, v1.PodSecurityPolicyTemplate{}). MustImport(&Version, v1.ClusterRoleTemplate{}). MustImport(&Version, v1.ClusterRoleTemplateBinding{}). diff --git a/config/context.go b/config/context.go index fcf435f6..e0736993 100644 --- a/config/context.go +++ b/config/context.go @@ -12,6 +12,7 @@ import ( workloadv1 "github.com/rancher/types/apis/workload.cattle.io/v1" "github.com/sirupsen/logrus" "k8s.io/client-go/dynamic" + "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" ) @@ -35,6 +36,7 @@ type WorkloadContext struct { ClusterName string RESTConfig rest.Config UnversionedClient rest.Interface + K8sClient kubernetes.Interface Apps appsv1beta2.Interface Workload workloadv1.Interface @@ -104,6 +106,11 @@ func NewWorkloadContext(clusterConfig, config rest.Config, clusterName string) ( return nil, err } + context.K8sClient, err = kubernetes.NewForConfig(&config) + if err != nil { + return nil, err + } + context.Apps, err = appsv1beta2.NewForConfig(config) if err != nil { return nil, err