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.