internal

package
v0.21.5 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EmptyRolesListError        = eris.New("Empty Roles list found, must specify at least one role to bind to.")
	EmptyClusterRolesListError = eris.New("Empty ClusterRoles list found, must specify at least one role to bind to.")
)

Functions

This section is empty.

Types

type ClusterRBACBinder

type ClusterRBACBinder interface {
	/*
		Given a set of references to `ClusterRoles`, bind the given `ServiceAccount` to said `ClusterRoles` using
		Newly created `ClusterRoleBindings`.
	*/
	BindClusterRoles(
		ctx context.Context,
		serviceAccount client.ObjectKey,
		clusterRoles []client.ObjectKey,
	) error
	/*
		Given a set of references to `Roles`, bind the given `ServiceAccount` to said `Roles` using
		Newly created `RoleBindings`.
	*/
	BindRoles(
		ctx context.Context,
		serviceAccount client.ObjectKey,
		roles []client.ObjectKey,
	) error

	DeleteClusterRoleBindings(
		ctx context.Context,
		serviceAccount client.ObjectKey,
		clusterRoles []client.ObjectKey,
	) error

	DeleteRoleBindings(
		ctx context.Context,
		serviceAccount client.ObjectKey,
		roles []client.ObjectKey,
	) error
}

ClusterRBACBinder is a helper interface for the registrant, meant to create, and bind RBAC objects to ServiceAccounts in a remote cluster.

This interface supports both `Roles` and `ClusterRoles`. All resources being referenced must already exist, or the operations will fail.

func NewClusterRBACBinder

func NewClusterRBACBinder(
	clusterRoleBindingClient rbac_v1.ClusterRoleBindingClient,
	roleBindingClient rbac_v1.RoleBindingClient,
) ClusterRBACBinder

Provider function for the ClusterRBACBinder

type ClusterRBACBinderFactory

type ClusterRBACBinderFactory func(cfg clientcmd.ClientConfig) (ClusterRBACBinder, error)

Factory function to build a ClusterRBACBinder from a `ClientConfig` This is useful because an the operations performed by the `RbacBinder` require access to a cluster which will be determined by the caller.

func NewClusterRBACBinderFactory

func NewClusterRBACBinderFactory() ClusterRBACBinderFactory

Provider function fo the ClusterRBACBinderFactory

Directories

Path Synopsis
Package mock_internal is a generated GoMock package.
Package mock_internal is a generated GoMock package.

Jump to

Keyboard shortcuts

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