Skip to content

Commit

Permalink
Fix nilpointer if CALICO_NETWORKING_BACKEND=none
Browse files Browse the repository at this point in the history
There is a nil pointer in the configureASNumber function if the networking backend is none (i.e. policy-only mode)
  • Loading branch information
tobiasgiese committed Jun 28, 2023
1 parent 8234b36 commit 8723de1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions node/pkg/lifecycle/startup/startup.go
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,9 @@ func configureASNumber(node *libapi.Node) bool {
return true
}
} else {
if node.Spec.BGP == nil {
node.Spec.BGP = &libapi.NodeBGPSpec{}
}
if node.Spec.BGP.ASNumber == nil {
log.Info("No AS number configured on node resource, using global value")
} else {
Expand Down

0 comments on commit 8723de1

Please sign in to comment.