From d67c1f0fecd23753614d483be6c938436d6835f7 Mon Sep 17 00:00:00 2001 From: atulpatel261194 Date: Mon, 2 Sep 2024 04:55:14 -0700 Subject: [PATCH] fix: removed logrus from vendor plugin Signed-off-by: atulpatel261194 --- go.mod | 2 +- .../intel-e2000/p4runtime/p4driverapi/p4ctl.go | 17 ++++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index d489347..3a8cf8e 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,6 @@ require ( github.com/philippgille/gokv/gomap v0.6.0 github.com/philippgille/gokv/redis v0.6.0 github.com/roman-kachanovsky/go-binary-pack v0.0.0-20170214094030-e260e0dc6732 - github.com/sirupsen/logrus v1.9.3 github.com/spf13/cobra v1.7.0 github.com/spf13/viper v1.16.0 github.com/vektra/mockery/v2 v2.38.0 @@ -180,6 +179,7 @@ require ( github.com/sashamelentyev/usestdlibvars v1.24.0 // indirect github.com/securego/gosec/v2 v2.18.2 // indirect github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c // indirect + github.com/sirupsen/logrus v1.9.3 // indirect github.com/sivchari/containedctx v1.0.3 // indirect github.com/sivchari/nosnakecase v1.7.0 // indirect github.com/sivchari/tenv v1.7.1 // indirect diff --git a/pkg/evpn/vendor_plugins/intel-e2000/p4runtime/p4driverapi/p4ctl.go b/pkg/evpn/vendor_plugins/intel-e2000/p4runtime/p4driverapi/p4ctl.go index ec0f9c0..983b42d 100644 --- a/pkg/evpn/vendor_plugins/intel-e2000/p4runtime/p4driverapi/p4ctl.go +++ b/pkg/evpn/vendor_plugins/intel-e2000/p4runtime/p4driverapi/p4ctl.go @@ -19,7 +19,6 @@ import ( "log" "time" - logr "github.com/sirupsen/logrus" "google.golang.org/grpc" p4_v1 "github.com/p4lang/p4runtime/go/p4/v1" @@ -256,10 +255,10 @@ func NewP4RuntimeClient(binPath string, p4infoPath string, conn *grpc.ClientConn c := p4_v1.NewP4RuntimeClient(conn) resp, err := c.Capabilities(Ctx, &p4_v1.CapabilitiesRequest{}) if err != nil { - logr.Fatalf("intel-e2000: Error in Capabilities RPC: %v", err) + log.Println("intel-e2000: Error in Capabilities RPC: %v", err) return err } - logr.Infof("intel-e2000: P4Runtime server version is %s", resp.P4RuntimeApiVersion) + log.Println("intel-e2000: P4Runtime server version is %s", resp.P4RuntimeApiVersion) electionID := &p4_v1.Uint128{High: 0, Low: 1} @@ -277,13 +276,13 @@ func NewP4RuntimeClient(binPath string, p4infoPath string, conn *grpc.ClientConn sent := false for isPrimary := range arbitrationCh { if isPrimary { - logr.Infof("We are the primary client!") + log.Println("We are the primary client!") if !sent { waitCh <- struct{}{} sent = true } } else { - logr.Infof("We are not the primary client!") + log.Println("We are not the primary client!") } } }() @@ -294,15 +293,15 @@ func NewP4RuntimeClient(binPath string, p4infoPath string, conn *grpc.ClientConn defer cancel() select { case <-Ctx2.Done(): - logr.Fatalf("Could not become the primary client within %v", timeout) + log.Fatal("Could not become the primary client within %v", timeout) case <-errs: - logr.Fatalf("Could not get the client within %v", timeout) + log.Fatal("Could not get the client within %v", timeout) case <-waitCh: } }() - logr.Info("Setting forwarding pipe") + log.Println("Setting forwarding pipe") if _, err := P4RtC.SetFwdPipe(Ctx, binPath, p4infoPath, 0); err != nil { - logr.Fatalf("Error when setting forwarding pipe: %v", err) + log.Fatal("Error when setting forwarding pipe: %v", err) return err } return nil