Skip to content

Commit

Permalink
Add e2e test case
Browse files Browse the repository at this point in the history
Signed-off-by: Wenqi Qiu <[email protected]>
  • Loading branch information
wenqiq committed Feb 15, 2022
1 parent 8911964 commit 456d0c7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
5 changes: 2 additions & 3 deletions docs/antrea-network-policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -1100,11 +1100,11 @@ spec:
- fqdn: "svcA.default.svc.cluster.local"
```

## Node Selector
## Node Selector

NodeSelector selects certain Nodes which match the label selector. It adds Node IPs to egress rules in `to` field
or ingress rules in `from` filed.
The following rule applies to Pods with label `app=antrea-test-app` and will `Drop` egress traffic to
The following rule applies to Pods with label `app=antrea-test-app` and will `Drop` egress traffic to
Nodes which have the labels `node-role.kubernetes.io/control-plane`.

```yaml
Expand All @@ -1129,7 +1129,6 @@ spec:
port: 6443
```


## toServices instruction

A combination of Service name and Service Namespace can be used in `toServices` to refer to a Service.
Expand Down
1 change: 0 additions & 1 deletion plugins/octant/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ require (
github.com/gobwas/glob v0.2.3 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
github.com/golang/mock v1.6.0 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/snappy v0.0.3 // indirect
github.com/google/go-cmp v0.5.5 // indirect
Expand Down
6 changes: 2 additions & 4 deletions test/e2e/antreapolicy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2541,9 +2541,7 @@ func testToServices(t *testing.T) {
func testACNPNodeSelector(t *testing.T) {
builder := &ClusterNetworkPolicySpecBuilder{}
builder = builder.SetName("test-acnp-drop-egress-control-plane").
SetPriority(1.0).
SetAppliedToGroup([]ACNPAppliedToSpec{{NSSelector: map[string]string{}}})
controlPlaneNodeName()
SetPriority(1.0)
nodeSelector := metav1.LabelSelector{MatchLabels: map[string]string{"kubernetes.io/hostname": controlPlaneNodeName()}}
builder.AddNodeSelectorRule(&nodeSelector, v1.ProtocolTCP, &p6443, "egress-control-plane-drop",
[]ACNPAppliedToSpec{{NSSelector: map[string]string{"ns": "x"}, PodSelector: map[string]string{"pod": "a"}}},
Expand All @@ -2554,7 +2552,7 @@ func testACNPNodeSelector(t *testing.T) {
"x/a",
controlPlaneNodeIPv4(),
6443,
Rejected,
Dropped,
},
{
"x/b",
Expand Down

0 comments on commit 456d0c7

Please sign in to comment.