client-go metadata: update callers
This commit is contained in:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user