From 351f4fc6b9debe8986e7df9d939d36f36e6ee380 Mon Sep 17 00:00:00 2001 From: sonasingh46 Date: Wed, 19 Dec 2018 12:17:43 +0530 Subject: [PATCH] incorporate review comments Signed-off-by: sonasingh46 --- cmd/maya-apiserver/spc-watcher/handler.go | 2 +- cmd/maya-apiserver/spc-watcher/select_disk.go | 2 +- cmd/maya-apiserver/spc-watcher/storagepool_create.go | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/maya-apiserver/spc-watcher/handler.go b/cmd/maya-apiserver/spc-watcher/handler.go index 536fcb57ad..e17c5bab7f 100644 --- a/cmd/maya-apiserver/spc-watcher/handler.go +++ b/cmd/maya-apiserver/spc-watcher/handler.go @@ -19,11 +19,11 @@ package spc import ( "github.com/golang/glog" apis "github.com/openebs/maya/pkg/apis/openebs.io/v1alpha1" + "github.com/pkg/errors" k8serror "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/client-go/tools/cache" - "github.com/pkg/errors" ) // syncHandler compares the actual state with the desired, and attempts to diff --git a/cmd/maya-apiserver/spc-watcher/select_disk.go b/cmd/maya-apiserver/spc-watcher/select_disk.go index cab17b63d8..2c79e89561 100644 --- a/cmd/maya-apiserver/spc-watcher/select_disk.go +++ b/cmd/maya-apiserver/spc-watcher/select_disk.go @@ -19,9 +19,9 @@ package spc import ( mach_apis_meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" //openebs "github.com/openebs/maya/pkg/client/clientset/versioned" - "github.com/pkg/errors" "github.com/openebs/maya/pkg/apis/openebs.io/v1alpha1" openebs "github.com/openebs/maya/pkg/client/generated/clientset/internalclientset" + "github.com/pkg/errors" "k8s.io/apimachinery/pkg/util/runtime" ) diff --git a/cmd/maya-apiserver/spc-watcher/storagepool_create.go b/cmd/maya-apiserver/spc-watcher/storagepool_create.go index 1c619dff74..29594adea3 100644 --- a/cmd/maya-apiserver/spc-watcher/storagepool_create.go +++ b/cmd/maya-apiserver/spc-watcher/storagepool_create.go @@ -22,8 +22,8 @@ import ( apis "github.com/openebs/maya/pkg/apis/openebs.io/v1alpha1" "github.com/openebs/maya/pkg/client/k8s" "github.com/openebs/maya/pkg/storagepool" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/pkg/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // Cas template is a custom resource which has a list of runTasks. @@ -74,7 +74,7 @@ func poolCreateWorker(pool *apis.CasPool) error { storagepoolOps, err := storagepool.NewCasPoolOperation(pool) if err != nil { - return errors.Wrapf(err, "NewCasPoolOperation failed error '%s'") + return errors.Wrapf(err, "NewCasPoolOperation failed error") } _, err = storagepoolOps.Create() if err != nil { @@ -119,7 +119,7 @@ func (newClientSet *clientSet) casPoolBuilder(casPool *apis.CasPool, spc *apis.S for _, v := range nodeDisks.disks.diskList { gotDisk, err := newClientSet.oecs.OpenebsV1alpha1().Disks().Get(v, metav1.GetOptions{}) if err != nil { - return nil, errors.Wrapf(err,"Failed to get device id for disk:failed to list the disks") + return nil, errors.Wrapf(err, "Failed to get device id for disk:failed to list the disks") } if len(gotDisk.Spec.DevLinks) != 0 && len(gotDisk.Spec.DevLinks[0].Links) != 0 { // Fill device Id of the disk to the CasPool object. @@ -136,4 +136,4 @@ func (newClientSet *clientSet) casPoolBuilder(casPool *apis.CasPool, spc *apis.S // Fill the disks attached to this node to the CasPool object. casPool.DiskList = nodeDisks.disks.diskList return casPool, nil -} +} \ No newline at end of file