File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -336,6 +336,12 @@ func (o *ListOptions) ApplyToList(lo *ListOptions) {
336336 if o .Raw != nil {
337337 lo .Raw = o .Raw
338338 }
339+ if o .Limit > 0 {
340+ lo .Limit = o .Limit
341+ }
342+ if o .Continue != "" {
343+ lo .Continue = o .Continue
344+ }
339345}
340346
341347// AsListOptions returns these options as a flattened metav1.ListOptions.
Original file line number Diff line number Diff line change @@ -54,6 +54,18 @@ var _ = Describe("ListOptions", func() {
5454 o .ApplyToList (newListOpts )
5555 Expect (newListOpts ).To (Equal (o ))
5656 })
57+ It ("Should set Limit" , func () {
58+ o := & client.ListOptions {Limit : int64 (1 )}
59+ newListOpts := & client.ListOptions {}
60+ o .ApplyToList (newListOpts )
61+ Expect (newListOpts ).To (Equal (o ))
62+ })
63+ It ("Should set Continue" , func () {
64+ o := & client.ListOptions {Continue : "foo" }
65+ newListOpts := & client.ListOptions {}
66+ o .ApplyToList (newListOpts )
67+ Expect (newListOpts ).To (Equal (o ))
68+ })
5769 It ("Should not set anything" , func () {
5870 o := & client.ListOptions {}
5971 newListOpts := & client.ListOptions {}
You can’t perform that action at this time.
0 commit comments