Skip to content

Commit

Permalink
PMM-12375 do not update if version is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Tymchuk committed Sep 19, 2023
1 parent 8f61035 commit ac80cad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion managed/services/agents/channel/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ func (c *Channel) send(msg *agentpb.ServerMessage) {
atomic.AddUint32(&c.mSent, 1)
}

// runReader receives messages from server.
// runReceiver receives messages from server.
func (c *Channel) runReceiver() {
defer func() {
close(c.requests)
Expand Down
6 changes: 5 additions & 1 deletion managed/services/agents/service_info_broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,12 @@ func updateServiceVersion(ctx context.Context, q *reform.Querier, resp agentpb.A
l := logger.Get(ctx)

version := resp.(*agentpb.ServiceInfoResponse).GetVersion() //nolint:forcetypeassert
service.Version = version
if version == "" {
return nil
}

l.Debugf("Updating service version: %s.", version)
service.Version = version
if err := q.Update(service); err != nil {
return errors.Wrap(err, "failed to update service version")
}
Expand Down

0 comments on commit ac80cad

Please sign in to comment.