mirror of
https://github.com/rancher/types.git
synced 2025-08-30 10:17:53 +00:00
Namespace project and cluster
This commit is contained in:
parent
c833e41eb4
commit
469f4a724d
@ -1,6 +1,7 @@
|
||||
package v3
|
||||
|
||||
import (
|
||||
"github.com/rancher/norman/types"
|
||||
extv1 "k8s.io/api/extensions/v1beta1"
|
||||
rbacv1 "k8s.io/api/rbac/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
@ -56,6 +57,7 @@ type PodSecurityPolicyTemplate struct {
|
||||
}
|
||||
|
||||
type ProjectRoleTemplateBinding struct {
|
||||
types.Namespaced
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
@ -66,6 +68,7 @@ type ProjectRoleTemplateBinding struct {
|
||||
}
|
||||
|
||||
type ClusterRoleTemplateBinding struct {
|
||||
types.Namespaced
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
|
@ -95,12 +95,14 @@ func authzTypes(schemas *types.Schemas) *types.Schemas {
|
||||
&m.Move{From: "subject/kind", To: "subjectKind"},
|
||||
&m.Move{From: "subject/namespace", To: "subjectNamespace"},
|
||||
&m.Drop{Field: "subject"},
|
||||
&mapper.NamespaceIDMapper{},
|
||||
).
|
||||
AddMapperForType(&Version, v3.ClusterRoleTemplateBinding{},
|
||||
&m.Move{From: "subject/name", To: "subjectName"},
|
||||
&m.Move{From: "subject/kind", To: "subjectKind"},
|
||||
&m.Move{From: "subject/namespace", To: "subjectNamespace"},
|
||||
&m.Drop{Field: "subject"},
|
||||
&mapper.NamespaceIDMapper{},
|
||||
).
|
||||
AddMapperForType(&Version, v3.GlobalRoleBinding{},
|
||||
&m.Move{From: "subject/name", To: "subjectName"},
|
||||
|
@ -51,12 +51,14 @@ type ManagementContext struct {
|
||||
|
||||
Management managementv3.Interface
|
||||
RBAC rbacv1.Interface
|
||||
Core corev1.Interface
|
||||
}
|
||||
|
||||
func (c *ManagementContext) controllers() []controller.Starter {
|
||||
return []controller.Starter{
|
||||
c.Management,
|
||||
c.RBAC,
|
||||
c.Core,
|
||||
}
|
||||
}
|
||||
|
||||
@ -144,6 +146,11 @@ func NewManagementContext(config rest.Config) (*ManagementContext, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
context.Core, err = corev1.NewForConfig(config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
dynamicConfig := config
|
||||
if dynamicConfig.NegotiatedSerializer == nil {
|
||||
configConfig := dynamic.ContentConfig()
|
||||
|
Loading…
Reference in New Issue
Block a user