Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pkg/exporters/k8sexporter/problemclient/problem_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
10 changes: 10 additions & 0 deletions pkg/exporters/k8sexporter/problemclient/problem_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,13 @@
t.Errorf("expected event %q, got %q", expected, got)
}
}

func TestNodeRefHasAPIVersionV1(t *testing.T) {
eventNamespace := "default"
nodeName := "fake-node"
client := newFakeProblemClient(eventNamespace, nodeName)

Check failure on line 92 in pkg/exporters/k8sexporter/problemclient/problem_client_test.go

View workflow job for this annotation

GitHub Actions / lint

too many arguments in call to newFakeProblemClient

if client.nodeRef.APIVersion != "v1" {
t.Errorf("expected nodeRef.APIVersion to be 'v1', got %q", client.nodeRef.APIVersion)
}
}
Loading