apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: rbacdefinitions.access-manager.io
spec:
  group: access-manager.io
  names:
    kind: RbacDefinition
    listKind: RbacDefinitionList
    plural: rbacdefinitions
    singular: rbacdefinition
  scope: Cluster
  versions:
  - name: v1beta1
    schema:
      openAPIV3Schema:
        description: RbacDefinition is the Schema for the rbacdefinitions API
        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
          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
          metadata:
            type: object
          spec:
            description: RbacDefinitionSpec defines the desired state of RbacDefinition
            type: object
            properties:
              paused:
                type: boolean
              namespaced:
                description: Defines the desired state of RoleBindings
                type: array
                items:
                  type: object
                  properties:
                    namespace:
                      type: object
                      properties:
                        name:
                          type: string
                    namespaceSelector:
                      type: object
                      properties:
                        matchLabels:
                          type: object
                          x-kubernetes-preserve-unknown-fields: true
                        matchExpressions:
                          type: array
                          items:
                            type: object
                            x-kubernetes-preserve-unknown-fields: true
                    bindings:
                      type: array
                      items:
                        type: object
                        properties:
                          name:
                            type: string
                          roleName:
                            type: string
                          kind:
                            type: string
                          subjects:
                            type: array
                            items:
                              type: object
                              properties:
                                name:
                                  type: string
                                kind:
                                  type: string
                                namespace:
                                  type: string

              cluster:
                description: Defines the desired state of ClusterRoleBindings
                type: array
                items:
                  type: object
                  properties:
                    name:
                      type: string
                    clusterRoleName:
                      type: string
                    subjects:
                      type: array
                      items:
                        type: object
                        properties:
                          name:
                            type: string
                          kind:
                            type: string
                          namespace:
                            type: string

          status:
            description: RbacDefinitionStatus defines the observed state of RbacDefinition
            type: object
        type: object
    served: true
    storage: true
    subresources:
      status: {}
