---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: egressnetworks.policy.linkerd.io
  annotations:
    {{ include "partials.annotations.created-by" . }}
  labels:
    helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
    linkerd.io/control-plane-ns: {{.Release.Namespace}}
spec:
  group: policy.linkerd.io
  names:
    categories:
    - policy
    kind: EgressNetwork
    listKind: EgressNetworkList
    plural: egressnetworks
    singular: egressnetwork
  scope: Namespaced
  versions:
  - name: v1alpha1
    served: true
    storage: true
    subresources:
      status: {}
    schema:
      openAPIV3Schema:
        description: >-
          An EgressNetwork captures traffic to egress destinations
        type: object
        required: [spec]
        properties:
          apiVerson:
            type: string
          kind:
            type: string
          metadata:
            type: object
          spec:
            properties:
              trafficPolicy:
                description: >-
                  This field controls the traffic policy enforced upon traffic
                  that does not match any explicit route resources associated
                  with an instance of this object. The values that are allowed
                  currently are:
                   - Allow - permits all traffic, even if it has not been
                                explicitly described via attaching an xRoute
                                resources.
                   - Deny -  blocks all traffic that has not been described via
                                attaching an xRoute resource.
                type: string
                enum:
                - Allow
                - Deny
              networks:
                type: array
                items:
                  type: object
                  required: [cidr]
                  properties:
                    cidr:
                      description: >-
                        The CIDR of the network to be authorized.
                      type: string
                    except:
                      description: >-
                        A list of IP networks/addresses not to be included in
                        the above `cidr`.
                      type: array
                      items:
                        type: string
            type: object
            required:
            - trafficPolicy
          status:
            type: object
            properties:
              conditions:
                type: array
                items:
                  type: object
                  properties:
                    lastTransitionTime:
                      description: lastTransitionTime is the last time the
                        condition transitioned from one status to another.
                      format: date-time
                      type: string
                    status:
                      description: status of the condition (one of True, False, Unknown)
                      enum:
                      - "True"
                      - "False"
                      - Unknown
                      type: string
                    type:
                      description: type of the condition in CamelCase or in
                        foo.example.com/CamelCase.
                      maxLength: 316
                      pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
                      type: string
                    reason:
                      description: reason contains a programmatic identifier
                        indicating the reason for the condition's last
                        transition. Producers of specific condition types may
                        define expected values and meanings for this field, and
                        whether the values are considered a guaranteed API. The
                        value should be a CamelCase string. This field may not
                        be empty.
                      maxLength: 1024
                      minLength: 1
                      pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
                      type: string
                    message:
                      description: message is a human readable message
                        indicating details about the transition. This may be an
                        empty string.
                      maxLength: 32768
                      type: string
                required:
                - status
                - type
