client-go metadata: update callers

This commit is contained in:
Jordan Liggitt
2020-03-06 10:47:20 -05:00
parent cb4ee9334b
commit 04a72d5ef9
5 changed files with 27 additions and 24 deletions

View File

@@ -17,6 +17,7 @@ limitations under the License.
package garbagecollector
import (
"context"
"encoding/json"
"fmt"
@@ -67,7 +68,7 @@ func (gc *GarbageCollector) getMetadata(apiVersion, kind, namespace, name string
m, ok := gc.dependencyGraphBuilder.monitors[apiResource]
if !ok || m == nil {
// If local cache doesn't exist for mapping.Resource, send a GET request to API server
return gc.metadataClient.Resource(apiResource).Namespace(namespace).Get(name, metav1.GetOptions{})
return gc.metadataClient.Resource(apiResource).Namespace(namespace).Get(context.TODO(), name, metav1.GetOptions{})
}
key := name
if len(namespace) != 0 {
@@ -79,7 +80,7 @@ func (gc *GarbageCollector) getMetadata(apiVersion, kind, namespace, name string
}
if !exist {
// If local cache doesn't contain the object, send a GET request to API server
return gc.metadataClient.Resource(apiResource).Namespace(namespace).Get(name, metav1.GetOptions{})
return gc.metadataClient.Resource(apiResource).Namespace(namespace).Get(context.TODO(), name, metav1.GetOptions{})
}
obj, ok := raw.(runtime.Object)
if !ok {