Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RoleAuthMapping ¶
func RoleAuthMapping(roleAuths *RoleAuthBody, cmData map[string]string) *rbacv1.ClusterRole
RoleAuthMapping mapping RoleAuthBody as ClusterRole by configmap data.
Types ¶
type AuthItem ¶
type AuthItem struct { Verb VerbRepresent `json:"verb"` Resources map[string]VerbRepresent `json:"resources,omitempty"` }
type ClusterRoleSplit ¶
type ClusterRoleSplit map[string]VerbRepresent
ClusterRoleSplit holds the result of ClusterRole.
func SplitClusterRole ¶
func SplitClusterRole(clusterRole *rbacv1.ClusterRole) ClusterRoleSplit
SplitClusterRole split ClusterRole as into format: deployments: All services: Read clusters: Write
type RoleAuthBody ¶
type RoleAuthBody struct { ClusterRoleName string `json:"clusterRoleName,omitempty"` Scope string `json:"scope"` AuthItems map[string]AuthItem `json:"authItems"` }
RoleAuthBody the another transformed form of ClusterRole.
func ClusterRoleMapping ¶
func ClusterRoleMapping(clusterRole *rbacv1.ClusterRole, cmData map[string]string, verbose bool) *RoleAuthBody
ClusterRoleMapping mappings ClusterRole as RoleAuthBody by configmap data. cmData format as: deployments: "deployments;pods;replicasets;pods/status;deployments/status" services: "services;endpoints;pods"
type VerbRepresent ¶
type VerbRepresent string
const ( Null VerbRepresent = "null" Read VerbRepresent = "read" Write VerbRepresent = "write" All VerbRepresent = "all" )
Click to show internal directories.
Click to hide internal directories.