ci: fix all linter errors found in golangci-lint

Fixing all the linter errors found in golang-ci
lint v1.46.2

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
Madhu Rajanna
2022-06-01 15:47:19 +05:30
committed by mergify[bot]
parent 9e5cad173d
commit 1952a9b4b3
56 changed files with 348 additions and 195 deletions

View File

@ -77,7 +77,8 @@ func CheckVolExists(ctx context.Context,
pvID *VolumeIdentifier,
sID *SnapshotIdentifier,
cr *util.Credentials) (*VolumeIdentifier, error) {
cr *util.Credentials,
) (*VolumeIdentifier, error) {
var vid VolumeIdentifier
// Connect to cephfs' default radosNamespace (csi)
j, err := VolJournal.Connect(volOptions.Monitors, fsutil.RadosNamespace, cr)
@ -205,7 +206,8 @@ func UndoVolReservation(
ctx context.Context,
volOptions *VolumeOptions,
vid VolumeIdentifier,
secret map[string]string) error {
secret map[string]string,
) error {
cr, err := util.NewAdminCredentials(secret)
if err != nil {
return err
@ -294,7 +296,8 @@ func ReserveSnap(
volOptions *VolumeOptions,
parentSubVolName string,
snap *SnapshotOption,
cr *util.Credentials) (*SnapshotIdentifier, error) {
cr *util.Credentials,
) (*SnapshotIdentifier, error) {
var (
vid SnapshotIdentifier
imageUUID string
@ -335,7 +338,8 @@ func UndoSnapReservation(
volOptions *VolumeOptions,
vid SnapshotIdentifier,
snapName string,
cr *util.Credentials) error {
cr *util.Credentials,
) error {
// Connect to cephfs' default radosNamespace (csi)
j, err := SnapJournal.Connect(volOptions.Monitors, fsutil.RadosNamespace, cr)
if err != nil {
@ -367,7 +371,8 @@ func CheckSnapExists(
ctx context.Context,
volOptions *VolumeOptions,
snap *SnapshotOption,
cr *util.Credentials) (*SnapshotIdentifier, *core.SnapshotInfo, error) {
cr *util.Credentials,
) (*SnapshotIdentifier, *core.SnapshotInfo, error) {
// Connect to cephfs' default radosNamespace (csi)
j, err := SnapJournal.Connect(volOptions.Monitors, fsutil.RadosNamespace, cr)
if err != nil {

View File

@ -187,7 +187,8 @@ func (vo *VolumeOptions) GetConnection() *util.ClusterConnection {
// NewVolumeOptions generates a new instance of volumeOptions from the provided
// CSI request parameters.
func NewVolumeOptions(ctx context.Context, requestName string, req *csi.CreateVolumeRequest,
cr *util.Credentials) (*VolumeOptions, error) {
cr *util.Credentials,
) (*VolumeOptions, error) {
var (
opts VolumeOptions
err error
@ -268,7 +269,8 @@ func NewVolumeOptions(ctx context.Context, requestName string, req *csi.CreateVo
func NewVolumeOptionsFromVolID(
ctx context.Context,
volID string,
volOpt, secrets map[string]string) (*VolumeOptions, *VolumeIdentifier, error) {
volOpt, secrets map[string]string,
) (*VolumeOptions, *VolumeIdentifier, error) {
var (
vi util.CSIIdentifier
volOptions VolumeOptions
@ -383,7 +385,8 @@ func NewVolumeOptionsFromVolID(
// VolumeIdentifier from the provided CSI volume context.
func NewVolumeOptionsFromMonitorList(
volID string,
options, secrets map[string]string) (*VolumeOptions, *VolumeIdentifier, error) {
options, secrets map[string]string,
) (*VolumeOptions, *VolumeIdentifier, error) {
var (
opts VolumeOptions
vid VolumeIdentifier
@ -446,7 +449,8 @@ func NewVolumeOptionsFromMonitorList(
// detected to be a statically provisioned volume.
func NewVolumeOptionsFromStaticVolume(
volID string,
options map[string]string) (*VolumeOptions, *VolumeIdentifier, error) {
options map[string]string,
) (*VolumeOptions, *VolumeIdentifier, error) {
var (
opts VolumeOptions
vid VolumeIdentifier
@ -515,7 +519,8 @@ func NewVolumeOptionsFromStaticVolume(
func NewSnapshotOptionsFromID(
ctx context.Context,
snapID string,
cr *util.Credentials) (*VolumeOptions, *core.SnapshotInfo, *SnapshotIdentifier, error) {
cr *util.Credentials,
) (*VolumeOptions, *core.SnapshotInfo, *SnapshotIdentifier, error) {
var (
vi util.CSIIdentifier
volOptions VolumeOptions