Skip to content

Commit

Permalink
PMM-7 fix more errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Tymchuk committed Sep 26, 2023
1 parent c00bf12 commit 73bf963
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion managed/services/backup/backup_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ func checkArtifactMode(artifact *models.Artifact, pitrTimestamp time.Time) error
return nil
}

// inTimeSpan checks whether given time is in the given range
// inTimeSpan checks whether given time is in the given range.
func inTimeSpan(start, end, check time.Time) bool {
if start.Before(end) {
return !check.Before(start) && !check.After(end)
Expand Down
2 changes: 1 addition & 1 deletion managed/services/backup/compatibility_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ func (s *CompatibilityService) CheckArtifactCompatibility(artifactID, targetDBVe
return s.artifactCompatibility(artifactModel, serviceModel, targetDBVersion)
}

// artifactCompatibility contains logic for CheckArtifactCompatibility
// artifactCompatibility contains logic for CheckArtifactCompatibility.
func (s *CompatibilityService) artifactCompatibility(artifactModel *models.Artifact, serviceModel *models.Service, targetDBVersion string) error {
var err error
if artifactModel.DBVersion != "" && artifactModel.DBVersion != targetDBVersion {
Expand Down
12 changes: 6 additions & 6 deletions managed/services/backup/pitr_timerange_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const (

var errUnsupportedLocation = errors.New("unsupported location config")

// PBMPITRService helps to perform PITR chunks lookup in a backup storage
// PBMPITRService helps to perform PITR chunks lookup in a backup storage.
type PBMPITRService struct {
l *logrus.Entry
}
Expand All @@ -49,7 +49,7 @@ func NewPBMPITRService() *PBMPITRService {
}
}

// oplogChunk is index metadata for the oplog chunks
// oplogChunk is index metadata for the oplog chunks.
type oplogChunk struct {
RS string `bson:"rs"`
FName string `bson:"fname"`
Expand All @@ -59,7 +59,7 @@ type oplogChunk struct {
size int64 `bson:"-"`
}

// Timeline is an internal representation of a PITR Timeline
// Timeline is an internal representation of a PITR Timeline.
type Timeline struct {
ReplicaSet string `json:"replica_set"`
Start uint32 `json:"start"`
Expand All @@ -79,7 +79,7 @@ func (x gaps) Less(i, j int) bool {
}
func (x gaps) Swap(i, j int) { x[i], x[j] = x[j], x[i] }

// compressionType is the type of compression used for PITR oplog
// compressionType is the type of compression used for PITR oplog.
type compressionType string

const (
Expand All @@ -91,7 +91,7 @@ const (
compressionTypeZstandard compressionType = "zstd"
)

// file return compression alg based on given file extension
// file return compression alg based on given file extension.
func file(ext string) compressionType {
switch ext {
case "gz":
Expand Down Expand Up @@ -269,7 +269,7 @@ func getTimelines(slices []*oplogChunk) []Timeline {
}

// mergeTimelines merges overlapping sets on timelines
// it presumes timelines are sorted and don't start from 0
// it presumes timelines are sorted and don't start from 0.
func mergeTimelines(timelines ...[]Timeline) []Timeline {
// fast paths
if len(timelines) == 0 {
Expand Down
2 changes: 1 addition & 1 deletion managed/services/management/ia/rules_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ func (s *RulesService) CreateAlertRule(ctx context.Context, req *iav1beta1.Creat
return nil, err
}

if req.TemplateName != "" {
if req.TemplateName != "" { //nolint:nestif
template, ok := s.templates.GetTemplates()[req.TemplateName]
if !ok {
return nil, status.Errorf(codes.NotFound, "Unknown template %s.", req.TemplateName)
Expand Down

0 comments on commit 73bf963

Please sign in to comment.