Skip to content

Commit

Permalink
PMM-11261 fix linters.
Browse files Browse the repository at this point in the history
  • Loading branch information
BupycHuk committed Mar 13, 2024
1 parent 036dffb commit ed7bcfe
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 20 deletions.
19 changes: 0 additions & 19 deletions managed/services/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,25 +235,6 @@ func (s *Server) LeaderHealthCheck(ctx context.Context, req *serverpb.LeaderHeal
return nil, status.Error(codes.FailedPrecondition, "this PMM Server isn't the leader")
}

func (s *Server) onlyInstalledVersionResponse(ctx context.Context) *serverpb.CheckUpdatesResponse {
v := s.supervisord.InstalledPMMVersion(ctx)
r := &serverpb.CheckUpdatesResponse{
Installed: &serverpb.VersionInfo{
Version: v.Version,
FullVersion: v.FullVersion,
},
}

if v.BuildTime != nil {
t := v.BuildTime.UTC().Truncate(24 * time.Hour) // return only date
r.Installed.Timestamp = timestamppb.New(t)
}

r.LastCheck = timestamppb.New(time.Now())

return r
}

// CheckUpdates checks PMM Server updates availability.
func (s *Server) CheckUpdates(ctx context.Context, req *serverpb.CheckUpdatesRequest) (*serverpb.CheckUpdatesResponse, error) {
s.envRW.RLock()
Expand Down
2 changes: 1 addition & 1 deletion managed/services/server/updater.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ func (s *Updater) latest(ctx context.Context) (*version.PackageInfo, error) {
return nil, errors.Wrap(err, "failed to decode response")
}

if len(tagsResponse.Results) > 0 {
if len(tagsResponse.Results) != 0 {
// Assuming the first tag is the latest
return s.parseDockerTag(tagsResponse.Results[0].Name), nil
}
Expand Down

0 comments on commit ed7bcfe

Please sign in to comment.