Allow including both podSelector and namespaceSelector in a NetworkPolicyPeer

This commit is contained in:
Dan Winship
2018-02-26 14:59:56 -05:00
parent 50b2b30526
commit 329639e9f6
5 changed files with 85 additions and 36 deletions

View File

@@ -75,8 +75,8 @@ func ValidateNetworkPolicyPeer(peer *networking.NetworkPolicyPeer, peerPath *fie
if numPeers == 0 {
allErrs = append(allErrs, field.Required(peerPath, "must specify a peer"))
} else if numPeers > 1 {
allErrs = append(allErrs, field.Forbidden(peerPath, "may not specify more than 1 peer"))
} else if numPeers > 1 && peer.IPBlock != nil {
allErrs = append(allErrs, field.Forbidden(peerPath, "may not specify both ipBlock and another peer"))
}
return allErrs