Skip to content

MultiNetwork Policy should be namespaced #153

@sferlin

Description

@sferlin

According to the following:

oc api-resources --api-group='k8s.cni.cncf.io'
NAME                             SHORTNAMES       APIVERSION                 NAMESPACED   KIND
ipamclaims                                        k8s.cni.cncf.io/v1alpha1   true         IPAMClaim
multi-networkpolicies            multi-policy     k8s.cni.cncf.io/v1beta1    true         MultiNetworkPolicy
network-attachment-definitions   net-attach-def   k8s.cni.cncf.io/v1         true         NetworkAttachmentDefinition

The https://github.com/openshift-kni/telco-reference/blob/main/telco-core/configuration/reference-crs-kube-compare/required/networking/multinetworkpolicy/multiNetworkPolicyAllowPortProtocol.yaml#L5 should include a wildcard for a namespace:

apiVersion: k8s.cni.cncf.io/v1beta1
kind: MultiNetworkPolicy
metadata:
  name: allow-port-and-protocol
  {{- if .metadata }}
  namespace: {{ .metadata.namespace }}
  {{- end }}

The documentation suggests the namespace to be present for its CLI version: https://docs.redhat.com/en/documentation/openshift_container_platform/4.18/html/networking/multiple-networks#nw-networkpolicy-create-cli_configuring-multi-network-policy

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions