Skip to content

Commit

Permalink
fixes linting error
Browse files Browse the repository at this point in the history
  • Loading branch information
hrishin committed Oct 7, 2019
1 parent 42b0f38 commit 12a9afe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions pkg/reconciler/pipelinerun/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func NewRecorder() (*Recorder, error) {

func (r *Recorder) DurationAndCount(pr *v1alpha1.PipelineRun) error {
if !r.initialized {
return errors.New(fmt.Sprintf("ignoring the metrics recording for %s , failed to initialize the metrics recorder", pr.Name))
return fmt.Errorf("ignoring the metrics recording for %s , failed to initialize the metrics recorder", pr.Name)
}

duration := time.Since(pr.Status.StartTime.Time)
Expand Down Expand Up @@ -138,13 +138,13 @@ func (r *Recorder) RunningPrsCount(lister listers.PipelineRunLister) error {

prs, err := lister.List(labels.Everything())
if err != nil {
return errors.New(fmt.Sprintf("failed to list pipelineruns while generating metrics : %v", err))
return fmt.Errorf("failed to list pipelineruns while generating metrics : %v", err)
}

var runningPrs int
for _, pr := range prs {
if !pr.IsDone() {
runningPrs ++
runningPrs++
}
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/reconciler/taskrun/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func NewRecorder() (*Recorder, error) {
if err != nil {
return nil, err
}
r.pod= pod
r.pod = pod

err = view.Register(
&view.View{
Expand Down Expand Up @@ -145,7 +145,7 @@ func NewRecorder() (*Recorder, error) {

func (r *Recorder) DurationAndCount(tr *v1alpha1.TaskRun) error {
if !r.initialized {
return errors.New(fmt.Sprintf("ignoring the metrics recording for %s , failed to initialize the metrics recorder", tr.Name))
return fmt.Errorf("ignoring the metrics recording for %s , failed to initialize the metrics recorder", tr.Name)
}

duration := time.Since(tr.Status.StartTime.Time)
Expand Down

0 comments on commit 12a9afe

Please sign in to comment.