npc: Rename dstSelector to targetSelector
dstSelector becomes ambiguous once we introduce the egress. So, from now on, we call selector a target selector if it selects pods to which a netpol applies (aka NetworkPolicySpec.podSelector).
This commit is contained in:
1 parent
f02a11b27b
commit
8d1ee752d4
4 files changed
+62
-64
No files matched your search
@@ -386,7 +386,7 @@ func TestOutOfOrderPodEvents(t *testing.T) {
|
||||
}
|
||||
|
||||
// Test case for https://github.com/weaveworks/weave/issues/3222
|
||||
func TestNewDstSelector(t *testing.T) {
|
||||
func TestNewTargetSelector(t *testing.T) {
|
||||
const (
|
||||
ingressDefaultAllowIPSetName = "weave-;rGqyMIl1HN^cfDki~Z$3]6!N"
|
||||
podIP = "10.32.0.10"
|
||||
@@ -431,7 +431,7 @@ func TestNewDstSelector(t *testing.T) {
|
||||
}
|
||||
controller.AddNetworkPolicy(netpolBar)
|
||||
|
||||
// netpolBar dst selector selects podFoo
|
||||
// netpolBar target selector selects podFoo
|
||||
require.False(t, m.entryExists(ingressDefaultAllowIPSetName, podIP))
|
||||
|
||||
netpolFoo := &networkingv1.NetworkPolicy{
|
||||
@@ -453,9 +453,9 @@ func TestNewDstSelector(t *testing.T) {
|
||||
controller.AddNetworkPolicy(netpolFoo)
|
||||
|
||||
controller.DeleteNetworkPolicy(netpolBar)
|
||||
// netpolFoo dst-selects podFoo
|
||||
// netpolFoo target-selects podFoo
|
||||
require.False(t, m.entryExists(ingressDefaultAllowIPSetName, podIP))
|
||||
controller.DeleteNetworkPolicy(netpolFoo)
|
||||
// No netpol dst-selects podFoo
|
||||
// No netpol target-selects podFoo
|
||||
require.True(t, m.entryExists(ingressDefaultAllowIPSetName, podIP))
|
||||
}
|
||||
Reference in new issue
Block a user