Merge pull request #1154 from marinoborges/apiVersion

Set APIVersion:v1 for node events
This commit is contained in:
Kubernetes Prow Robot
2025-10-14 09:43:35 -07:00
committed by GitHub
2 changed files with 9 additions and 0 deletions
@@ -157,6 +157,7 @@ func getEventRecorder(c typedcorev1.CoreV1Interface, namespace, nodeName, source
func getNodeRef(namespace, nodeName string) *v1.ObjectReference {
// TODO(random-liu): Get node to initialize the node reference
return &v1.ObjectReference{
APIVersion: "v1",
Kind: "Node",
Name: nodeName,
UID: types.UID(nodeName),
@@ -85,3 +85,11 @@ func TestEvent(t *testing.T) {
t.Errorf("expected event %q, got %q", expected, got)
}
}
func TestNodeRefHasAPIVersionV1(t *testing.T) {
client := newFakeProblemClient()
if client.nodeRef.APIVersion != "v1" {
t.Errorf("expected nodeRef.APIVersion to be 'v1', got %q", client.nodeRef.APIVersion)
}
}