-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Panic at gosnappi.(*deviceBgpRouter).RouterId
if BGP is not present in the configuration
#213
Comments
gosnappi.(*deviceBgpRouter).RouterId
gosnappi.(*deviceBgpRouter).RouterId
when location of the PE is not specified
gosnappi.(*deviceBgpRouter).RouterId
when location of the PE is not specifiedgosnappi.(*deviceBgpRouter).RouterId
gosnappi.(*deviceBgpRouter).RouterId
gosnappi.(*deviceBgpRouter).RouterId
if BGP is not present in the configuration
Hi @bortok That's why accessing router id without setting it results in an error as accessing nil pointer, User get to know this cause SDK throws an error if it is not set. I guess a better way of checking would be this for _, d := range config.Devices().Items() {
if d.HasBgp() {}
} we were also thinking to introduce has method for every field for _, d := range config.Devices().Items() {
if d.Bgp().HasRouterId() != nil {} // as router id is now a string pointer and not a string
} |
Thanks, confirming the fix works |
After upgrading to
gosnappi:0.13.0
the following code ofotgen
(run.go) causes panic:encountered with the following OTG configuration otg.panic.yml.txt – it doesn't have BGP configuration, and the code above is trying to detect if BGP is configured
See the CI test run for details https://github.com/open-traffic-generator/otgen/actions/runs/6601539315/job/17933084738
The text was updated successfully, but these errors were encountered: