Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
shireenf-ibm committed Oct 9, 2024
1 parent 8c7fe38 commit b506853
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
7 changes: 7 additions & 0 deletions pkg/netpol/connlist/connlist_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1125,10 +1125,17 @@ var goodPathTests = []struct {
outputFormats: []string{output.DefaultFormat},
},
{
// the netpol allows connection to pod-a on a named port "newport" with "protocol UDP",
// but since the configuration of "pod-a" contains a port with same name but a different protocol,
// i.e. there is no matching named port in the pod's configuration; then the output does not contain
// a connection from new-pod to pod-a
testDirName: "netpol_named_port_test",
outputFormats: []string{output.DefaultFormat},
},
{
// the netpol allows connection to "pod-b" on multiple named-ports;
// only some of the ports have a matching named-port + protocol in the pod's configuration
// so we see only the successfully converted ports in the connlist output
testDirName: "netpol_named_port_test_2",
outputFormats: []string{output.DefaultFormat},
},
Expand Down
2 changes: 1 addition & 1 deletion tests/netpol_named_port_test/netpol.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ spec:
- from:
- namespaceSelector: {}
ports:
- port: newport
- port: newport # this port with its protocol has no match in the pod configuration
protocol: UDP
8 changes: 4 additions & 4 deletions tests/netpol_named_port_test_2/netpol.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ spec:
- from:
- namespaceSelector: {}
ports:
- port: newport
- port: newport # this port with its protocol has no match in the pod configuration
protocol: UDP
- port: sctp-port
- port: sctp-port # its matching port number in the pod configuration is 8956
protocol: SCTP
- port: newport
- port: newport # its matching port number in the pod configuration is 9090
protocol: SCTP
- port: not-found
- port: not-found # this port with its protocol has no match in the pod configuration
protocol: SCTP

0 comments on commit b506853

Please sign in to comment.