From eea20c14c855234a44c875b14d027e692a3c72ea Mon Sep 17 00:00:00 2001 From: Boris Glimcher Date: Thu, 3 Aug 2023 20:15:39 +0300 Subject: [PATCH] fix(variable): rename old copy paste volume name Signed-off-by: Boris Glimcher --- pkg/evpn/bridge.go | 4 ++-- pkg/evpn/interface.go | 4 ++-- pkg/evpn/tunnel_vxlan.go | 4 ++-- pkg/evpn/vrf.go | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pkg/evpn/bridge.go b/pkg/evpn/bridge.go index fdd535ea..15d4c372 100644 --- a/pkg/evpn/bridge.go +++ b/pkg/evpn/bridge.go @@ -165,7 +165,7 @@ func (s *Server) UpdateLogicalBridge(_ context.Context, in *pb.UpdateLogicalBrid return nil, err } // fetch object from the database - volume, ok := s.Bridges[in.LogicalBridge.Name] + bridge, ok := s.Bridges[in.LogicalBridge.Name] if !ok { // TODO: introduce "in.AllowMissing" field. In case "true", create a new resource, don't return error err := status.Errorf(codes.NotFound, "unable to find key %s", in.LogicalBridge.Name) @@ -177,7 +177,7 @@ func (s *Server) UpdateLogicalBridge(_ context.Context, in *pb.UpdateLogicalBrid log.Printf("error: %v", err) return nil, err } - resourceID := path.Base(volume.Name) + resourceID := path.Base(bridge.Name) iface, err := netlink.LinkByName(resourceID) if err != nil { err := status.Errorf(codes.NotFound, "unable to find key %s", resourceID) diff --git a/pkg/evpn/interface.go b/pkg/evpn/interface.go index 24afd71c..63b95f15 100644 --- a/pkg/evpn/interface.go +++ b/pkg/evpn/interface.go @@ -195,7 +195,7 @@ func (s *Server) UpdateInterface(_ context.Context, in *pb.UpdateInterfaceReques return nil, err } // fetch object from the database - volume, ok := s.Interfaces[in.Interface.Name] + port, ok := s.Interfaces[in.Interface.Name] if !ok { // TODO: introduce "in.AllowMissing" field. In case "true", create a new resource, don't return error err := status.Errorf(codes.NotFound, "unable to find key %s", in.Interface.Name) @@ -207,7 +207,7 @@ func (s *Server) UpdateInterface(_ context.Context, in *pb.UpdateInterfaceReques log.Printf("error: %v", err) return nil, err } - resourceID := path.Base(volume.Name) + resourceID := path.Base(port.Name) iface, err := netlink.LinkByName(resourceID) if err != nil { err := status.Errorf(codes.NotFound, "unable to find key %s", resourceID) diff --git a/pkg/evpn/tunnel_vxlan.go b/pkg/evpn/tunnel_vxlan.go index f0fe3a46..11da1f97 100644 --- a/pkg/evpn/tunnel_vxlan.go +++ b/pkg/evpn/tunnel_vxlan.go @@ -166,7 +166,7 @@ func (s *Server) UpdateTunnel(_ context.Context, in *pb.UpdateTunnelRequest) (*p return nil, err } // fetch object from the database - volume, ok := s.Tunnels[in.Tunnel.Name] + svi, ok := s.Tunnels[in.Tunnel.Name] if !ok { // TODO: introduce "in.AllowMissing" field. In case "true", create a new resource, don't return error err := status.Errorf(codes.NotFound, "unable to find key %s", in.Tunnel.Name) @@ -178,7 +178,7 @@ func (s *Server) UpdateTunnel(_ context.Context, in *pb.UpdateTunnelRequest) (*p log.Printf("error: %v", err) return nil, err } - resourceID := path.Base(volume.Name) + resourceID := path.Base(svi.Name) iface, err := netlink.LinkByName(resourceID) if err != nil { err := status.Errorf(codes.NotFound, "unable to find key %s", resourceID) diff --git a/pkg/evpn/vrf.go b/pkg/evpn/vrf.go index 982fc718..02800ade 100644 --- a/pkg/evpn/vrf.go +++ b/pkg/evpn/vrf.go @@ -195,7 +195,7 @@ func (s *Server) UpdateVrf(_ context.Context, in *pb.UpdateVrfRequest) (*pb.Vrf, return nil, err } // fetch object from the database - volume, ok := s.Vrfs[in.Vrf.Name] + vrf, ok := s.Vrfs[in.Vrf.Name] if !ok { // TODO: introduce "in.AllowMissing" field. In case "true", create a new resource, don't return error err := status.Errorf(codes.NotFound, "unable to find key %s", in.Vrf.Name) @@ -207,7 +207,7 @@ func (s *Server) UpdateVrf(_ context.Context, in *pb.UpdateVrfRequest) (*pb.Vrf, log.Printf("error: %v", err) return nil, err } - resourceID := path.Base(volume.Name) + resourceID := path.Base(vrf.Name) iface, err := netlink.LinkByName(resourceID) if err != nil { err := status.Errorf(codes.NotFound, "unable to find key %s", resourceID)