Closed
Description
Current and expected behavior
in 0.92 if you initialize a watcher with an Api object created with Api::all
the watcher only reflects objects withing the current namespace into the store. Example:
let subscriber = pod_writer
.subscribe()
.expect("subscribers can only be created from shared stores");
// (2.5): create a watch stream
let config = Config::default().concurrency(0);
let new_client = Client::try_default().await.unwrap();
let pods: Api<Pod> = Api::all(new_client);
let pod_watch = watcher(pods, watcher::Config::default())
.default_backoff()
.reflect_shared(pod_writer)
.modify(|pod| {
pod.managed_fields_mut().clear();
pod.spec.as_mut().unwrap().containers = vec![]; // We don't need any of this info, reduce memory footprint
});
This snippit in 0.92 once the reflector returns as ready only contains pods from the current namespace when calling reader.state()
, reverting to 0.91 fixes the issue and returns pods across all namespaces.
Possible solution
No response
Additional context
No response
Environment
Client Version: v1.28.4
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.24.12
Configuration and features
No response
Affected crates
No response
Would you like to work on fixing this bug?
None