Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow customising certain list parameters #11

Closed
clux opened this issue May 10, 2019 · 2 comments
Closed

allow customising certain list parameters #11

clux opened this issue May 10, 2019 · 2 comments

Comments

@clux
Copy link
Member

clux commented May 10, 2019

Not sure how much we actually need to expose, but dropping down some notes:

An initializer controller should list and watch for uninitialized objects, by using the query parameter ?includeUninitialized=true. (Kubernetes Initializers Deep Dive)

maybe timeoutSeconds if wanting to poll more frequently than every 10s?

@clux
Copy link
Member Author

clux commented May 19, 2019

It also makes sense to have stuff like field_selector values passed in.

There's a bit of common ground in optional structs like:

and similarly

etc. Given that we already keep track of resource_version, discard pretty, encapsulate timeout_seconds, hide, limit it might just make sense to include a common options struct:

#[derive(Default)]
struct QueryOptions {
    field_selector: Option<String>,
    include_uninitialized: Option<String>,
    label_selector: Option<String>,
    timeout: Option<u32>
}

have the informers, reflectors take options as a third arg:

let inf : Informer<NodeSpec, NodeStatus> = Informer::new(client,  ResourceType::Nodes, QueryOptions::default())

@clux
Copy link
Member Author

clux commented May 19, 2019

Rather than having a third parameter. We've made a builder pattern for the option and flattened it into Informer and Reflector (for now).

@clux clux closed this as completed in ef47887 May 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant