Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(bugsbash) shellcheck : The shebang must be on the first line. Delete blanks and move comments. #306

Merged
merged 4 commits into from
May 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions ci/sanity/sanity.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
# Copyright © 2020 The OpenEBS Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -12,8 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

#!/usr/bin/env bash

function IsPoolHealthy() {
MAX_RETRY=$1
for i in $(seq 1 $MAX_RETRY) ; do
Expand Down
1 change: 1 addition & 0 deletions pkg/controllers/cspc-controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package cspccontroller

import (
"fmt"

cstor "github.com/openebs/api/v2/pkg/apis/cstor/v1"
types "github.com/openebs/api/v2/pkg/apis/types"
clientset "github.com/openebs/api/v2/pkg/client/clientset/versioned"
Expand Down
12 changes: 4 additions & 8 deletions pkg/controllers/cspc-controller/scale.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,8 @@ func (pc *PoolConfig) CreateCSPI(cspc *cstor.CStorPoolCluster) error {
return err
}
err = pc.CreateCSPIDeployment(cspc, cspi)
if err != nil {
return err
}
return nil

return err
}

func (pc *PoolConfig) createDeployForCSPList(cspc *cstor.CStorPoolCluster, cspList []cstor.CStorPoolInstance) {
Expand All @@ -90,10 +88,8 @@ func (pc *PoolConfig) createDeployForCSPList(cspc *cstor.CStorPoolCluster, cspLi
func (pc *PoolConfig) CreateCSPIDeployment(cspc *cstor.CStorPoolCluster, cspi *cstor.CStorPoolInstance) error {
deploy := pc.AlgorithmConfig.GetPoolDeploySpec(cspi)
_, err := pc.Controller.kubeclientset.AppsV1().Deployments(cspi.Namespace).Create(context.TODO(), deploy, metav1.CreateOptions{})
if err != nil {
return err
}
return nil

return err
}

// DownScalePool deletes the required pool.
Expand Down
5 changes: 1 addition & 4 deletions pkg/controllers/cspc-controller/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -497,11 +497,8 @@ func (pc *PoolConfig) syncCSPIWithCSPC(cspc *cstor.CStorPoolCluster, cspi *cstor
return err
}
err = pc.patchPoolDeploymentSpec(gotCSPI)
if err != nil {
return err
}

return nil
return err
}

/*
Expand Down
6 changes: 2 additions & 4 deletions pkg/controllers/cspi-controller/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -429,10 +429,8 @@ func (f *fixture) updateCSPIToPerformDay2Operation(cspiName string, tConfig test
}
}
_, err = f.openebsClient.CstorV1().CStorPoolInstances(ns).Update(context.TODO(), cspiObj, metav1.UpdateOptions{})
if err != nil {
return err
}
return nil

return err
}

func (f *fixture) run(cspiName string) {
Expand Down
11 changes: 3 additions & 8 deletions pkg/controllers/cstorvolumeconfig/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,8 @@ func (c *CVCController) syncCVC(cvc *apis.CStorVolumeConfig) error {

// sync policy changes from cvc.spec.policy e.g. tunables like toleration, resource requirements etc
err = c.syncPolicySpec(cvc)
if err != nil {
return err
}

return nil
return err
}

// UpdateCVCObj updates the cstorvolumeconfig object resource to reflect the
Expand Down Expand Up @@ -507,10 +504,8 @@ func (c *CVCController) distributePendingCVRs(
return err
}
err = c.distributeCVRs(pendingReplicaCount, cvc, service, cv, policy)
if err != nil {
return err
}
return nil

return err
}

// isClaimDeletionCandidate checks if a cstorvolumeconfig is a deletion candidate.
Expand Down
6 changes: 2 additions & 4 deletions pkg/pool/operations/disk_operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,8 @@ func (oc *OperationsConfig) addRaidGroup(r cstor.RaidGroup, dType, pType string)
WithVdevList(vdevlist).
WithExecutor(oc.zcmdExecutor).
Execute()
if err != nil {
return err
}
return nil

return err
}

// TODO: Get better naming convention from reviews
Expand Down
5 changes: 1 addition & 4 deletions pkg/server/cstorvolumeconfig/https_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,7 @@ func (f *fixture) createFakePoolPod(cspi *cstorapis.CStorPoolInstance) error {
},
}
_, err := f.k8sClient.CoreV1().Pods(namespace).Create(context.TODO(), pod, metav1.CreateOptions{})
if err != nil {
return err
}
return nil
return err
}

// createFakeVolumeReplicas will create fake CVRs on cstorPools
Expand Down
5 changes: 1 addition & 4 deletions pkg/server/cstorvolumeconfig/restore_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,7 @@ func (rOps *restoreAPIOps) createVolumeForRestore(restoreObj *cstorapis.CStorRes
// In case of CStor CSI volumes, if CVC.Status.Phase is marked as Bound then
// all the resources are created.
err := waitForCVCBoundState(restoreObj.Spec.VolumeName, rOps.namespace, rOps.clientset)
if err != nil {
return err
}
return nil
return err
}

// getRestoreStatus returns the status of CStorRestore
Expand Down
5 changes: 1 addition & 4 deletions pkg/webhook/cspc_operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -449,10 +449,7 @@ func (pOps *PoolOperations) createBDC(newBD, oldBD string) error {
return err
}
err = pOps.ClaimBD(bdObj, oldBD)
if err != nil {
return err
}
return nil
return err
}

func getBDOwnerReference(cspc *cstor.CStorPoolCluster) []metav1.OwnerReference {
Expand Down
5 changes: 1 addition & 4 deletions pkg/webhook/cvc.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,7 @@ func validateCVCSpecChanges(cvcOldObj, cvcNewObj *cstor.CStorVolumeConfig) error

// Below validations should be done only with new CVC object
err := validatePoolNames(cvcNewObj)
if err != nil {
return err
}
return nil
return err
}

// TODO: isScalingInProgress(cvcObj *cstor.CStorVolumeConfig) signature need to be
Expand Down
6 changes: 2 additions & 4 deletions pkg/zcmd/zfs/listsnap/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,8 @@ func (v *VolumeListSnapshot) Execute() (SnapshotList, error) {
}

err = json.Unmarshal(ret, &snapshotList)
if err != nil {
return snapshotList, err
}
return snapshotList, nil

return snapshotList, err
}

// Build returns the VolumeListSnapshot object generated by builder
Expand Down