-
Notifications
You must be signed in to change notification settings - Fork 386
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
Delete secondaryNetwork OVS ports correctly after an Agent restart #6853
base: main
Are you sure you want to change the base?
Conversation
63e028a
to
3b7abe8
Compare
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.
new tests are needed under test/e2e-secondary-network
to validate this patch
3bf9b47
to
63d1231
Compare
7904bea
to
20ca6f4
Compare
5e2b8e1
to
5e22752
Compare
@KMAnju-2021 I didn't see any new tests for the patch, re-post Antonin's comment:
|
5e22752
to
dd90f3c
Compare
dd90f3c
to
e61f080
Compare
0e16916
to
ecf56ad
Compare
906ebd1
to
07010b8
Compare
@@ -219,6 +219,124 @@ func (data *testData) pingBetweenInterfaces(t *testing.T) error { | |||
return nil | |||
} | |||
|
|||
// GetOVSPorts returns a list of OVS ports for a given pod. | |||
func (data *testData) GetOVSPorts(targetPod *testPodInfo) ([]string, error) { |
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.
All these funcs need not to be public?
beforeRestartOVSPorts = append(beforeRestartOVSPorts, ports...) | ||
} | ||
|
||
if err := e2eTestData.RestartAntreaAgentPods(90 * time.Second); err != nil { |
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.
I meant could we remove some Pods after Agent stops, and then check the secondary OVS ports are removed after Agent restarts.
return nil | ||
} | ||
|
||
// RemovePodsAndCheckOVSPorts verifies that OVS ports are removed when pods are deleted. |
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.
pods -> Pods
Please change other occurrences too.
} | ||
|
||
// Verify that the deleted pod's IPs are released | ||
podIPs, err := data.listPodIPs(pod) |
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.
I meant check secondary interface IPs are released to Antrea IPPool, for removed Pods when Agent stopped.
I am fine not to include it to the test case, if it is complex to implement (probably not that hard to get the state from IPPool CR).
07010b8
to
4757476
Compare
|
||
// CheckIPReleased verifies if the VLAN IP from the deleted pod is released. | ||
func (data *testData) checkIPReleased(vlanIP string) error { | ||
ipPoolCmd := []string{"kubectl", "get", "ippool", "-o", "jsonpath={.status.allocatedIPs}"} |
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.
I feel it is simpler/better to check the IPPool CR status directly via API. You can check example code in antreaipam_test.go. Sorry, I thought about sending you the pointer earlier but forgot it.
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.
Sure , refactoring the code, thanks!
63f27ab
to
10b33f7
Compare
Signed-off-by: KMAnju-2021 <km074btcse18@igdtuw.ac.in>
10b33f7
to
795304f
Compare
Closes: #6578 #5623
Store the SecondaryNetwork interface in interfacestore after Agent restart and delete secondaryNetwork OVS ports correctly.