File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
docs/book/src/reference/watching-resources Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ func (r *BackupBusyboxReconciler) SetupWithManager(mgr ctrl.Manager) error {
87
87
return ctrl.NewControllerManagedBy (mgr).
88
88
For (&examplecomv1alpha1.BackupBusybox {}). // Watch the primary resource (BackupBusybox)
89
89
Watches (
90
- &source. Kind {Type: & examplecomv1alpha1.Busybox {} }, // Watch the Busybox CR
90
+ &examplecomv1alpha1.Busybox {}, // Watch the Busybox CR
91
91
handler.EnqueueRequestsFromMapFunc (func (ctx context.Context , obj client.Object ) []reconcile.Request {
92
92
return []reconcile.Request {
93
93
{
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ func (r *BackupBusyboxReconciler) SetupWithManager(mgr ctrl.Manager) error {
39
39
return ctrl.NewControllerManagedBy (mgr).
40
40
For (&examplecomv1alpha1.BackupBusybox {}). // Watch the primary resource (BackupBusybox)
41
41
Watches (
42
- &source. Kind {Type: & examplecomv1alpha1.Busybox {} }, // Watch the Busybox CR
42
+ &examplecomv1alpha1.Busybox {}, // Watch the Busybox CR
43
43
handler.EnqueueRequestsFromMapFunc (func (ctx context.Context , obj client.Object ) []reconcile.Request {
44
44
// Trigger reconciliation for the BackupBusybox in the same namespace
45
45
return []reconcile.Request {
@@ -66,7 +66,7 @@ func (r *BackupBusyboxReconciler) SetupWithManager(mgr ctrl.Manager) error {
66
66
return ctrl.NewControllerManagedBy (mgr).
67
67
For (&examplecomv1alpha1.BackupBusybox {}). // Watch the primary resource (BackupBusybox)
68
68
Watches (
69
- &source. Kind {Type: & examplecomv1alpha1.Busybox {} }, // Watch the Busybox CR
69
+ &examplecomv1alpha1.Busybox {}, // Watch the Busybox CR
70
70
handler.EnqueueRequestsFromMapFunc (func (ctx context.Context , obj client.Object ) []reconcile.Request {
71
71
// Check if the Busybox resource has the label 'backup-needed: "true"'
72
72
if val , ok := obj.GetLabels ()[" backup-enable" ]; ok && val == " true" {
You can’t perform that action at this time.
0 commit comments