Commit 3921ac9d authored by xiangpengzhao's avatar xiangpengzhao

Describe PolicyTypes for Network Policy.

parent 1aaac98e
......@@ -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) {
......
......@@ -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}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment