This is an automated email from the ASF dual-hosted git repository.

ccondit pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/yunikorn-core.git


The following commit(s) were added to refs/heads/master by this push:
     new a62c1659 [YUNIKORN-1930] Add message to node added/removed event (#626)
a62c1659 is described below

commit a62c165982a4f8fa0e4c080b6e295b77086488a1
Author: Peter Bacsko <[email protected]>
AuthorDate: Wed Aug 23 10:08:19 2023 -0500

    [YUNIKORN-1930] Add message to node added/removed event (#626)
    
    Messages that are sent to the shim should have a Message field set properly.
    This will be visible when the events for a given object (pod/node) are 
listed.
    
    Closes: #626
    
    Signed-off-by: Craig Condit <[email protected]>
---
 pkg/scheduler/objects/node_events.go      | 4 ++--
 pkg/scheduler/objects/node_events_test.go | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/pkg/scheduler/objects/node_events.go 
b/pkg/scheduler/objects/node_events.go
index 76316f9f..7e942609 100644
--- a/pkg/scheduler/objects/node_events.go
+++ b/pkg/scheduler/objects/node_events.go
@@ -34,7 +34,7 @@ func (n *nodeEvents) sendNodeAddedEvent() {
        if !n.eventSystem.IsEventTrackingEnabled() {
                return
        }
-       event := events.CreateNodeEventRecord(n.node.NodeID, common.Empty, 
common.Empty, si.EventRecord_ADD,
+       event := events.CreateNodeEventRecord(n.node.NodeID, "Node added to the 
scheduler", common.Empty, si.EventRecord_ADD,
                si.EventRecord_DETAILS_NONE, n.node.GetCapacity())
        n.eventSystem.AddEvent(event)
 }
@@ -43,7 +43,7 @@ func (n *nodeEvents) sendNodeRemovedEvent() {
        if !n.eventSystem.IsEventTrackingEnabled() {
                return
        }
-       event := events.CreateNodeEventRecord(n.node.NodeID, common.Empty, 
common.Empty, si.EventRecord_REMOVE,
+       event := events.CreateNodeEventRecord(n.node.NodeID, "Node removed from 
the scheduler", common.Empty, si.EventRecord_REMOVE,
                si.EventRecord_NODE_DECOMISSION, nil)
        n.eventSystem.AddEvent(event)
 }
diff --git a/pkg/scheduler/objects/node_events_test.go 
b/pkg/scheduler/objects/node_events_test.go
index b426c20a..07d54779 100644
--- a/pkg/scheduler/objects/node_events_test.go
+++ b/pkg/scheduler/objects/node_events_test.go
@@ -44,7 +44,7 @@ func TestSendNodeAddedEvent(t *testing.T) {
        event := mock.events[0]
        assert.Equal(t, nodeID1, event.ObjectID)
        assert.Equal(t, common.Empty, event.ReferenceID)
-       assert.Equal(t, common.Empty, event.Message)
+       assert.Equal(t, "Node added to the scheduler", event.Message)
        assert.Equal(t, si.EventRecord_ADD, event.EventChangeType)
        assert.Equal(t, si.EventRecord_DETAILS_NONE, event.EventChangeDetail)
        assert.Equal(t, 0, len(event.Resource.Resources))
@@ -66,7 +66,7 @@ func TestSendNodeRemovedEvent(t *testing.T) {
        event := mock.events[0]
        assert.Equal(t, nodeID1, event.ObjectID)
        assert.Equal(t, common.Empty, event.ReferenceID)
-       assert.Equal(t, common.Empty, event.Message)
+       assert.Equal(t, "Node removed from the scheduler", event.Message)
        assert.Equal(t, si.EventRecord_REMOVE, event.EventChangeType)
        assert.Equal(t, si.EventRecord_NODE_DECOMISSION, 
event.EventChangeDetail)
        assert.Equal(t, 0, len(event.Resource.Resources))


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to