Skip to content

Commit

Permalink
Merge pull request #2282 from vincepri/in-namespace-as-selector
Browse files Browse the repository at this point in the history
馃尡 Add client.InNamespace("xyz").AsSelector()
  • Loading branch information
k8s-ci-robot committed Apr 18, 2023
2 parents f831695 + 58640d1 commit 3d915df
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/client/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,11 @@ func (n InNamespace) ApplyToDeleteAllOf(opts *DeleteAllOfOptions) {
n.ApplyToList(&opts.ListOptions)
}

// AsSelector returns a selector that matches objects in the given namespace.
func (n InNamespace) AsSelector() fields.Selector {
return fields.SelectorFromSet(fields.Set{"metadata.namespace": string(n)})
}

// Limit specifies the maximum number of results to return from the server.
// Limit does not implement DeleteAllOfOption interface because the server
// does not support setting it for deletecollection operations.
Expand Down

0 comments on commit 3d915df

Please sign in to comment.