-
Notifications
You must be signed in to change notification settings - Fork 174
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
Free'ing address space on scope delete #6106
Conversation
} | ||
|
||
if p.Parent != nil { | ||
p.Parent.ReleaseIP4Range(p) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here has a check for if Parent is nil:
https://github.com/vmware/vic/blob/master/lib/portlayer/network/ipam.go#L334
Does that create problem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
never mind
|
||
var parentSpace *AddressSpace | ||
if len(s.spaces) == 1 { | ||
parentSpace = s.spaces[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just curious why don't get parent space here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in the case where len(s.spaces) == 1
, the only space in the slice is the parent. See this case here: https://github.com/vmware/vic/blob/master/lib/portlayer/network/context.go#L443
lib/portlayer/network/context.go
Outdated
@@ -1258,6 +1258,35 @@ func (c *Context) DeleteScope(ctx context.Context, name string) error { | |||
return fmt.Errorf("%s has active endpoints", s.Name()) | |||
} | |||
|
|||
var allzeros, allones net.IP |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: allZeros
, allOnes
.
|
||
log "github.com/Sirupsen/logrus" | ||
"github.com/stretchr/testify/assert" | ||
"github.com/stretchr/testify/mock" | ||
|
||
"math/rand" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should put this in the top import group.
179de54
to
8417a05
Compare
@@ -69,3 +69,17 @@ Remove network with running container | |||
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} network ls | |||
Should Be Equal As Integers ${rc} 0 | |||
Should Not Contain ${output} test-network | |||
|
|||
Add and remove network multiple times |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer naming this - Verify user can create and delete many networks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its creating and deleting the same network over and over again, not creating a new network each time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
8417a05
to
cfe58a5
Compare
Fixes #4157