app

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package app provides a sample controller using the clusterrolebinding primitive.

Note: ClusterRoleBinding is cluster-scoped. When the owner is namespace-scoped, the component framework automatically skips setting a controller owner reference (since Kubernetes does not allow cross-scope owner references) and logs an info message. This means the ClusterRoleBinding will not be garbage-collected when the owner is deleted — operators should implement their own cleanup logic if needed. In production, using a cluster-scoped CRD as the owner avoids this limitation entirely.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExampleController

type ExampleController struct {
	client.Client
	Scheme   *runtime.Scheme
	Recorder record.EventRecorder
	Metrics  component.Recorder

	// NewClusterRoleBindingResource is a factory function to create the clusterrolebinding resource.
	NewClusterRoleBindingResource func(*sharedapp.ExampleApp) (component.Resource, error)
}

ExampleController reconciles an ExampleApp object using the component framework.

When the owner is namespace-scoped, the framework skips the controller owner reference for cluster-scoped resources. Use a cluster-scoped owner CRD in production if automatic garbage collection is required.

func (*ExampleController) Reconcile

func (r *ExampleController) Reconcile(ctx context.Context, owner *sharedapp.ExampleApp) error

Reconcile performs the reconciliation for a single ExampleApp.

Jump to

Keyboard shortcuts

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