diff --git a/README.md b/README.md index bb9e544..134a75c 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,35 @@ func FunctionReconciler(c reconcilers.Config) *reconcilers.ParentReconciler { ``` [full source](https://github.com/projectriff/system/blob/4c3b75327bf99cc37b57ba14df4c65d21dc79d28/pkg/controllers/build/function_reconciler.go#L39-L51) +**Recommended RBAC:** + +Replace `` and `` with values for the parent type. + +```go +// +kubebuilder:rbac:groups=,resources=,verbs=get;list;watch;create;update;patch;delete +// +kubebuilder:rbac:groups=,resources=/status,verbs=get;update;patch +// +kubebuilder:rbac:groups=core,resources=events,verbs=get;list;watch;create;update;patch;delete +``` + +or + +```yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: # any name that is bound to the ServiceAccount used by the client +rules: +- apiGroups: [""] + resources: [""] + verbs: ["get", "list", "watch", "create", "update", "patch", "delete"] +- apiGroups: [""] + resources: ["/status"] + verbs: ["get", "update", "patch"] +- apiGroups: ["core"] + resources: ["events"] + verbs: ["get", "list", "watch", "create", "update", "patch", "delete"] +``` + ### SubReconciler The [`SubReconciler`](https://pkg.go.dev/github.com/vmware-labs/reconciler-runtime/reconcilers#SubReconciler) interface defines the contract between the parent and sub reconcilers. @@ -196,6 +225,28 @@ func FunctionChildImageReconciler(c reconcilers.Config) reconcilers.SubReconcile ``` [full source](https://github.com/projectriff/system/blob/4c3b75327bf99cc37b57ba14df4c65d21dc79d28/pkg/controllers/build/function_reconciler.go#L76-L151) +**Recommended RBAC:** + +Replace `` and `` with values for the child type. + +```go +// +kubebuilder:rbac:groups=,resources=,verbs=get;list;watch;create;update;patch;delete +``` + +or + +```yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: # any name that is bound to the ServiceAccount used by the client +rules: +- apiGroups: [""] + resources: [""] + verbs: ["get", "list", "watch", "create", "update", "patch", "delete"] +``` + + ### Higher-order Reconcilers Higher order reconcilers are SubReconcilers that do not perform work directly, but instead compose other SubReconcilers in new patterns.