Change:
Is this a BUG REPORT or FEATURE REQUEST?: What happened: Now the and has been consistent in by PR . There is no need to convert v1.ObjectReference to clientv1.ObjectReference in . What you expected to happen: Remove this function and cleanup the codes which call this function. How to reproduce it (as minimally and precisely as possible): Anything else we need to know?:
There are no sig labels on this issue. Please by:<br(1) mentioning a sig: <bre.g., for API Machinery<br(2) specifying the label manually: <bre.g., for sig/scalability<br<brNote: method (1) will trigger a notification to the team. You can find the team list and label list
Will submit the cleanup after PR merged.
/sig api-machinery
/sub

Discussion:
"//pkg/api:go_default_library", "//pkg/api/v1/ref:go_default_library", "//pkg/kubelet/apis/cri/v1alpha1/runtime:go_default_library", <del> "//pkg/kubelet/events:go_default_library", </del> "//pkg/kubelet/util/format:go_default_library", "//pkg/kubelet/util/ioutils:go_default_library", "//pkg/util/hash:go_default_library",

"github.com/golang/glog" "k8s.io/api/core/v1" <del> clientv1 "k8s.io/api/core/v1" </del> metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/tools/record" runtimeapi "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime" <del> "k8s.io/kubernetes/pkg/kubelet/events" </del> "k8s.io/kubernetes/pkg/kubelet/util/format" "k8s.io/kubernetes/pkg/kubelet/util/ioutils" hashutil "k8s.io/kubernetes/pkg/util/hash"

recorder record.EventRecorder } <del> func (irecorder *innerEventRecorder) shouldRecordEvent(object runtime.Object) (*clientv1.ObjectReference, bool) { </del> <ins> func (irecorder *innerEventRecorder) shouldRecordEvent(object runtime.Object) (*v1.ObjectReference, bool) { </ins> if object == nil { return nil, false } <del> if ref, ok := object.(*clientv1.ObjectReference); ok { if !strings.HasPrefix(ref.FieldPath, ImplicitContainerPrefix) { return ref, true } } // just in case we miss a spot, be sure that we still log something </del> if ref, ok := object.(*v1.ObjectReference); ok { if !strings.HasPrefix(ref.FieldPath, ImplicitContainerPrefix) { <del> return events.ToObjectReference(ref), true </del> <ins> return ref, true </ins> } } return nil, false

name = "go_default_library", srcs = ["event.go"], tags = ["automanaged"], <del> deps = ["//vendor/k8s.io/api/core/v1:go_default_library"], </del> ) filegroup(

package events <del> import ( "k8s.io/api/core/v1" clientv1 "k8s.io/api/core/v1" ) </del> const ( // Container event reason list CreatedContainer        = "Created"

FailedPreStopHook     = "FailedPreStopHook" UnfinishedPreStopHook = "UnfinishedPreStopHook" ) <del> // ToObjectReference takes an old style object reference and converts it to a client-go one func ToObjectReference(ref *v1.ObjectReference) *clientv1.ObjectReference { if ref == nil { return nil } return &clientv1.ObjectReference{ Kind:            ref.Kind, Namespace:       ref.Namespace, Name:            ref.Name, UID:             ref.UID, APIVersion:      ref.APIVersion, ResourceVersion: ref.ResourceVersion, FieldPath:       ref.FieldPath, } } </del>

// records an event using ref, event msg.  log to glog using prefix, msg, logFn func (m *imageManager) logIt(ref *v1.ObjectReference, eventtype, event, prefix, msg string, logFn func(args ...interface{})) { if ref != nil { <del> m.recorder.Event(events.ToObjectReference(ref), eventtype, event, msg) </del> <ins> m.recorder.Event(ref, eventtype, event, msg) </ins> } else { logFn(fmt.Sprint(prefix, " ", msg)) }