Describe PolicyTypes for Network Policy.

pull/6/head
xiangpengzhao 2017-11-01 16:11:27 +08:00
parent 1aaac98e7a
commit 3921ac9dd1
2 changed files with 3 additions and 0 deletions

View File

@ -3116,6 +3116,7 @@ func describeNetworkPolicySpec(nps networking.NetworkPolicySpec, w PrefixWriter)
printNetworkPolicySpecIngressFrom(nps.Ingress, " ", w)
w.Write(LEVEL_1, "Allowing egress traffic:\n")
printNetworkPolicySpecEgressTo(nps.Egress, " ", w)
w.Write(LEVEL_1, "Policy Types: %v\n", nps.PolicyTypes)
}
func printNetworkPolicySpecIngressFrom(npirs []networking.NetworkPolicyIngressRule, initialIndent string, w PrefixWriter) {

View File

@ -1682,6 +1682,7 @@ Spec:
----------
From Port: <any> (traffic allowed to all ports)
To: <any> (traffic not restricted by source)
Policy Types: [Ingress Egress]
`
port80 := intstr.FromInt(80)
@ -1793,6 +1794,7 @@ Spec:
},
{},
},
PolicyTypes: []networking.PolicyType{networking.PolicyTypeIngress, networking.PolicyTypeEgress},
},
})
d := NetworkPolicyDescriber{versionedFake}