swiftkube / client

Swift client for Kubernetes
Apache License 2.0
129 stars 20 forks source link

Missing support for `continue` token on list operations #9

Closed t089 closed 3 years ago

t089 commented 3 years ago

When doing a list operation the API server may return an opaque continue token in metadata.continue. I couldn't find it, but is there API to the use this token to fetch next batch of results for the list?

iabudiab commented 3 years ago

@t089 Yes, it is missing 😞. I guess you've set a .limit(n) and got a token back and now you can't use it in subsequent requests.

I've just pushed a change adding this to the ListOptions. You can use it as follows now:

let client = ...
client.configMaps.list(in: .default, options: [.limit(10), .continue("token from previous call"])

You can get it on main now. A release should follow this week.

t089 commented 3 years ago

Great! Thank you.