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) {
336
336
if o .Raw != nil {
337
337
lo .Raw = o .Raw
338
338
}
339
+ if o .Limit > 0 {
340
+ lo .Limit = o .Limit
341
+ }
342
+ if o .Continue != "" {
343
+ lo .Continue = o .Continue
344
+ }
339
345
}
340
346
341
347
// 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() {
54
54
o .ApplyToList (newListOpts )
55
55
Expect (newListOpts ).To (Equal (o ))
56
56
})
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
+ })
57
69
It ("Should not set anything" , func () {
58
70
o := & client.ListOptions {}
59
71
newListOpts := & client.ListOptions {}
You can’t perform that action at this time.
0 commit comments