rolebindings

package
v0.7.9 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

pkg/resources/rolebindings/rolebinding.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

Create creates a RoleBinding if it does not already exist. Idempotent — skips if the RoleBinding already exists. Owner reference ensures cleanup when the CR is deleted.

func Delete

Delete deletes the RoleBinding if it exists.

func DeleteIfOwned

func DeleteIfOwned(ctx context.Context, kube kubeclient.KubeClient,
	owner domain.Object, name, namespace string) error

DeleteIfOwned deletes the RoleBinding only if it is owned by the CR.

func Update

Update applies the desired subjects and roleRef to an existing RoleBinding. RoleRef is immutable in Kubernetes — if it changed the binding is deleted and recreated.

Types

type ResolvedRoleBindingSpec

type ResolvedRoleBindingSpec struct {
	Name      string
	Namespace string
	Labels    map[string]string
	RoleRef   rbacv1.RoleRef
	Subjects  []rbacv1.Subject

	// Sleep injects an artificial delay into the reconcile of this resource.
	// Useful for autoscale testing, latency simulation, and chaos engineering.
	// Accepts extended duration units (s, m, h, d, w, mo, y).
	Sleep string
}

ResolvedRoleBindingSpec is the fully resolved RoleBinding specification.

func Resolve

Resolve builds a ResolvedRoleBindingSpec from a RoleBindingTemplateSource. Template expressions must already be evaluated by template.Resolver before calling.

Jump to

Keyboard shortcuts

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