Skip to content

Commit

Permalink
[ISSUE-1076] Linter fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Andrzej Zukowski <[email protected]>
  • Loading branch information
Andrzej-Zukowski committed Feb 7, 2024
1 parent c986251 commit ce9f354
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ linters-settings:
- k8s.io/apimachinery/pkg/apis/meta/v1
- k8s.io/apimachinery/pkg/runtime
- k8s.io/apimachinery/pkg/types
- k8s.io/apimachinery/pkg/util/wait
- k8s.io/client-go/kubernetes
- k8s.io/client-go/plugin/pkg/client/auth/gcp
- k8s.io/client-go/rest
Expand Down
1 change: 1 addition & 0 deletions pkg/base/error/k8s.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ func IsSafeReturnError(err error) bool {
k8sError.IsTooManyRequests(err)
}

// AlwaysSafeReturnError returns true for all errors
func AlwaysSafeReturnError(err error) bool {
return true
}
14 changes: 7 additions & 7 deletions pkg/node/volumemgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import (
"github.com/dell/csi-baremetal/api/v1/volumecrd"
"github.com/dell/csi-baremetal/pkg/base"
"github.com/dell/csi-baremetal/pkg/base/command"
checkErr "github.com/dell/csi-baremetal/pkg/base/error"
"github.com/dell/csi-baremetal/pkg/base/k8s"
"github.com/dell/csi-baremetal/pkg/base/linuxutils/datadiscover"
"github.com/dell/csi-baremetal/pkg/base/linuxutils/datadiscover/types"
Expand All @@ -63,7 +64,6 @@ import (
"github.com/dell/csi-baremetal/pkg/node/provisioners/utilwrappers"
wbtconf "github.com/dell/csi-baremetal/pkg/node/wbt/common"
wbtops "github.com/dell/csi-baremetal/pkg/node/wbt/operations"
checkErr "github.com/dell/csi-baremetal/pkg/base/error"
)

const (
Expand Down Expand Up @@ -669,12 +669,12 @@ func (m *VolumeManager) updateDrivesCRs(ctx context.Context, drivesFromMgr []*ap
Jitter: 0,
}
if err := retry.OnError(updateRetry, checkErr.AlwaysSafeReturnError, func() error {
if err1 := m.k8sClient.UpdateCR(ctx, &toUpdate) ; err1 != nil {
ll.Infof("Failed to update drive CR (health/status) retrying, error %v", err1)
return err1
}
return nil
}); err != nil {
if err1 := m.k8sClient.UpdateCR(ctx, &toUpdate); err1 != nil {
ll.Infof("Failed to update drive CR (health/status) retrying, error %v", err1)
return err1
}
return nil
}); err != nil {
ll.Errorf("Failed to update drive CR (health/status) %v, error %v", toUpdate, err)
updates.AddNotChanged(previousState)
} else {
Expand Down

0 comments on commit ce9f354

Please sign in to comment.