From 28bdb3e929b40494cb429e51a4b36672ce2b89b1 Mon Sep 17 00:00:00 2001 From: Tom Pantelis Date: Thu, 18 Aug 2022 09:33:19 -0400 Subject: [PATCH] Fix useless err assignment Check the returned err. This was detected by a code scanning tool. Signed-off-by: Tom Pantelis --- pkg/cloud/azure/azure.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/cloud/azure/azure.go b/pkg/cloud/azure/azure.go index 08d03b4c3..7ad5466ce 100644 --- a/pkg/cloud/azure/azure.go +++ b/pkg/cloud/azure/azure.go @@ -4,10 +4,11 @@ import ( "context" "encoding/json" "fmt" - submreporter "github.com/submariner-io/admiral/pkg/reporter" "os" "strconv" + submreporter "github.com/submariner-io/admiral/pkg/reporter" + "github.com/Azure/go-autorest/autorest/azure/auth" "github.com/openshift/library-go/pkg/operator/events" "github.com/pkg/errors" @@ -71,6 +72,9 @@ func NewAzureProvider( } subscriptionID, err := initializeFromAuthFile(hubKubeClient, clusterName, credentialsSecretName) + if err != nil { + return nil, errors.Wrap(err, "unable to initialize from auth file") + } authorizer, err := auth.NewAuthorizerFromEnvironment()