File tree 2 files changed +3
-3
lines changed
docs/book/src/reference/watching-resources
2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ func (r *BackupBusyboxReconciler) SetupWithManager(mgr ctrl.Manager) error {
88
88
For (&examplecomv1alpha1.BackupBusybox {}). // Watch the primary resource (BackupBusybox)
89
89
Watches (
90
90
&source.Kind {Type: &examplecomv1alpha1.Busybox {}}, // Watch the Busybox CR
91
- handler.EnqueueRequestsFromMapFunc (func (obj client.Object ) []reconcile.Request {
91
+ handler.EnqueueRequestsFromMapFunc (func (ctx context. Context , obj client.Object ) []reconcile.Request {
92
92
return []reconcile.Request {
93
93
{
94
94
NamespacedName: types.NamespacedName {
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ func (r *BackupBusyboxReconciler) SetupWithManager(mgr ctrl.Manager) error {
40
40
For (&examplecomv1alpha1.BackupBusybox {}). // Watch the primary resource (BackupBusybox)
41
41
Watches (
42
42
&source.Kind {Type: &examplecomv1alpha1.Busybox {}}, // Watch the Busybox CR
43
- handler.EnqueueRequestsFromMapFunc (func (obj client.Object ) []reconcile.Request {
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 {
46
46
{
@@ -67,7 +67,7 @@ func (r *BackupBusyboxReconciler) SetupWithManager(mgr ctrl.Manager) error {
67
67
For (&examplecomv1alpha1.BackupBusybox {}). // Watch the primary resource (BackupBusybox)
68
68
Watches (
69
69
&source.Kind {Type: &examplecomv1alpha1.Busybox {}}, // Watch the Busybox CR
70
- handler.EnqueueRequestsFromMapFunc (func (obj client.Object ) []reconcile.Request {
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" {
73
73
// If the label is present and set to "true", trigger reconciliation for BackupBusybox
You can’t perform that action at this time.
0 commit comments