rbutils

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compose

func Compose(rbName string, namespace string, subjects []rbacv1.Subject, ref rbacv1.RoleRef) *rbacv1.RoleBinding

Compose returns a RoleBinding object based on the given parameters.

func Create

func Create(nsObject *objectcontext.ObjectContext, roleBinding rbacv1.RoleBinding) error

Create takes care of creating a RoleBinding object in a namespace from an existing roleBinding.

func CreateHNSView

func CreateHNSView(nsObject *objectcontext.ObjectContext) error

CreateHNSView creates the cluster role and cluster role binding HNS objects associated with the namespace.

func HNSViewName

func HNSViewName(nsName string) string

HNSViewName returns the name of the HNS view role associated with a namespace.

func IsHNSRelated

func IsHNSRelated(roleBinding client.Object) bool

IsHNSRelated checks if a RoleBinding object is valid.

func IsRoleBinding

func IsRoleBinding(object client.Object) bool

IsRoleBinding returns true if an object is of type RoleBinding.

func IsServiceAccount

func IsServiceAccount(roleBinding client.Object) bool

IsServiceAccount returns true if a subject in a RoleBinding is a ServiceAccount and false otherwise.

func IsSubjectInSubjects

func IsSubjectInSubjects(subjects []rbacv1.Subject, subjectToFind rbacv1.Subject) bool

IsSubjectInSubjects returns whether a subject is in a slice of subjects.

func NamespaceHNSView

NamespaceHNSView returns the cluster role and cluster role binding HNS objects associated with the namespace.

func NamespaceHNSViewCRB

func NamespaceHNSViewCRB(rbObject *objectcontext.ObjectContext) (*objectcontext.ObjectContext, error)

NamespaceHNSViewCRB returns the HNS View ClusterRoleBinding associated with a namespace.

func RoleRef

func RoleRef(roleBinding client.Object) rbacv1.RoleRef

RoleRef returns the roleRef of a roleBinding.

func Subjects

func Subjects(roleBinding client.Object) []rbacv1.Subject

Subjects returns a slice of subjects from a roleBinding.

func UpdateNamespaceHNSViewCRBSubjects

func UpdateNamespaceHNSViewCRBSubjects(hnsViewClusterRoleBinding *objectcontext.ObjectContext, subjects []rbacv1.Subject) error

UpdateNamespaceHNSViewCRBSubjects updates the subjects of a ClusterRoleBinding.

Types

This section is empty.

Jump to

Keyboard shortcuts

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