actionhelpers

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClusterRoleBindingListerMap

func NewClusterRoleBindingListerMap(clientset kubernetes.Interface) map[string]ClusterRoleBindingLister

NewClusterRoleBindingListerMap creates a map of RBAC version strings to their associated ClusterRoleBindingLister structs. Necessary so that callers to the ClusterRoleBindingLister interfaces don't need the kubernetes.Interface.

func RelatedItemsForPod

func RelatedItemsForPod(pod *corev1api.Pod, log logrus.FieldLogger) []velero.ResourceIdentifier

func RelatedItemsForServiceAccount

func RelatedItemsForServiceAccount(objectMeta metav1.Object, clusterRoleBindings []ClusterRoleBinding, log logrus.FieldLogger) []velero.ResourceIdentifier

Types

type ClusterRoleBinding

type ClusterRoleBinding interface {
	// Name returns the name of a ClusterRoleBinding.
	Name() string
	// ServiceAccountSubjects returns the names of subjects that are service accounts in the given namespace.
	ServiceAccountSubjects(namespace string) []string
	// RoleRefName returns the name of a ClusterRoleBinding's RoleRef.
	RoleRefName() string
}

ClusterRoleBinding abstracts access to ClusterRoleBindings whether they're v1 or v1beta1.

func ClusterRoleBindingsForAction

func ClusterRoleBindingsForAction(clusterRoleBindingListers map[string]ClusterRoleBindingLister, discoveryHelper velerodiscovery.Helper) ([]ClusterRoleBinding, error)

type ClusterRoleBindingLister

type ClusterRoleBindingLister interface {
	// List returns a slice of ClusterRoleBindings which can represent either v1 or v1beta1 ClusterRoleBindings.
	List() ([]ClusterRoleBinding, error)
}

ClusterRoleBindingLister allows for listing ClusterRoleBindings in a version-independent way.

type NoopClusterRoleBindingLister

type NoopClusterRoleBindingLister struct {
}

noopClusterRoleBindingLister exists to handle clusters where RBAC is disabled.

func (NoopClusterRoleBindingLister) List

type V1ClusterRoleBinding

type V1ClusterRoleBinding struct {
	Crb rbac.ClusterRoleBinding
}

func (V1ClusterRoleBinding) Name

func (c V1ClusterRoleBinding) Name() string

func (V1ClusterRoleBinding) RoleRefName

func (c V1ClusterRoleBinding) RoleRefName() string

func (V1ClusterRoleBinding) ServiceAccountSubjects

func (c V1ClusterRoleBinding) ServiceAccountSubjects(namespace string) []string

type V1ClusterRoleBindingLister

type V1ClusterRoleBindingLister struct {
	// contains filtered or unexported fields
}

func (V1ClusterRoleBindingLister) List

type V1beta1ClusterRoleBinding

type V1beta1ClusterRoleBinding struct {
	Crb rbacbeta.ClusterRoleBinding
}

func (V1beta1ClusterRoleBinding) Name

func (V1beta1ClusterRoleBinding) RoleRefName

func (c V1beta1ClusterRoleBinding) RoleRefName() string

func (V1beta1ClusterRoleBinding) ServiceAccountSubjects

func (c V1beta1ClusterRoleBinding) ServiceAccountSubjects(namespace string) []string

type V1beta1ClusterRoleBindingLister

type V1beta1ClusterRoleBindingLister struct {
	// contains filtered or unexported fields
}

func (V1beta1ClusterRoleBindingLister) List

Jump to

Keyboard shortcuts

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