diff --git a/agent/agent.go b/agent/agent.go index 60df8a602c..d092a8ec7c 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -4,10 +4,10 @@ import ( "bytes" "context" "math/rand" - "reflect" "sync" "time" + "github.com/gogo/protobuf/proto" "github.com/moby/swarmkit/v2/agent/exec" "github.com/moby/swarmkit/v2/api" "github.com/moby/swarmkit/v2/log" @@ -249,7 +249,7 @@ func (a *Agent) run(ctx context.Context) { // if the node description has changed, update it to the new one // and close the session. The old session will be stopped and a // new one will be created with the updated description - if !reflect.DeepEqual(nodeDescription, newNodeDescription) { + if !proto.Equal(nodeDescription, newNodeDescription) { nodeDescription = newNodeDescription // close the session log.G(ctx).Info("agent: found node update") @@ -652,5 +652,5 @@ func nodesEqual(a, b *api.Node) bool { a.Status, b.Status = api.NodeStatus{}, api.NodeStatus{} a.Meta, b.Meta = api.Meta{}, api.Meta{} - return reflect.DeepEqual(a, b) + return proto.Equal(a, b) }