rbac

package
v0.0.0-...-a5c132e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 13, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateOrUpdateClusterRole

func CreateOrUpdateClusterRole(ctx context.Context, c client.Client, cr *rbacv1.ClusterRole) error

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

func CreateOrUpdateRole(ctx context.Context, c client.Client, r *rbacv1.Role) error

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

func CreateOrUpdateRoleBinding(ctx context.Context, c client.Client, rb *rbacv1.RoleBinding) error

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

func DeleteClusterRole(ctx context.Context, c client.Client, key client.ObjectKey) error

DeleteClusterRole attempts to delete a k8s cluster role if existing or returns an error.

func DeleteClusterRoleBinding

func DeleteClusterRoleBinding(ctx context.Context, c client.Client, key client.ObjectKey) error

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

func NewSubject(kind, name, namespace string) rbacv1.Subject

NewSubject returns a new subject

func NewSubjects

func NewSubjects(subjects ...rbacv1.Subject) []rbacv1.Subject

NewSubjects returns a slice of subject objects

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL