Pass typed options to dynamic client

This commit is contained in:
Jordan Liggitt
2017-02-19 15:10:05 -05:00
parent 3a73d23e33
commit 308fdcd13f
6 changed files with 16 additions and 16 deletions

View File

@@ -460,7 +460,7 @@ func gcListWatcher(client *dynamic.Client, resource schema.GroupVersionResource)
apiResource := metav1.APIResource{Name: resource.Resource}
return client.ParameterCodec(dynamic.VersionedParameterEncoderWithV1Fallback).
Resource(&apiResource, metav1.NamespaceAll).
List(&options)
List(options)
},
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
// APIResource.Kind is not used by the dynamic client, so
@@ -470,7 +470,7 @@ func gcListWatcher(client *dynamic.Client, resource schema.GroupVersionResource)
apiResource := metav1.APIResource{Name: resource.Resource}
return client.ParameterCodec(dynamic.VersionedParameterEncoderWithV1Fallback).
Resource(&apiResource, metav1.NamespaceAll).
Watch(&options)
Watch(options)
},
}
}

View File

@@ -341,7 +341,7 @@ func (d *namespacedResourcesDeleter) deleteCollection(
// resource deletions generically. it will ensure all resources in the namespace are purged prior to releasing
// namespace itself.
orphanDependents := false
err := dynamicClient.Resource(&apiResource, namespace).DeleteCollection(&metav1.DeleteOptions{OrphanDependents: &orphanDependents}, &metav1.ListOptions{})
err := dynamicClient.Resource(&apiResource, namespace).DeleteCollection(&metav1.DeleteOptions{OrphanDependents: &orphanDependents}, metav1.ListOptions{})
if err == nil {
return true, nil
@@ -379,7 +379,7 @@ func (d *namespacedResourcesDeleter) listCollection(
}
apiResource := metav1.APIResource{Name: gvr.Resource, Namespaced: true}
obj, err := dynamicClient.Resource(&apiResource, namespace).List(&metav1.ListOptions{})
obj, err := dynamicClient.Resource(&apiResource, namespace).List(metav1.ListOptions{})
if err == nil {
unstructuredList, ok := obj.(*unstructured.UnstructuredList)
if !ok {