Skip to content

v0.11 breaks Start() -> Reconcile() context propagation #1752

@nicks

Description

@nicks

In controller-runtime v0.10, manager.Start(ctx) would propagate that context to all reconcilers. e.g., if you attached a trace context or logger to the context, all reconcilers would be receive that in their context.

https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.11.0/pkg/manager#Manager
https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.11.0/pkg/reconcile#Reconciler

In controller-runtime v0.11, the controller manager creates its own "empty" background context

r.ctx, r.cancel = context.WithCancel(context.Background())

And this is the context passed to the Reconcile(ctx, req) method

Was this an intentional change? are there ways we can add context values in a way that will appear in all reconcilers?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions