Skip to content

Commit 470bb2a

Browse files
Preserve gNMI errors when ensuring BGP peers
Signed-off-by: Felix Kästner <felix.kaestner@sap.com>
1 parent a825f95 commit 470bb2a

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎internal/provider/cisco/nxos/provider.go‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,10 @@ func (p *Provider) EnsureBGPPeer(ctx context.Context, req *provider.EnsureBGPPee
811811
bgp.Name = req.VRF.Spec.Name
812812
}
813813
if err := p.client.GetConfig(ctx, bgp); err != nil {
814-
return apistatus.NewFailedPreconditionError(fmt.Sprintf("bgp peer: BGP instance %q must be configured on the device before peers can be realized: %v", bgp.Name, err))
814+
if !errors.Is(err, gnmiext.ErrNil) {
815+
return err
816+
}
817+
return apistatus.NewFailedPreconditionError(fmt.Sprintf("bgp peer: BGP instance %q must be configured on the device before peers can be realized", bgp.Name))
815818
}
816819

817820
adminSt := AdminStEnabled

0 commit comments

Comments
 (0)