Skip to content

Commit 6ae0a2f

Browse files
andrey-kothaJeztah
authored andcommitted
fix crash when there are attachments with null network
Signed-off-by: Andrey Kolomentsev <[email protected]> (cherry picked from commit 5be0152) Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent cd87d5c commit 6ae0a2f

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

manager/allocator/network.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,6 +1037,9 @@ func (a *Allocator) allocateNode(ctx context.Context, node *api.Node, existingAd
10371037
// https://github.com/golang/go/wiki/SliceTricks#filtering-without-allocating
10381038
attachments := node.Attachments[:0]
10391039
for _, attach := range node.Attachments {
1040+
if attach.Network == nil {
1041+
continue
1042+
}
10401043
// for every attachment, go through every network. if the attachment
10411044
// belongs to one of the networks, then go to the next attachment. if
10421045
// no network matches, then the the attachment should be removed.

0 commit comments

Comments
 (0)