Documentation ¶
Index ¶
- func CreateOrUpdateClusterRole(ctx context.Context, c client.Client, cr *rbacv1.ClusterRole) error
- func CreateOrUpdateClusterRoleBinding(ctx context.Context, c client.Client, crb *rbacv1.ClusterRoleBinding) error
- func CreateOrUpdateRole(ctx context.Context, c client.Client, r *rbacv1.Role) error
- func CreateOrUpdateRoleBinding(ctx context.Context, c client.Client, rb *rbacv1.RoleBinding) error
- func DeleteClusterRole(ctx context.Context, c client.Client, key client.ObjectKey) error
- func DeleteClusterRoleBinding(ctx context.Context, c client.Client, key client.ObjectKey) error
- func NewClusterRole(name string, rules []rbacv1.PolicyRule) *rbacv1.ClusterRole
- func NewClusterRoleBinding(bindingName, roleName string, subjects []rbacv1.Subject) *rbacv1.ClusterRoleBinding
- func NewPolicyRule(apiGroups, resources, resourceNames, verbs []string, urls []string) rbacv1.PolicyRule
- func NewPolicyRules(rules ...rbacv1.PolicyRule) []rbacv1.PolicyRule
- func NewRole(roleName, namespace string, rules []rbacv1.PolicyRule) *rbacv1.Role
- func NewRoleBinding(bindingName, namespace, roleName string, subjects []rbacv1.Subject) *rbacv1.RoleBinding
- func NewSubject(kind, name, namespace string) rbacv1.Subject
- func NewSubjects(subjects ...rbacv1.Subject) []rbacv1.Subject
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateOrUpdateClusterRole ¶
CreateOrUpdateClusterRole attempts first to get the given clusterrole. If the clusterrole does not exist, the clusterrole will be created. Otherwise, if the clusterrole exists and the provided comparison func detects any changes an update is attempted. Updates are retried with backoff (See retry.DefaultRetry). Returns on failure an non-nil error.
func CreateOrUpdateClusterRoleBinding ¶
func CreateOrUpdateClusterRoleBinding(ctx context.Context, c client.Client, crb *rbacv1.ClusterRoleBinding) error
CreateOrUpdateClusterRoleBinding attempts first to get the given clusterrolebinding. If the clusterrolebinding does not exist, the clusterrolebinding will be created. Otherwise, if the clusterrolebinding exists and the provided comparison func detects any changes an update is attempted. Updates are retried with backoff (See retry.DefaultRetry). Returns on failure an non-nil error.
func CreateOrUpdateRole ¶
CreateOrUpdateRole attempts first to get the given role. If the role does not exist, the role will be created. Otherwise, if the role exists and the provided comparison func detects any changes an update is attempted. Updates are retried with backoff (See retry.DefaultRetry). Returns on failure an non-nil error.
func CreateOrUpdateRoleBinding ¶
CreateOrUpdateRoleBinding attempts first to get the given rolebinding. If the rolebinding does not exist, the rolebinding will be created. Otherwise, if the rolebinding exists and the provided comparison func detects any changes an update is attempted. Updates are retried with backoff (See retry.DefaultRetry). Returns on failure an non-nil error.
func DeleteClusterRole ¶
DeleteClusterRole attempts to delete a k8s cluster role if existing or returns an error.
func DeleteClusterRoleBinding ¶
DeleteClusterRoleBinding attempts to delete a k8s cluster role binding if existing or returns an error.
func NewClusterRole ¶
func NewClusterRole(name string, rules []rbacv1.PolicyRule) *rbacv1.ClusterRole
NewClusterRole returns a new clusterrole
func NewClusterRoleBinding ¶
func NewClusterRoleBinding(bindingName, roleName string, subjects []rbacv1.Subject) *rbacv1.ClusterRoleBinding
NewClusterRoleBinding returns a new clusterrolebinding
func NewPolicyRule ¶
func NewPolicyRule(apiGroups, resources, resourceNames, verbs []string, urls []string) rbacv1.PolicyRule
NewPolicyRule returns a new policyrule
func NewPolicyRules ¶
func NewPolicyRules(rules ...rbacv1.PolicyRule) []rbacv1.PolicyRule
NewPolicyRules returns a slice of policyrule objects
func NewRole ¶
func NewRole(roleName, namespace string, rules []rbacv1.PolicyRule) *rbacv1.Role
NewRole returns a new k8s role
func NewRoleBinding ¶
func NewRoleBinding(bindingName, namespace, roleName string, subjects []rbacv1.Subject) *rbacv1.RoleBinding
NewRoleBinding returns a new role binding
func NewSubject ¶
NewSubject returns a new subject
Types ¶
This section is empty.