Skip to content

Commit be55cca

Browse files
authored
Merge pull request #4541 from mwdomino/fixdocs
📖 Update documentation for non-owned resources
2 parents e8c74db + e0355d3 commit be55cca

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
@@ -88,7 +88,7 @@ func (r *BackupBusyboxReconciler) SetupWithManager(mgr ctrl.Manager) error {
8888
For(&examplecomv1alpha1.BackupBusybox{}). // Watch the primary resource (BackupBusybox)
8989
Watches(
9090
&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 {
9292
return []reconcile.Request{
9393
{
9494
NamespacedName: types.NamespacedName{

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
@@ -40,7 +40,7 @@ func (r *BackupBusyboxReconciler) SetupWithManager(mgr ctrl.Manager) error {
4040
For(&examplecomv1alpha1.BackupBusybox{}). // Watch the primary resource (BackupBusybox)
4141
Watches(
4242
&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 {
4444
// Trigger reconciliation for the BackupBusybox in the same namespace
4545
return []reconcile.Request{
4646
{
@@ -67,7 +67,7 @@ func (r *BackupBusyboxReconciler) SetupWithManager(mgr ctrl.Manager) error {
6767
For(&examplecomv1alpha1.BackupBusybox{}). // Watch the primary resource (BackupBusybox)
6868
Watches(
6969
&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 {
7171
// Check if the Busybox resource has the label 'backup-needed: "true"'
7272
if val, ok := obj.GetLabels()["backup-enable"]; ok && val == "true" {
7373
// If the label is present and set to "true", trigger reconciliation for BackupBusybox

0 commit comments

Comments
 (0)