Documentation
¶
Index ¶
Constants ¶
View Source
const ( LabelNamespacePermissionControl = "ns.tagesspiegel.de/permission-control" LabelManagedBy = "app.kubernetes.io/managed-by" LabelNamespaceName = "ns.tagesspiegel.de/source-namespace" AnnotationNamespaceRoleBindingSubjects = "ns.tagesspiegel.de/rolebinding-subjects" AnnotationNamespaceRoleBindingRoleRef = "ns.tagesspiegel.de/rolebinding-roleref" AnnotationNamespaceCustomRoleRules = "ns.tagesspiegel.de/custom-role-rules" )
View Source
const ( KeyKind = "kind" KeyAPIGroup = "apiGroup" KeyName = "name" KeyNamespace = "namespace" KeyVerbs = "verbs" KeyAPIGroups = "apiGroups" KeyResources = "resources" KeyResourceNames = "resourceNames" )
Variables ¶
Functions ¶
func ParseCustomRole ¶
func ParseCustomRole(str string) ([]rbacv1.PolicyRule, error)
ParseCustomRole parses a string of custom role rules into a slice of policy rules
Example:
rules, err := ParseCustomRole("verbs=get,list;apiGroups=apps,extensions;resources=deployments,replicasets::verbs=get,watch;apiGroups=;resources=pods") if err != nil { // handle error } fmt.Println(rules) // [{Verbs:[get list] APIGroups:[apps extensions] Resources:[deployments replicasets]} {Verbs:[get watch] APIGroups:[] Resources:[pods]}]
func ParseRoleBindingRoleRef ¶
ParseRoleBindingRoleRef parses a string of role binding role ref into a role ref
Example:
roleRef, err := ParseRoleBindingRoleRef("kind:Role;apiGroup:rbac.authorization.k8s.io;name:my-role") if err != nil { // handle error } fmt.Println(roleRef) // {APIGroup:rbac.authorization.k8s.io Kind:Role Name:my-role}
func ParseRoleBindingSubjects ¶
ParseRoleBindingSubjects parses a string of role binding subjects into a slice of subjects
Example:
rules, err := ParseRoleBindingSubjects("kind=ServiceAccount;name=foo;namespace=bar,kind=ServiceAccount;name=foo2;namespace=bar2") if err != nil { // handle error } fmt.Println(rules) // [{Kind:ServiceAccount Name:foo Namespace:bar} {Kind:ServiceAccount Name:foo2 Namespace:bar2}]
Types ¶
type LabelChecker ¶
type LabelChecker struct {
ExpectedLabel string
}
func (*LabelChecker) Create ¶
func (l *LabelChecker) Create(e event.CreateEvent) bool
func (*LabelChecker) Delete ¶
func (l *LabelChecker) Delete(e event.DeleteEvent) bool
func (*LabelChecker) Generic ¶
func (l *LabelChecker) Generic(e event.GenericEvent) bool
func (*LabelChecker) Update ¶
func (l *LabelChecker) Update(e event.UpdateEvent) bool
type NamespaceReconciler ¶
NamespaceReconciler reconciles a Namespace object
func (*NamespaceReconciler) Reconcile ¶
Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.
func (*NamespaceReconciler) SetupWithManager ¶
func (r *NamespaceReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
Click to show internal directories.
Click to hide internal directories.