Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions internal/provider/cisco/nxos/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ func (p *Provider) EnsureBGP(ctx context.Context, req *provider.EnsureBGPRequest
if err != nil && !errors.Is(err, gnmiext.ErrNil) {
return err
}
if err == nil && dom.RtrID != req.BGP.Spec.RouterID {
if err == nil && dom.RtrID != "" && dom.RtrID != req.BGP.Spec.RouterID {
return fmt.Errorf("BGP domain %q on device already uses router ID %s, cannot configure with router ID %s", dom.Name, dom.RtrID, req.BGP.Spec.RouterID)
}

Expand All @@ -362,12 +362,13 @@ func (p *Provider) EnsureBGP(ctx context.Context, req *provider.EnsureBGPRequest
switch {
case asf == "" && strings.Contains(b.Asn, "."):
asf = AsFormatAsDot
err = p.Update(ctx, &asf)
if err := p.Update(ctx, &asf); err != nil {
return err
}
case asf != "" && !strings.Contains(b.Asn, "."):
err = p.client.Delete(ctx, &asf)
}
if err != nil {
return err
if err := p.client.Delete(ctx, &asf); err != nil {
return err
}
}

var cfg nxv1alpha1.BGPConfig
Expand Down
Loading