diff --git a/pkg/printers/internalversion/describe.go b/pkg/printers/internalversion/describe.go index c6de8b13916..f2fe559f10b 100644 --- a/pkg/printers/internalversion/describe.go +++ b/pkg/printers/internalversion/describe.go @@ -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) { diff --git a/pkg/printers/internalversion/describe_test.go b/pkg/printers/internalversion/describe_test.go index 0eb6f3af13c..98a16d7c1bb 100644 --- a/pkg/printers/internalversion/describe_test.go +++ b/pkg/printers/internalversion/describe_test.go @@ -1682,6 +1682,7 @@ Spec: ---------- From Port: (traffic allowed to all ports) To: (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}