apiVersion: apps.grafana.app/v1alpha1
kind: AppManifest
metadata:
  name: test-app
spec:
  appDisplayName: test-app
  appName: test-app
  extraPermissions:
    accessKinds:
    - actions:
      - get
      - list
      - watch
      group: foo.bar
      resource: foos
  group: testapp.ext.grafana.app
  operator:
    url: https://foo.bar:8443
    webhooks:
      conversionPath: /convert
      mutationPath: /mutate
      validationPath: /validate
  preferredVersion: v1
  roleBindings:
    viewer:
    - test-app:reader
  roles:
    test-app:reader:
      description: View Test App Resources
      kinds:
      - kind: TestKind
        permissionSet: viewer
      routes:
      - createFoobar
      title: Test App Viewer
  versions:
  - kinds:
    - admission:
        validation:
          operations:
          - CREATE
          - UPDATE
      conversion: true
      kind: TestKind
      plural: TestKinds
      schema:
        spec:
          properties:
            stringField:
              pattern: ^[a-zA-Z_][a-zA-Z0-9_-]*$
              type: string
          required:
          - stringField
          type: object
        status:
          properties:
            additionalFields:
              description: additionalFields is reserved for future use
              type: object
              x-kubernetes-preserve-unknown-fields: true
            operatorStates:
              additionalProperties:
                properties:
                  descriptiveState:
                    description: descriptiveState is an optional more descriptive
                      state field which has no requirements on format
                    type: string
                  details:
                    description: details contains any extra information that is operator-specific
                    type: object
                    x-kubernetes-preserve-unknown-fields: true
                  lastEvaluation:
                    description: lastEvaluation is the ResourceVersion last evaluated
                    type: string
                  state:
                    description: |-
                      state describes the state of the lastEvaluation.
                      It is limited to three possible states for machine evaluation.
                    enum:
                    - success
                    - in_progress
                    - failed
                    type: string
                required:
                - lastEvaluation
                - state
                type: object
              description: |-
                operatorStates is a map of operator ID to operator state evaluations.
                Any operator which consumes this kind SHOULD add its state evaluation information to this field.
              type: object
          type: object
      scope: Namespaced
      selectableFields:
      - .spec.stringField
    - conversion: false
      kind: TestKind2
      plural: TestKind2s
      schema:
        spec:
          properties:
            testField:
              type: string
          required:
          - testField
          type: object
        status:
          properties:
            additionalFields:
              description: additionalFields is reserved for future use
              type: object
              x-kubernetes-preserve-unknown-fields: true
            operatorStates:
              additionalProperties:
                properties:
                  descriptiveState:
                    description: descriptiveState is an optional more descriptive
                      state field which has no requirements on format
                    type: string
                  details:
                    description: details contains any extra information that is operator-specific
                    type: object
                    x-kubernetes-preserve-unknown-fields: true
                  lastEvaluation:
                    description: lastEvaluation is the ResourceVersion last evaluated
                    type: string
                  state:
                    description: |-
                      state describes the state of the lastEvaluation.
                      It is limited to three possible states for machine evaluation.
                    enum:
                    - success
                    - in_progress
                    - failed
                    type: string
                required:
                - lastEvaluation
                - state
                type: object
              description: |-
                operatorStates is a map of operator ID to operator state evaluations.
                Any operator which consumes this kind SHOULD add its state evaluation information to this field.
              type: object
          type: object
      scope: Namespaced
    name: v1
    served: true
  - kinds:
    - admission:
        mutation:
          operations:
          - CREATE
          - UPDATE
        validation:
          operations:
          - CREATE
          - UPDATE
      conversion: true
      kind: TestKind
      plural: TestKinds
      schema:
        spec:
          properties:
            intField:
              type: integer
            stringField:
              type: string
            timeField:
              format: date-time
              type: string
            unionNull:
              allOf:
              - required:
                - str
                - i
              description: This generates a normal go pointer field, but needs to
                be handled correctly as a selectable field, as the schema logic registers
                it as a disjunction
              nullable: true
              properties:
                i:
                  type: integer
                str:
                  type: string
              type: object
            unionNull2:
              description: null variant should be ignore in disjunction when generating
                the selectable field
              oneOf:
              - not:
                  anyOf:
                  - required:
                    - b
                required:
                - str
                - i
              - not:
                  anyOf:
                  - required:
                    - i
                required:
                - str
                - b
              - not:
                  anyOf:
                  - required:
                    - str
                  - required:
                    - i
                  - required:
                    - str
                  - required:
                    - b
              properties:
                b:
                  type: boolean
                i:
                  type: integer
                str:
                  type: string
              type:
              - object
              - "null"
          required:
          - stringField
          - intField
          - timeField
          type: object
        status:
          properties:
            additionalFields:
              description: additionalFields is reserved for future use
              type: object
              x-kubernetes-preserve-unknown-fields: true
            operatorStates:
              additionalProperties:
                properties:
                  descriptiveState:
                    description: descriptiveState is an optional more descriptive
                      state field which has no requirements on format
                    type: string
                  details:
                    description: details contains any extra information that is operator-specific
                    type: object
                    x-kubernetes-preserve-unknown-fields: true
                  lastEvaluation:
                    description: lastEvaluation is the ResourceVersion last evaluated
                    type: string
                  state:
                    description: |-
                      state describes the state of the lastEvaluation.
                      It is limited to three possible states for machine evaluation.
                    enum:
                    - success
                    - in_progress
                    - failed
                    type: string
                required:
                - lastEvaluation
                - state
                type: object
              description: |-
                operatorStates is a map of operator ID to operator state evaluations.
                Any operator which consumes this kind SHOULD add its state evaluation information to this field.
              type: object
          type: object
      scope: Namespaced
      selectableFields:
      - .spec.stringField
      - .spec.intField
      - .spec.unionNull.str
      - .spec.unionNull2.str
    name: v2
    served: true
  - kinds:
    - admission:
        mutation:
          operations:
          - CREATE
          - UPDATE
        validation:
          operations:
          - CREATE
          - UPDATE
      conversion: true
      kind: TestKind
      plural: TestKinds
      routes:
        /reconcile:
          post:
            operationId: createReconcileRequest
            requestBody:
              content:
                application/json:
                  schema:
                    additionalProperties: false
                    properties:
                      force:
                        default: false
                        type: boolean
                      reason:
                        type: string
                    required:
                    - force
                    type: object
              required: true
            responses:
              default:
                content:
                  application/json:
                    schema:
                      additionalProperties: false
                      properties:
                        message:
                          description: A comment containing "quotes" should not break
                            anything
                          type: string
                        status:
                          enum:
                          - success
                          - failure
                          type: string
                      required:
                      - status
                      - message
                      type: object
                description: Default OK response
        /search:
          get:
            operationId: getTestKindSearchResult
            parameters:
            - in: query
              name: limit
              schema:
                default: 10
                type: integer
            - in: query
              name: offset
              schema:
                default: 0
                type: integer
            - in: query
              name: q
              required: true
              schema:
                type: string
            responses:
              default:
                content:
                  application/json:
                    schema:
                      additionalProperties: false
                      properties:
                        apiVersion:
                          description: 'APIVersion defines the versioned schema of
                            this representation of an object. Servers should convert
                            recognized schemas to the latest internal value, and may
                            reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
                          type: string
                        items:
                          items:
                            additionalProperties: false
                            properties:
                              list:
                                items:
                                  additionalProperties: false
                                  properties:
                                    foo:
                                      type: string
                                  required:
                                  - foo
                                  type: object
                                type: array
                              name:
                                type: string
                              score:
                                type: number
                            required:
                            - name
                            - score
                            - list
                            type: object
                          type: array
                        kind:
                          description: 'Kind is a string value representing the REST
                            resource this object represents. Servers may infer this
                            from the endpoint the client submits requests to. Cannot
                            be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
                          type: string
                        total:
                          type: integer
                      required:
                      - items
                      - total
                      - apiVersion
                      - kind
                      type: object
                description: Default OK response
            x-grafana-test: true
            x-grafana-test-value:
              val: "1"
      schema:
        spec:
          properties:
            boolField:
              type: boolean
            intField:
              type: integer
            stringField:
              type: string
            timeField:
              format: date-time
              type: string
          required:
          - stringField
          - intField
          - timeField
          - boolField
          type: object
        status:
          properties:
            additionalFields:
              description: additionalFields is reserved for future use
              type: object
              x-kubernetes-preserve-unknown-fields: true
            operatorStates:
              additionalProperties:
                properties:
                  descriptiveState:
                    description: descriptiveState is an optional more descriptive
                      state field which has no requirements on format
                    type: string
                  details:
                    description: details contains any extra information that is operator-specific
                    type: object
                    x-kubernetes-preserve-unknown-fields: true
                  lastEvaluation:
                    description: lastEvaluation is the ResourceVersion last evaluated
                    type: string
                  state:
                    description: |-
                      state describes the state of the lastEvaluation.
                      It is limited to three possible states for machine evaluation.
                    enum:
                    - success
                    - in_progress
                    - failed
                    type: string
                required:
                - lastEvaluation
                - state
                type: object
              description: |-
                operatorStates is a map of operator ID to operator state evaluations.
                Any operator which consumes this kind SHOULD add its state evaluation information to this field.
              type: object
          type: object
      scope: Namespaced
      selectableFields:
      - .spec.stringField
      - .spec.intField
      - .spec.boolField
    name: v3
    served: true
  - kinds:
    - admission:
        validation:
          operations:
          - CREATE
          - UPDATE
      conversion: true
      kind: TestKind
      plural: TestKinds
      schema:
        spec:
          properties:
            union:
              oneOf:
              - required:
                - kind
                - spec
              - required:
                - kind
                - spec
              properties:
                kind:
                  type: string
                spec:
                  properties:
                    name:
                      type: string
                  required:
                  - name
                  type: object
              type: object
          required:
          - union
          type: object
        status:
          properties:
            additionalFields:
              description: additionalFields is reserved for future use
              type: object
              x-kubernetes-preserve-unknown-fields: true
            operatorStates:
              additionalProperties:
                properties:
                  descriptiveState:
                    description: descriptiveState is an optional more descriptive
                      state field which has no requirements on format
                    type: string
                  details:
                    description: details contains any extra information that is operator-specific
                    type: object
                    x-kubernetes-preserve-unknown-fields: true
                  lastEvaluation:
                    description: lastEvaluation is the ResourceVersion last evaluated
                    type: string
                  state:
                    description: |-
                      state describes the state of the lastEvaluation.
                      It is limited to three possible states for machine evaluation.
                    enum:
                    - success
                    - in_progress
                    - failed
                    type: string
                required:
                - lastEvaluation
                - state
                type: object
              description: |-
                operatorStates is a map of operator ID to operator state evaluations.
                Any operator which consumes this kind SHOULD add its state evaluation information to this field.
              type: object
          type: object
      scope: Namespaced
      selectableFields:
      - .spec.union.spec.name
    name: v4
    served: true
