Skip to content

Commit

Permalink
✨ DeleteAllOfOptions Implements DeleteAllOfOption
Browse files Browse the repository at this point in the history
  • Loading branch information
alvaroaleman committed Sep 9, 2019
1 parent 1e8c57f commit b7dfffa
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/client/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -575,4 +575,12 @@ func (o *DeleteAllOfOptions) ApplyOptions(opts []DeleteAllOfOption) *DeleteAllOf
return o
}

var _ DeleteAllOfOption = &DeleteAllOfOptions{}

// ApplyToDeleteAllOf implements DeleteAllOfOption
func (o *DeleteAllOfOptions) ApplyToDeleteAllOf(do *DeleteAllOfOptions) {
o.ApplyToList(&do.ListOptions)
o.ApplyToDelete(&do.DeleteOptions)
}

// }}}
15 changes: 15 additions & 0 deletions pkg/client/options_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,3 +188,18 @@ var _ = Describe("PatchOptions", func() {
Expect(newPatchOpts).To(Equal(o))
})
})

var _ = Describe("DeleteAllOfOptions", func() {
It("Should set ListOptions", func() {
o := &client.DeleteAllOfOptions{ListOptions: client.ListOptions{Raw: &metav1.ListOptions{}}}
newDeleteAllOfOpts := &client.DeleteAllOfOptions{}
o.ApplyToDeleteAllOf(newDeleteAllOfOpts)
Expect(newDeleteAllOfOpts).To(Equal(o))
})
It("Should set DeleleteOptions", func() {
o := &client.DeleteAllOfOptions{DeleteOptions: client.DeleteOptions{GracePeriodSeconds: utilpointer.Int64Ptr(44)}}
newDeleteAllOfOpts := &client.DeleteAllOfOptions{}
o.ApplyToDeleteAllOf(newDeleteAllOfOpts)
Expect(newDeleteAllOfOpts).To(Equal(o))
})
})

0 comments on commit b7dfffa

Please sign in to comment.