---
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingAdmissionPolicy
metadata:
  creationTimestamp: "2025-10-27T11:30:02Z"
  generation: 1
  managedFields:
  - apiVersion: admissionregistration.k8s.io/v1
    fieldsType: FieldsV1
    fieldsV1:
      f:status:
        f:observedGeneration: {}
        f:typeChecking: {}
    manager: validatingadmissionpolicy-status
    operation: Apply
    subresource: status
    time: "2025-10-27T11:30:02Z"
  - apiVersion: admissionregistration.k8s.io/v1
    fieldsType: FieldsV1
    fieldsV1:
      f:metadata:
        f:ownerReferences:
          k:{"uid":"42934d21-bf48-4e6e-be5b-f538b0be0793"}: {}
      f:spec:
        f:failurePolicy: {}
        f:matchConstraints: {}
        f:validations: {}
    manager: cluster-network-operator/operconfig
    operation: Apply
    time: "2025-10-27T11:30:28Z"
  name: user-defined-networks-namespace-label
  ownerReferences:
  - apiVersion: operator.openshift.io/v1
    blockOwnerDeletion: true
    controller: true
    kind: Network
    name: cluster
    uid: 42934d21-bf48-4e6e-be5b-f538b0be0793
  resourceVersion: "5039"
  uid: 92d9382a-1f3a-41fe-b6f1-d22b6a730fa3
spec:
  failurePolicy: Fail
  matchConstraints:
    matchPolicy: Equivalent
    namespaceSelector: {}
    objectSelector: {}
    resourceRules:
    - apiGroups:
      - ""
      apiVersions:
      - v1
      operations:
      - UPDATE
      resources:
      - namespaces
      scope: '*'
  validations:
  - expression: ('k8s.ovn.org/primary-user-defined-network' in oldObject.metadata.labels)
      == ('k8s.ovn.org/primary-user-defined-network' in object.metadata.labels)
    message: The 'k8s.ovn.org/primary-user-defined-network' label cannot be added/removed
      after the namespace was created
status:
  observedGeneration: 1
  typeChecking: {}
