Skip to content

Commit ea41c65

Browse files
authored
doc: fix examples how to specify watched CR in Watches()
1 parent 2381ce3 commit ea41c65

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

docs/book/src/reference/watching-resources/predicates-with-watch.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ func (r *BackupBusyboxReconciler) SetupWithManager(mgr ctrl.Manager) error {
8787
return ctrl.NewControllerManagedBy(mgr).
8888
For(&examplecomv1alpha1.BackupBusybox{}). // Watch the primary resource (BackupBusybox)
8989
Watches(
90-
&source.Kind{Type: &examplecomv1alpha1.Busybox{}}, // Watch the Busybox CR
90+
&examplecomv1alpha1.Busybox{}, // Watch the Busybox CR
9191
handler.EnqueueRequestsFromMapFunc(func(ctx context.Context, obj client.Object) []reconcile.Request {
9292
return []reconcile.Request{
9393
{

docs/book/src/reference/watching-resources/secondary-resources-not-owned.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func (r *BackupBusyboxReconciler) SetupWithManager(mgr ctrl.Manager) error {
3939
return ctrl.NewControllerManagedBy(mgr).
4040
For(&examplecomv1alpha1.BackupBusybox{}). // Watch the primary resource (BackupBusybox)
4141
Watches(
42-
&source.Kind{Type: &examplecomv1alpha1.Busybox{}}, // Watch the Busybox CR
42+
&examplecomv1alpha1.Busybox{}, // Watch the Busybox CR
4343
handler.EnqueueRequestsFromMapFunc(func(ctx context.Context, obj client.Object) []reconcile.Request {
4444
// Trigger reconciliation for the BackupBusybox in the same namespace
4545
return []reconcile.Request{
@@ -66,7 +66,7 @@ func (r *BackupBusyboxReconciler) SetupWithManager(mgr ctrl.Manager) error {
6666
return ctrl.NewControllerManagedBy(mgr).
6767
For(&examplecomv1alpha1.BackupBusybox{}). // Watch the primary resource (BackupBusybox)
6868
Watches(
69-
&source.Kind{Type: &examplecomv1alpha1.Busybox{}}, // Watch the Busybox CR
69+
&examplecomv1alpha1.Busybox{}, // Watch the Busybox CR
7070
handler.EnqueueRequestsFromMapFunc(func(ctx context.Context, obj client.Object) []reconcile.Request {
7171
// Check if the Busybox resource has the label 'backup-needed: "true"'
7272
if val, ok := obj.GetLabels()["backup-enable"]; ok && val == "true" {

0 commit comments

Comments
 (0)