Skip to content

Commit 58640d1

Browse files
committed
Add client.InNamespace("xyz").AsSelector()
Mostly sugar, but useful in some cases. Signed-off-by: Vince Prignano <[email protected]>
1 parent f831695 commit 58640d1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/client/options.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,11 @@ func (n InNamespace) ApplyToDeleteAllOf(opts *DeleteAllOfOptions) {
606606
n.ApplyToList(&opts.ListOptions)
607607
}
608608

609+
// AsSelector returns a selector that matches objects in the given namespace.
610+
func (n InNamespace) AsSelector() fields.Selector {
611+
return fields.SelectorFromSet(fields.Set{"metadata.namespace": string(n)})
612+
}
613+
609614
// Limit specifies the maximum number of results to return from the server.
610615
// Limit does not implement DeleteAllOfOption interface because the server
611616
// does not support setting it for deletecollection operations.

0 commit comments

Comments
 (0)