Skip to content

Commit 81ad29e

Browse files
authored
Merge pull request #1154 from marinoborges/apiVersion
Set APIVersion:v1 for node events
2 parents 030cf0f + 6d71278 commit 81ad29e

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

pkg/exporters/k8sexporter/problemclient/problem_client.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ func getEventRecorder(c typedcorev1.CoreV1Interface, namespace, nodeName, source
157157
func getNodeRef(namespace, nodeName string) *v1.ObjectReference {
158158
// TODO(random-liu): Get node to initialize the node reference
159159
return &v1.ObjectReference{
160+
APIVersion: "v1",
160161
Kind: "Node",
161162
Name: nodeName,
162163
UID: types.UID(nodeName),

pkg/exporters/k8sexporter/problemclient/problem_client_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,11 @@ func TestEvent(t *testing.T) {
8585
t.Errorf("expected event %q, got %q", expected, got)
8686
}
8787
}
88+
89+
func TestNodeRefHasAPIVersionV1(t *testing.T) {
90+
client := newFakeProblemClient()
91+
92+
if client.nodeRef.APIVersion != "v1" {
93+
t.Errorf("expected nodeRef.APIVersion to be 'v1', got %q", client.nodeRef.APIVersion)
94+
}
95+
}

0 commit comments

Comments
 (0)