Skip to content

Commit

Permalink
Use target port of Service in NodePortLocal to configure Pod reachabi…
Browse files Browse the repository at this point in the history
…lity - addressed review comments - part 5

Signed-off-by: Monotosh Das <[email protected]>
  • Loading branch information
monotosh-avi committed Jun 17, 2021
1 parent 46264ae commit 86174a7
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions pkg/agent/nodeportlocal/npl_agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -423,20 +423,12 @@ func TestPodDelete(t *testing.T) {
assert.NoError(t, err, "Error when polling for port table update")
}

// TestPodAddMultiPort creates a Pod with multiple ports and a Service with same ports as target ports.
// It verifies that the Pod's NPL annotation and the local port table are updated correctly.
// TestPodAddMultiPort creates a Pod and a Service with two target ports.
// It verifies that the Pod's NPL annotation and the local port table are updated with both ports.
func TestAddMultiPortPodSvc(t *testing.T) {
newPort := 90
testSvc := getTestSvc(defaultPort, int32(newPort))
testPod := getTestPod()
testPod.Spec.Containers[0].Ports = append(
testPod.Spec.Containers[0].Ports,
corev1.ContainerPort{ContainerPort: defaultPort},
)
testPod.Spec.Containers[0].Ports = append(
testPod.Spec.Containers[0].Ports,
corev1.ContainerPort{ContainerPort: int32(newPort)},
)
testData := setUp(t, testSvc, testPod)
defer testData.tearDown()

Expand Down

0 comments on commit 86174a7

Please sign in to comment.