Skip to content

Commit

Permalink
fix(variable): rename old copy paste volume name
Browse files Browse the repository at this point in the history
Signed-off-by: Boris Glimcher <Boris.Glimcher@emc.com>
  • Loading branch information
glimchb committed Aug 3, 2023
1 parent da33abc commit eea20c1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions pkg/evpn/bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)

Check warning on line 180 in pkg/evpn/bridge.go

View check run for this annotation

Codecov / codecov/patch

pkg/evpn/bridge.go#L180

Added line #L180 was not covered by tests
iface, err := netlink.LinkByName(resourceID)
if err != nil {
err := status.Errorf(codes.NotFound, "unable to find key %s", resourceID)
Expand Down
4 changes: 2 additions & 2 deletions pkg/evpn/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)

Check warning on line 210 in pkg/evpn/interface.go

View check run for this annotation

Codecov / codecov/patch

pkg/evpn/interface.go#L210

Added line #L210 was not covered by tests
iface, err := netlink.LinkByName(resourceID)
if err != nil {
err := status.Errorf(codes.NotFound, "unable to find key %s", resourceID)
Expand Down
4 changes: 2 additions & 2 deletions pkg/evpn/tunnel_vxlan.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)

Check warning on line 181 in pkg/evpn/tunnel_vxlan.go

View check run for this annotation

Codecov / codecov/patch

pkg/evpn/tunnel_vxlan.go#L181

Added line #L181 was not covered by tests
iface, err := netlink.LinkByName(resourceID)
if err != nil {
err := status.Errorf(codes.NotFound, "unable to find key %s", resourceID)
Expand Down
4 changes: 2 additions & 2 deletions pkg/evpn/vrf.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)

Check warning on line 210 in pkg/evpn/vrf.go

View check run for this annotation

Codecov / codecov/patch

pkg/evpn/vrf.go#L210

Added line #L210 was not covered by tests
iface, err := netlink.LinkByName(resourceID)
if err != nil {
err := status.Errorf(codes.NotFound, "unable to find key %s", resourceID)
Expand Down

0 comments on commit eea20c1

Please sign in to comment.