Skip to content

Commit

Permalink
update the params and docs based on review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Porto Carrero <[email protected]>
  • Loading branch information
casualjim committed Aug 21, 2023
1 parent a567547 commit 85eda87
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
11 changes: 11 additions & 0 deletions kube-core/src/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,17 @@ impl WatchParams {

self
}

/// Constructor for doing Kubernetes 1.27 Streaming List watches
///
/// Enables [`VersionMatch::NotGreaterThan`] semantics and [`WatchParams::send_initial_events`].
pub fn streaming_lists() -> Self {

Check warning on line 472 in kube-core/src/params.rs

View check run for this annotation

Codecov / codecov/patch

kube-core/src/params.rs#L472

Added line #L472 was not covered by tests
Self {
send_initial_events: true,
bookmarks: true, // required
..WatchParams::default()
}
}
}

/// Common query parameters for put/post calls
Expand Down
6 changes: 2 additions & 4 deletions kube-runtime/src/watcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,15 +237,13 @@ pub struct Config {
pub list_semantic: ListSemantic,

/// Kubernetes 1.27 Streaming Lists
/// Determines how the watcher fetches the initial list of objects.
/// Defaults to `ListWatch` for backwards compatibility.
/// Control how the watcher fetches the initial list of objects.
///
/// ListWatch: The watcher will fetch the initial list of objects using a list call.
/// StreamingList: The watcher will fetch the initial list of objects using a watch call.
///
/// StreamingList is more efficient than ListWatch, but it requires the server to support
/// streaming list bookmarks. If the server does not support streaming list bookmarks,
/// the watcher will fall back to ListWatch.
/// streaming list bookmarks (opt-in feature gate in Kubernetes 1.27).
///
/// See https://kubernetes.io/docs/reference/using-api/api-concepts/#streaming-lists
/// See https://github.com/kubernetes/enhancements/tree/master/keps/sig-api-machinery/3157-watch-list#design-details
Expand Down

0 comments on commit 85eda87

Please sign in to comment.