mirror of
https://github.com/kubernetes/client-go.git
synced 2025-08-31 06:34:50 +00:00
Remove use of (Label|Field)SelectorParam
Kubernetes-commit: b6d9815b95940002545b4aa7affb892d94637a49
This commit is contained in:
committed by
Kubernetes Publisher
parent
0e9b63a3bb
commit
3954f889c7
4
tools/cache/listwatch.go
vendored
4
tools/cache/listwatch.go
vendored
@@ -58,21 +58,21 @@ type Getter interface {
|
||||
// NewListWatchFromClient creates a new ListWatch from the specified client, resource, namespace and field selector.
|
||||
func NewListWatchFromClient(c Getter, resource string, namespace string, fieldSelector fields.Selector) *ListWatch {
|
||||
listFunc := func(options metav1.ListOptions) (runtime.Object, error) {
|
||||
options.FieldSelector = fieldSelector.String()
|
||||
return c.Get().
|
||||
Namespace(namespace).
|
||||
Resource(resource).
|
||||
VersionedParams(&options, metav1.ParameterCodec).
|
||||
FieldsSelectorParam(fieldSelector).
|
||||
Do().
|
||||
Get()
|
||||
}
|
||||
watchFunc := func(options metav1.ListOptions) (watch.Interface, error) {
|
||||
options.Watch = true
|
||||
options.FieldSelector = fieldSelector.String()
|
||||
return c.Get().
|
||||
Namespace(namespace).
|
||||
Resource(resource).
|
||||
VersionedParams(&options, metav1.ParameterCodec).
|
||||
FieldsSelectorParam(fieldSelector).
|
||||
Watch()
|
||||
}
|
||||
return &ListWatch{ListFunc: listFunc, WatchFunc: watchFunc}
|
||||
|
Reference in New Issue
Block a user