definition

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package definition implements the RBAC manager's support for XRDs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClusterRolesDiffer

func ClusterRolesDiffer(current, desired runtime.Object) bool

ClusterRolesDiffer returns true if the supplied objects are different ClusterRoles. We consider ClusterRoles to be different if their labels and rules do not match.

func RenderClusterRoles

func RenderClusterRoles(d *v1.CompositeResourceDefinition) []rbacv1.ClusterRole

RenderClusterRoles returns ClusterRoles for the supplied XRD.

func Setup

func Setup(mgr ctrl.Manager, o controller.Options) error

Setup adds a controller that reconciles a CompositeResourceDefinition by creating a series of opinionated ClusterRoles that may be bound to allow access to the resources it defines.

Types

type ClusterRoleRenderFn

type ClusterRoleRenderFn func(d *v1.CompositeResourceDefinition) []rbacv1.ClusterRole

A ClusterRoleRenderFn renders ClusterRoles for the supplied XRD.

func (ClusterRoleRenderFn) RenderClusterRoles

RenderClusterRoles renders ClusterRoles for the supplied XRD.

type ClusterRoleRenderer

type ClusterRoleRenderer interface {
	// RenderClusterRoles for the supplied XRD.
	RenderClusterRoles(d *v1.CompositeResourceDefinition) []rbacv1.ClusterRole
}

A ClusterRoleRenderer renders ClusterRoles for a given XRD.

type Reconciler

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

A Reconciler reconciles CompositeResourceDefinitions.

func NewReconciler

func NewReconciler(mgr manager.Manager, opts ...ReconcilerOption) *Reconciler

NewReconciler returns a Reconciler of CompositeResourceDefinitions.

func (*Reconciler) Reconcile

func (r *Reconciler) Reconcile(ctx context.Context, req reconcile.Request) (reconcile.Result, error)

Reconcile a CompositeResourceDefinition by creating a series of opinionated ClusterRoles that may be bound to allow access to the resources it defines.

type ReconcilerOption

type ReconcilerOption func(*Reconciler)

ReconcilerOption is used to configure the Reconciler.

func WithClientApplicator

func WithClientApplicator(ca resource.ClientApplicator) ReconcilerOption

WithClientApplicator specifies how the Reconciler should interact with the Kubernetes API.

func WithClusterRoleRenderer

func WithClusterRoleRenderer(rr ClusterRoleRenderer) ReconcilerOption

WithClusterRoleRenderer specifies how the Reconciler should render RBAC ClusterRoles.

func WithLogger

func WithLogger(log logging.Logger) ReconcilerOption

WithLogger specifies how the Reconciler should log messages.

func WithRecorder

func WithRecorder(er event.Recorder) ReconcilerOption

WithRecorder specifies how the Reconciler should record Kubernetes events.

Jump to

Keyboard shortcuts

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