apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  creationTimestamp: null
  name: manifestworks.work.open-cluster-management.io
spec:
  group: work.open-cluster-management.io
  names:
    kind: ManifestWork
    listKind: ManifestWorkList
    plural: manifestworks
    singular: manifestwork
  scope: "Namespaced"
  preserveUnknownFields: false
  subresources:
    status: {}
  validation:
    openAPIV3Schema:
      description: ManifestWork represents a manifests workload that hub wants to
        deploy on the managed cluster. A manifest workload is defined as a set of
        kubernetes resources. ManifestWork must be created in the cluster namespace
        on the hub, so that agent on the corresponding managed cluster can access
        this resource and deploy on the managed cluster.
      type: object
      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: Spec represents a desired configuration of work to be deployed
            on the managed cluster.
          type: object
          properties:
            workload:
              description: Workload represents the manifest workload to be deployed
                on managed cluster
              type: object
              properties:
                manifests:
                  description: Manifests represents a list of kuberenetes resources
                    to be deployed on the managed cluster.
                  type: array
                  items:
                    description: Manifest represents a resource to be deployed on
                      managed cluster
                    type: object
                    x-kubernetes-preserve-unknown-fields: true
                    x-kubernetes-embedded-resource: true
        status:
          description: Status represents the current status of work
          type: object
          properties:
            appliedResources:
              description: AppliedResources represents a list of resources defined
                within the manifestwork that are applied. Only resources with valid
                GroupVersionResource, namespace, and name are suitable. An item in
                this slice is deleted when there is no mapped manifest in manifestwork.Spec
                or by finalizer. The resource relating to the item will also be removed
                from managed cluster. The deleted resource may still be present until
                the finalizers for that resource are finished. However, the resource
                will not be undeleted, so it can be removed from this list and eventual
                consistency is preserved.
              type: array
              items:
                description: AppliedManifestResourceMeta represents the gvr, name
                  and namespace of a resource. Since these resources have been created,
                  they must have valid group, version, resource, namespace, and name.
                type: object
                properties:
                  group:
                    description: Group is the API Group of the kubernetes resource
                    type: string
                  name:
                    description: Name is the name of the kubernetes resource
                    type: string
                  namespace:
                    description: Name is the namespace of the kubernetes resource,
                      empty string indicates it is a cluster scoped resource.
                    type: string
                  resource:
                    description: Resource is the resource name of the kubernetes resource
                    type: string
                  uid:
                    description: UID is set on successful deletion of the kubernetes
                      resource by controller. The resource might be still visible
                      on the managed cluster after this field is set. It is not directly
                      settable by a client.
                    type: string
                  version:
                    description: Version is the version of the kubernetes resource
                    type: string
            conditions:
              description: 'Conditions contains the different condition statuses for
                this work. Valid condition types are: 1. Applied represents workload
                in ManifestWork is applied successfully on managed cluster. 2. Progressing
                represents workload in ManifestWork is being applied on managed cluster.
                3. Available represents workload in ManifestWork exists on the managed
                cluster. 4. Degraded represents the current state of workload does
                not match the desired state for a certain period.'
              type: array
              items:
                description: StatusCondition contains condition information for a
                  ManifestWork applied to a managed cluster.
                type: object
                properties:
                  lastTransitionTime:
                    description: LastTransitionTime is the last time the condition
                      changed from one status to another.
                    type: string
                    format: date-time
                  message:
                    description: Message is a human-readable message indicating details
                      about the last status change.
                    type: string
                  reason:
                    description: Reason is a (brief) reason for the condition's last
                      status change.
                    type: string
                  status:
                    description: Status is the status of the condition. One of True,
                      False, Unknown.
                    type: string
                  type:
                    description: Type is the type of the ManifestWork condition.
                    type: string
            resourceStatus:
              description: ResourceStatus represents the status of each resource in
                manifestwork deployed on managed cluster. The Klusterlet agent on
                managed cluster syncs the condition from managed to the hub.
              type: object
              properties:
                manifests:
                  description: 'Manifests represents the condition of manifests deployed
                    on managed cluster. Valid condition types are: 1. Progressing
                    represents the resource is being applied on managed cluster. 2.
                    Applied represents the resource is applied successfully on managed
                    cluster. 3. Available represents the resource exists on the managed
                    cluster. 4. Degraded represents the current state of resource
                    does not match the desired state for a certain period.'
                  type: array
                  items:
                    description: ManifestCondition represents the conditions of the
                      resources deployed on managed cluster
                    type: object
                    properties:
                      conditions:
                        description: Conditions represents the conditions of this
                          resource on managed cluster
                        type: array
                        items:
                          description: StatusCondition contains condition information
                            for a ManifestWork applied to a managed cluster.
                          type: object
                          properties:
                            lastTransitionTime:
                              description: LastTransitionTime is the last time the
                                condition changed from one status to another.
                              type: string
                              format: date-time
                            message:
                              description: Message is a human-readable message indicating
                                details about the last status change.
                              type: string
                            reason:
                              description: Reason is a (brief) reason for the condition's
                                last status change.
                              type: string
                            status:
                              description: Status is the status of the condition.
                                One of True, False, Unknown.
                              type: string
                            type:
                              description: Type is the type of the ManifestWork condition.
                              type: string
                      resourceMeta:
                        description: ResourceMeta represents the gvk, name and namespace
                          of a resoure
                        type: object
                        properties:
                          group:
                            description: Group is the API Group of the kubernetes
                              resource
                            type: string
                          kind:
                            description: Kind is the kind of the kubernetes resource
                            type: string
                          name:
                            description: Name is the name of the kubernetes resource
                            type: string
                          namespace:
                            description: Name is the namespace of the kubernetes resource
                            type: string
                          ordinal:
                            description: Ordinal represents the index of the manifest
                              on spec
                            type: integer
                            format: int32
                          resource:
                            description: Resource is the resource name of the kubernetes
                              resource
                            type: string
                          version:
                            description: Version is the version of the kubernetes
                              resource
                            type: string
  version: v1
  versions:
  - name: v1
    served: true
    storage: true
status:
  acceptedNames:
    kind: ""
    plural: ""
  conditions: []
  storedVersions: []
