mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-02 11:18:16 +00:00
Allow including both podSelector and namespaceSelector in a NetworkPolicyPeer
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user