Skip to content

[exporter/loadbalancingexporter] Migrate k8sResolver's ListWatch to ListWithContext/WatchWithContext #50424

Description

@codeboten

resolver_k8s.go's start() builds a cache.ListWatch using the deprecated ListFunc/WatchFunc fields (k8s.io/client-go/tools/cache.ListWatch), which use context.Background() internally instead of a real context. Both are deprecated in favor of ListWithContext/WatchWithContext.

k8sResolver.start(_ context.Context) currently discards its context argument, and the struct has no stored context field - shutdown is signaled via stopCh instead. Migrating properly means deciding how to plumb a cancelable context into these funcs (e.g., store the start context, or derive one tied to stopCh), rather than a purely mechanical rename.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions