diff --git a/cmd/karavictl/cmd/role.go b/cmd/karavictl/cmd/role.go index 28189917..e146747c 100644 --- a/cmd/karavictl/cmd/role.go +++ b/cmd/karavictl/cmd/role.go @@ -23,8 +23,6 @@ import ( "errors" "fmt" "io" - "karavi-authorization/internal/role-service/roles" - "karavi-authorization/pb" "log" "net" "net/url" @@ -32,6 +30,9 @@ import ( "strings" "time" + "karavi-authorization/internal/role-service/roles" + "karavi-authorization/pb" + pscale "github.com/dell/goisilon" pmax "github.com/dell/gopowermax/v2" "github.com/dell/goscaleio" @@ -192,7 +193,6 @@ func validatePowerFlexPool(storageSystemDetails System, storageSystemID string, Username: storageSystemDetails.User, Password: storageSystemDetails.Password, }) - if err != nil { return fmt.Errorf("powerflex authentication failed: %+v", err) } @@ -377,7 +377,6 @@ func createRoleServiceClient(addr string, insecure bool) (pb.RoleServiceClient, }) }), grpc.WithInsecure()) - if err != nil { log.Fatal(err) } @@ -392,7 +391,6 @@ func createRoleServiceClient(addr string, insecure bool) (pb.RoleServiceClient, conn, err = grpc.Dial(addr, grpc.WithTransportCredentials(creds), grpc.WithTimeout(10*time.Second)) - if err != nil { log.Fatal(err) } diff --git a/cmd/karavictl/cmd/storage.go b/cmd/karavictl/cmd/storage.go index abe678f0..64141c40 100644 --- a/cmd/karavictl/cmd/storage.go +++ b/cmd/karavictl/cmd/storage.go @@ -20,12 +20,13 @@ import ( "crypto/x509" "fmt" "io" - "karavi-authorization/pb" "log" "net" "os" "time" + "karavi-authorization/pb" + "github.com/spf13/cobra" "google.golang.org/grpc" "google.golang.org/grpc/credentials" @@ -81,7 +82,6 @@ func createStorageServiceClient(addr string, insecure bool) (pb.StorageServiceCl }) }), grpc.WithInsecure()) - if err != nil { log.Fatal(err) } @@ -96,7 +96,6 @@ func createStorageServiceClient(addr string, insecure bool) (pb.StorageServiceCl conn, err = grpc.Dial(addr, grpc.WithTransportCredentials(creds), grpc.WithTimeout(10*time.Second)) - if err != nil { log.Fatal(err) } diff --git a/internal/proxy/role_handler.go b/internal/proxy/role_handler.go index 86a88512..15ba7025 100644 --- a/internal/proxy/role_handler.go +++ b/internal/proxy/role_handler.go @@ -15,9 +15,10 @@ package proxy import ( "encoding/json" "fmt" + "net/http" + "karavi-authorization/internal/web" "karavi-authorization/pb" - "net/http" "github.com/sirupsen/logrus" "go.opentelemetry.io/otel/trace" @@ -153,7 +154,6 @@ func (th *RoleHandler) updateHandler(w http.ResponseWriter, r *http.Request) err Pool: body.Pool, Quota: body.Quota, }) - if err != nil { err = fmt.Errorf("updating role %s: %w", body, err) handleJSONErrorResponse(th.log, w, http.StatusInternalServerError, err) @@ -257,7 +257,6 @@ func (th *RoleHandler) deleteHandler(w http.ResponseWriter, r *http.Request) err Pool: body.Pool, Quota: body.Quota, }) - if err != nil { err = fmt.Errorf("deleting role %s: %w", body, err) handleJSONErrorResponse(th.log, w, http.StatusInternalServerError, err) diff --git a/internal/role-service/validate/powerflex.go b/internal/role-service/validate/powerflex.go index 322725da..691c98af 100644 --- a/internal/role-service/validate/powerflex.go +++ b/internal/role-service/validate/powerflex.go @@ -18,9 +18,10 @@ import ( "context" "errors" "fmt" - storage "karavi-authorization/cmd/karavictl/cmd" "net/url" + storage "karavi-authorization/cmd/karavictl/cmd" + "github.com/dell/goscaleio" "github.com/sirupsen/logrus" ) @@ -57,7 +58,6 @@ func PowerFlex(_ context.Context, log *logrus.Entry, system storage.System, syst Username: system.User, Password: system.Password, }) - if err != nil { return fmt.Errorf("powerflex authentication failed: %+v", err) } diff --git a/internal/storage-service/validate.go b/internal/storage-service/validate.go index 7c14cab8..3b3d2cec 100644 --- a/internal/storage-service/validate.go +++ b/internal/storage-service/validate.go @@ -17,9 +17,10 @@ package storage import ( "context" "fmt" - storage "karavi-authorization/cmd/karavictl/cmd" "net/url" + storage "karavi-authorization/cmd/karavictl/cmd" + pscale "github.com/dell/goisilon" pmax "github.com/dell/gopowermax/v2" "github.com/dell/goscaleio" @@ -91,7 +92,6 @@ func validatePowerflex(_ context.Context, _ *logrus.Entry, system storage.System Username: system.User, Password: system.Password, }) - if err != nil { return fmt.Errorf("powerflex authentication failed: %+v", err) }