npc: Improve analyser comments
This commit is contained in:
1 parent
c5772c814c
commit
2c708b57a1
1 file changed
+3
-3
+3
-3
@@ -38,8 +38,8 @@ func (ns *ns) analysePolicy(policy *networkingv1.NetworkPolicy) (
|
|||||||
|
|
||||||
// To prevent targetSelector being overwritten by a subsequent selector with
|
// To prevent targetSelector being overwritten by a subsequent selector with
|
||||||
// the same key, addIfNotExist MUST be used when adding to podSelectors.
|
// the same key, addIfNotExist MUST be used when adding to podSelectors.
|
||||||
// Otherwise, targetSelector' "dst" property might be lost resulting in
|
// Otherwise, policyTypes of the selector might be lost resulting in
|
||||||
// an invalid content of the "default-allow" ipset.
|
// an invalid content in any "default-allow" ipset.
|
||||||
addIfNotExist(targetSelector, podSelectors)
|
addIfNotExist(targetSelector, podSelectors)
|
||||||
|
|
||||||
// If ingress is empty then this NetworkPolicy does not allow any ingress traffic
|
// If ingress is empty then this NetworkPolicy does not allow any ingress traffic
|
||||||
@@ -118,7 +118,7 @@ func (ns *ns) analysePolicy(policy *networkingv1.NetworkPolicy) (
|
|||||||
var dstSelector *selectorSpec
|
var dstSelector *selectorSpec
|
||||||
var dstRuleHost ruleHost
|
var dstRuleHost ruleHost
|
||||||
|
|
||||||
// NetworkPolicyPeer describes a peer to allow traffic from.
|
// NetworkPolicyPeer describes a peer to allow traffic to.
|
||||||
// Exactly one of its fields must be specified.
|
// Exactly one of its fields must be specified.
|
||||||
if peer.PodSelector != nil {
|
if peer.PodSelector != nil {
|
||||||
dstSelector, err = newSelectorSpec(peer.PodSelector, nil, ns.name, ipset.HashIP)
|
dstSelector, err = newSelectorSpec(peer.PodSelector, nil, ns.name, ipset.HashIP)
|
||||||
|
|||||||
Reference in new issue
Block a user