---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  annotations:
    controller-gen.kubebuilder.io/version: v0.16.5
  name: stages.kargo.akuity.io
spec:
  group: kargo.akuity.io
  names:
    kind: Stage
    listKind: StageList
    plural: stages
    singular: stage
  scope: Namespaced
  versions:
  - additionalPrinterColumns:
    - jsonPath: .spec.shard
      name: Shard
      type: string
    - jsonPath: .status.freightSummary
      name: Current Freight
      type: string
    - jsonPath: .status.health.status
      name: Health
      type: string
    - jsonPath: .status.phase
      name: Phase
      type: string
    - jsonPath: .metadata.creationTimestamp
      name: Age
      type: date
    name: v1alpha1
    schema:
      openAPIV3Schema:
        description: Stage is the Kargo API's main type.
        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 describes sources of Freight used by the Stage and how to incorporate
              Freight into the Stage.
            properties:
              promotionTemplate:
                description: |-
                  PromotionTemplate describes how to incorporate Freight into the Stage
                  using a Promotion.
                properties:
                  spec:
                    description: |-
                      PromotionTemplateSpec describes the (partial) specification of a Promotion
                      for a Stage. This is a template that can be used to create a Promotion for a
                      Stage.
                    properties:
                      steps:
                        description: |-
                          Steps specifies the directives to be executed as part of a Promotion.
                          The order in which the directives are executed is the order in which they
                          are listed in this field.
                        items:
                          description: PromotionStep describes a directive to be executed
                            as part of a Promotion.
                          properties:
                            as:
                              description: As is the alias this step can be referred
                                to as.
                              type: string
                            config:
                              description: |-
                                Config is opaque configuration for the PromotionStep that is understood
                                only by each PromotionStep's implementation. It is legal to utilize
                                expressions in defining values at any level of this block.
                                See https://docs.kargo.io/references/expression-language for details.
                              x-kubernetes-preserve-unknown-fields: true
                            retry:
                              description: Retry is the retry policy for this step.
                              properties:
                                attempts:
                                  description: |-
                                    Attempts is the number of times the step can be attempted before the
                                    PromotionStep is marked as failed.

                                    If this field is set to 1, the step will not be retried. If this
                                    field is set to -1, the step will be retried indefinitely.

                                    The default of this field depends on the step being executed. Refer to
                                    the documentation for the specific step for more information.
                                  format: int64
                                  type: integer
                              type: object
                            uses:
                              description: Uses identifies a runner that can execute
                                this step.
                              minLength: 1
                              type: string
                          required:
                          - uses
                          type: object
                        minItems: 1
                        type: array
                      vars:
                        description: |-
                          Vars is a list of variables that can be referenced by expressions in
                          promotion steps.
                        items:
                          description: |-
                            PromotionVariable describes a single variable that may be referenced by
                            expressions in promotion steps.
                          properties:
                            name:
                              description: Name is the name of the variable.
                              minLength: 1
                              pattern: ^[a-zA-Z_]\w*$
                              type: string
                            value:
                              description: |-
                                Value is the value of the variable. It is allowed to utilize expressions
                                in the value.
                                See https://docs.kargo.io/references/expression-language for details.
                              type: string
                          required:
                          - name
                          - value
                          type: object
                        type: array
                    type: object
                required:
                - spec
                type: object
              requestedFreight:
                description: |-
                  RequestedFreight expresses the Stage's need for certain pieces of Freight,
                  each having originated from a particular Warehouse. This list must be
                  non-empty. In the common case, a Stage will request Freight having
                  originated from just one specific Warehouse. In advanced cases, requesting
                  Freight from multiple Warehouses provides a method of advancing new
                  artifacts of different types through parallel pipelines at different
                  speeds. This can be useful, for instance, if a Stage is home to multiple
                  microservices that are independently versioned.
                items:
                  description: |-
                    FreightRequest expresses a Stage's need for Freight having originated from a
                    particular Warehouse.
                  properties:
                    origin:
                      description: |-
                        Origin specifies from where the requested Freight must have originated.
                        This is a required field.
                      properties:
                        kind:
                          description: |-
                            Kind is the kind of resource from which Freight may have originated. At
                            present, this can only be "Warehouse".
                          enum:
                          - Warehouse
                          type: string
                        name:
                          description: |-
                            Name is the name of the resource of the kind indicated by the Kind field
                            from which Freight may originated.
                          type: string
                      required:
                      - kind
                      - name
                      type: object
                    sources:
                      description: |-
                        Sources describes where the requested Freight may be obtained from. This is
                        a required field.
                      properties:
                        direct:
                          description: |-
                            Direct indicates the requested Freight may be obtained directly from the
                            Warehouse from which it originated. If this field's value is false, then
                            the value of the Stages field must be non-empty. i.e. Between the two
                            fields, at least one source must be specified.
                          type: boolean
                        stages:
                          description: |-
                            Stages identifies other "upstream" Stages as potential sources of the
                            requested Freight. If this field's value is empty, then the value of the
                            Direct field must be true. i.e. Between the two fields, at least on source
                            must be specified.
                          items:
                            type: string
                          type: array
                      type: object
                  required:
                  - origin
                  - sources
                  type: object
                minItems: 1
                type: array
              shard:
                description: |-
                  Shard is the name of the shard that this Stage belongs to. This is an
                  optional field. If not specified, the Stage will belong to the default
                  shard. A defaulting webhook will sync the value of the
                  kargo.akuity.io/shard label with the value of this field. When this field
                  is empty, the webhook will ensure that label is absent.
                type: string
              verification:
                description: |-
                  Verification describes how to verify a Stage's current Freight is fit for
                  promotion downstream.
                properties:
                  analysisRunMetadata:
                    description: |-
                      AnalysisRunMetadata contains optional metadata that should be applied to
                      all AnalysisRuns.
                    properties:
                      annotations:
                        additionalProperties:
                          type: string
                        description: Additional annotations to apply to an AnalysisRun.
                        type: object
                      labels:
                        additionalProperties:
                          type: string
                        description: Additional labels to apply to an AnalysisRun.
                        type: object
                    type: object
                  analysisTemplates:
                    description: |-
                      AnalysisTemplates is a list of AnalysisTemplates from which AnalysisRuns
                      should be created to verify a Stage's current Freight is fit to be promoted
                      downstream.
                    items:
                      description: AnalysisTemplateReference is a reference to an
                        AnalysisTemplate.
                      properties:
                        name:
                          description: |-
                            Name is the name of the AnalysisTemplate in the same project/namespace as
                            the Stage.
                          type: string
                      required:
                      - name
                      type: object
                    type: array
                  args:
                    description: Args lists arguments that should be added to all
                      AnalysisRuns.
                    items:
                      description: AnalysisRunArgument represents an argument to be
                        added to an AnalysisRun.
                      properties:
                        name:
                          description: Name is the name of the argument.
                          type: string
                        value:
                          description: Value is the value of the argument.
                          type: string
                      required:
                      - name
                      - value
                      type: object
                    type: array
                type: object
            required:
            - requestedFreight
            type: object
          status:
            description: Status describes the Stage's current and recent Freight,
              health, and more.
            properties:
              conditions:
                description: |-
                  Conditions contains the last observations of the Stage's current
                  state.
                items:
                  description: Condition contains details for one aspect of the current
                    state of this API Resource.
                  properties:
                    lastTransitionTime:
                      description: |-
                        lastTransitionTime is the last time the condition transitioned from one status to another.
                        This should be when the underlying condition changed.  If that is not known, then using the time when the API field changed is acceptable.
                      format: date-time
                      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
                    observedGeneration:
                      description: |-
                        observedGeneration represents the .metadata.generation that the condition was set based upon.
                        For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
                        with respect to the current state of the instance.
                      format: int64
                      minimum: 0
                      type: integer
                    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
                    status:
                      description: status of the condition, one of True, False, Unknown.
                      enum:
                      - "True"
                      - "False"
                      - Unknown
                      type: string
                    type:
                      description: type of 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
                  required:
                  - lastTransitionTime
                  - message
                  - reason
                  - status
                  - type
                  type: object
                type: array
                x-kubernetes-list-map-keys:
                - type
                x-kubernetes-list-type: map
              currentPromotion:
                description: CurrentPromotion is a reference to the currently Running
                  promotion.
                properties:
                  finishedAt:
                    description: FinishedAt is the time at which the Promotion was
                      completed.
                    format: date-time
                    type: string
                  freight:
                    description: Freight is the freight being promoted.
                    properties:
                      charts:
                        description: Charts describes specific versions of specific
                          Helm charts.
                        items:
                          description: Chart describes a specific version of a Helm
                            chart.
                          properties:
                            name:
                              description: Name specifies the name of the chart.
                              type: string
                            repoURL:
                              description: |-
                                RepoURL specifies the URL of a Helm chart repository. Classic chart
                                repositories (using HTTP/S) can contain differently named charts. When this
                                field points to such a repository, the Name field will specify the name of
                                the chart within the repository. In the case of a repository within an OCI
                                registry, the URL implicitly points to a specific chart and the Name field
                                will be empty.
                              type: string
                            version:
                              description: Version specifies a particular version
                                of the chart.
                              type: string
                          type: object
                        type: array
                      commits:
                        description: Commits describes specific Git repository commits.
                        items:
                          description: GitCommit describes a specific commit from
                            a specific Git repository.
                          properties:
                            author:
                              description: Author is the author of the commit.
                              type: string
                            branch:
                              description: Branch denotes the branch of the repository
                                where this commit was found.
                              type: string
                            committer:
                              description: Committer is the person who committed the
                                commit.
                              type: string
                            id:
                              description: |-
                                ID is the ID of a specific commit in the Git repository specified by
                                RepoURL.
                              type: string
                            message:
                              description: |-
                                Message is the message associated with the commit. At present, this only
                                contains the first line (subject) of the commit message.
                              type: string
                            repoURL:
                              description: RepoURL is the URL of a Git repository.
                              type: string
                            tag:
                              description: |-
                                Tag denotes a tag in the repository that matched selection criteria and
                                resolved to this commit.
                              type: string
                          type: object
                        type: array
                      images:
                        description: Images describes specific versions of specific
                          container images.
                        items:
                          description: Image describes a specific version of a container
                            image.
                          properties:
                            digest:
                              description: |-
                                Digest identifies a specific version of the image in the repository
                                specified by RepoURL. This is a more precise identifier than Tag.
                              type: string
                            gitRepoURL:
                              description: |-
                                GitRepoURL specifies the URL of a Git repository that contains the source
                                code for the image repository referenced by the RepoURL field if Kargo was
                                able to infer it.
                              type: string
                            repoURL:
                              description: RepoURL describes the repository in which
                                the image can be found.
                              type: string
                            tag:
                              description: |-
                                Tag identifies a specific version of the image in the repository specified
                                by RepoURL.
                              type: string
                          type: object
                        type: array
                      name:
                        description: |-
                          Name is system-assigned identifier that is derived deterministically from
                          the contents of the Freight. i.e. Two pieces of Freight can be compared for
                          equality by comparing their Names.
                        type: string
                      origin:
                        description: Origin describes a kind of Freight in terms of
                          its origin.
                        properties:
                          kind:
                            description: |-
                              Kind is the kind of resource from which Freight may have originated. At
                              present, this can only be "Warehouse".
                            enum:
                            - Warehouse
                            type: string
                          name:
                            description: |-
                              Name is the name of the resource of the kind indicated by the Kind field
                              from which Freight may originated.
                            type: string
                        required:
                        - kind
                        - name
                        type: object
                    type: object
                  name:
                    description: Name is the name of the Promotion.
                    type: string
                  status:
                    description: Status is the (optional) status of the Promotion.
                    properties:
                      currentStep:
                        description: |-
                          CurrentStep is the index of the current promotion step being executed. This
                          permits steps that have already run successfully to be skipped on
                          subsequent reconciliations attempts.
                        format: int64
                        type: integer
                      currentStepAttempt:
                        description: |-
                          CurrentStepAttempt is the number of times the current step has been
                          attempted.
                        format: int64
                        type: integer
                      finishedAt:
                        description: FinishedAt is the time when the promotion was
                          completed.
                        format: date-time
                        type: string
                      freight:
                        description: Freight is the detail of the piece of freight
                          that was referenced by this promotion.
                        properties:
                          charts:
                            description: Charts describes specific versions of specific
                              Helm charts.
                            items:
                              description: Chart describes a specific version of a
                                Helm chart.
                              properties:
                                name:
                                  description: Name specifies the name of the chart.
                                  type: string
                                repoURL:
                                  description: |-
                                    RepoURL specifies the URL of a Helm chart repository. Classic chart
                                    repositories (using HTTP/S) can contain differently named charts. When this
                                    field points to such a repository, the Name field will specify the name of
                                    the chart within the repository. In the case of a repository within an OCI
                                    registry, the URL implicitly points to a specific chart and the Name field
                                    will be empty.
                                  type: string
                                version:
                                  description: Version specifies a particular version
                                    of the chart.
                                  type: string
                              type: object
                            type: array
                          commits:
                            description: Commits describes specific Git repository
                              commits.
                            items:
                              description: GitCommit describes a specific commit from
                                a specific Git repository.
                              properties:
                                author:
                                  description: Author is the author of the commit.
                                  type: string
                                branch:
                                  description: Branch denotes the branch of the repository
                                    where this commit was found.
                                  type: string
                                committer:
                                  description: Committer is the person who committed
                                    the commit.
                                  type: string
                                id:
                                  description: |-
                                    ID is the ID of a specific commit in the Git repository specified by
                                    RepoURL.
                                  type: string
                                message:
                                  description: |-
                                    Message is the message associated with the commit. At present, this only
                                    contains the first line (subject) of the commit message.
                                  type: string
                                repoURL:
                                  description: RepoURL is the URL of a Git repository.
                                  type: string
                                tag:
                                  description: |-
                                    Tag denotes a tag in the repository that matched selection criteria and
                                    resolved to this commit.
                                  type: string
                              type: object
                            type: array
                          images:
                            description: Images describes specific versions of specific
                              container images.
                            items:
                              description: Image describes a specific version of a
                                container image.
                              properties:
                                digest:
                                  description: |-
                                    Digest identifies a specific version of the image in the repository
                                    specified by RepoURL. This is a more precise identifier than Tag.
                                  type: string
                                gitRepoURL:
                                  description: |-
                                    GitRepoURL specifies the URL of a Git repository that contains the source
                                    code for the image repository referenced by the RepoURL field if Kargo was
                                    able to infer it.
                                  type: string
                                repoURL:
                                  description: RepoURL describes the repository in
                                    which the image can be found.
                                  type: string
                                tag:
                                  description: |-
                                    Tag identifies a specific version of the image in the repository specified
                                    by RepoURL.
                                  type: string
                              type: object
                            type: array
                          name:
                            description: |-
                              Name is system-assigned identifier that is derived deterministically from
                              the contents of the Freight. i.e. Two pieces of Freight can be compared for
                              equality by comparing their Names.
                            type: string
                          origin:
                            description: Origin describes a kind of Freight in terms
                              of its origin.
                            properties:
                              kind:
                                description: |-
                                  Kind is the kind of resource from which Freight may have originated. At
                                  present, this can only be "Warehouse".
                                enum:
                                - Warehouse
                                type: string
                              name:
                                description: |-
                                  Name is the name of the resource of the kind indicated by the Kind field
                                  from which Freight may originated.
                                type: string
                            required:
                            - kind
                            - name
                            type: object
                        type: object
                      freightCollection:
                        description: |-
                          FreightCollection contains the details of the piece of Freight referenced
                          by this Promotion as well as any additional Freight that is carried over
                          from the target Stage's current state.
                        properties:
                          id:
                            description: |-
                              ID is a unique and deterministically calculated identifier for the
                              FreightCollection. It is updated on each use of the UpdateOrPush method.
                            type: string
                          items:
                            additionalProperties:
                              description: |-
                                FreightReference is a simplified representation of a piece of Freight -- not
                                a root resource type.
                              properties:
                                charts:
                                  description: Charts describes specific versions
                                    of specific Helm charts.
                                  items:
                                    description: Chart describes a specific version
                                      of a Helm chart.
                                    properties:
                                      name:
                                        description: Name specifies the name of the
                                          chart.
                                        type: string
                                      repoURL:
                                        description: |-
                                          RepoURL specifies the URL of a Helm chart repository. Classic chart
                                          repositories (using HTTP/S) can contain differently named charts. When this
                                          field points to such a repository, the Name field will specify the name of
                                          the chart within the repository. In the case of a repository within an OCI
                                          registry, the URL implicitly points to a specific chart and the Name field
                                          will be empty.
                                        type: string
                                      version:
                                        description: Version specifies a particular
                                          version of the chart.
                                        type: string
                                    type: object
                                  type: array
                                commits:
                                  description: Commits describes specific Git repository
                                    commits.
                                  items:
                                    description: GitCommit describes a specific commit
                                      from a specific Git repository.
                                    properties:
                                      author:
                                        description: Author is the author of the commit.
                                        type: string
                                      branch:
                                        description: Branch denotes the branch of
                                          the repository where this commit was found.
                                        type: string
                                      committer:
                                        description: Committer is the person who committed
                                          the commit.
                                        type: string
                                      id:
                                        description: |-
                                          ID is the ID of a specific commit in the Git repository specified by
                                          RepoURL.
                                        type: string
                                      message:
                                        description: |-
                                          Message is the message associated with the commit. At present, this only
                                          contains the first line (subject) of the commit message.
                                        type: string
                                      repoURL:
                                        description: RepoURL is the URL of a Git repository.
                                        type: string
                                      tag:
                                        description: |-
                                          Tag denotes a tag in the repository that matched selection criteria and
                                          resolved to this commit.
                                        type: string
                                    type: object
                                  type: array
                                images:
                                  description: Images describes specific versions
                                    of specific container images.
                                  items:
                                    description: Image describes a specific version
                                      of a container image.
                                    properties:
                                      digest:
                                        description: |-
                                          Digest identifies a specific version of the image in the repository
                                          specified by RepoURL. This is a more precise identifier than Tag.
                                        type: string
                                      gitRepoURL:
                                        description: |-
                                          GitRepoURL specifies the URL of a Git repository that contains the source
                                          code for the image repository referenced by the RepoURL field if Kargo was
                                          able to infer it.
                                        type: string
                                      repoURL:
                                        description: RepoURL describes the repository
                                          in which the image can be found.
                                        type: string
                                      tag:
                                        description: |-
                                          Tag identifies a specific version of the image in the repository specified
                                          by RepoURL.
                                        type: string
                                    type: object
                                  type: array
                                name:
                                  description: |-
                                    Name is system-assigned identifier that is derived deterministically from
                                    the contents of the Freight. i.e. Two pieces of Freight can be compared for
                                    equality by comparing their Names.
                                  type: string
                                origin:
                                  description: Origin describes a kind of Freight
                                    in terms of its origin.
                                  properties:
                                    kind:
                                      description: |-
                                        Kind is the kind of resource from which Freight may have originated. At
                                        present, this can only be "Warehouse".
                                      enum:
                                      - Warehouse
                                      type: string
                                    name:
                                      description: |-
                                        Name is the name of the resource of the kind indicated by the Kind field
                                        from which Freight may originated.
                                      type: string
                                  required:
                                  - kind
                                  - name
                                  type: object
                              type: object
                            description: |-
                              Freight is a map of FreightReference objects, indexed by their Warehouse
                              origin.
                            type: object
                          verificationHistory:
                            description: |-
                              VerificationHistory is a stack of recent VerificationInfo. By default,
                              the last ten VerificationInfo are stored.
                            items:
                              description: |-
                                VerificationInfo contains the details of an instance of a Verification
                                process.
                              properties:
                                actor:
                                  description: |-
                                    Actor is the name of the entity that initiated or aborted the
                                    Verification process.
                                  type: string
                                analysisRun:
                                  description: |-
                                    AnalysisRun is a reference to the Argo Rollouts AnalysisRun that implements
                                    the Verification process.
                                  properties:
                                    name:
                                      description: Name is the name of the AnalysisRun.
                                      type: string
                                    namespace:
                                      description: Namespace is the namespace of the
                                        AnalysisRun.
                                      type: string
                                    phase:
                                      description: Phase is the last observed phase
                                        of the AnalysisRun referenced by Name.
                                      type: string
                                  required:
                                  - name
                                  - namespace
                                  - phase
                                  type: object
                                finishTime:
                                  description: FinishTime is the time at which the
                                    Verification process finished.
                                  format: date-time
                                  type: string
                                id:
                                  description: ID is the identifier of the Verification
                                    process.
                                  type: string
                                message:
                                  description: |-
                                    Message may contain additional information about why the verification
                                    process is in its current phase.
                                  type: string
                                phase:
                                  description: |-
                                    Phase describes the current phase of the Verification process. Generally,
                                    this will be a reflection of the underlying AnalysisRun's phase, however,
                                    there are exceptions to this, such as in the case where an AnalysisRun
                                    cannot be launched successfully.
                                  type: string
                                startTime:
                                  description: StartTime is the time at which the
                                    Verification process was started.
                                  format: date-time
                                  type: string
                              type: object
                            type: array
                        required:
                        - id
                        type: object
                      healthChecks:
                        description: |-
                          HealthChecks contains the health check directives to be executed after
                          the Promotion has completed.
                        items:
                          description: |-
                            HealthCheckStep describes a health check directive which can be executed by
                            a Stage to verify the health of a Promotion result.
                          properties:
                            config:
                              description: Config is the configuration for the directive.
                              x-kubernetes-preserve-unknown-fields: true
                            uses:
                              description: Uses identifies a runner that can execute
                                this step.
                              minLength: 1
                              type: string
                          required:
                          - uses
                          type: object
                        type: array
                      lastHandledRefresh:
                        description: |-
                          LastHandledRefresh holds the value of the most recent AnnotationKeyRefresh
                          annotation that was handled by the controller. This field can be used to
                          determine whether the request to refresh the resource has been handled.
                        type: string
                      message:
                        description: |-
                          Message is a display message about the promotion, including any errors
                          preventing the Promotion controller from executing this Promotion.
                          i.e. If the Phase field has a value of Failed, this field can be expected
                          to explain why.
                        type: string
                      phase:
                        description: Phase describes where the Promotion currently
                          is in its lifecycle.
                        type: string
                      state:
                        description: |-
                          State stores the state of the promotion process between reconciliation
                          attempts.
                        x-kubernetes-preserve-unknown-fields: true
                    type: object
                required:
                - name
                type: object
              freightHistory:
                description: |-
                  FreightHistory is a list of recent Freight selections that were deployed
                  to the Stage. By default, the last ten Freight selections are stored.
                  The first item in the list is the most recent Freight selection and
                  currently deployed to the Stage, subsequent items are older selections.
                items:
                  description: |-
                    FreightCollection is a collection of FreightReferences, each of which
                    represents a piece of Freight that has been selected for deployment to a
                    Stage.
                  properties:
                    id:
                      description: |-
                        ID is a unique and deterministically calculated identifier for the
                        FreightCollection. It is updated on each use of the UpdateOrPush method.
                      type: string
                    items:
                      additionalProperties:
                        description: |-
                          FreightReference is a simplified representation of a piece of Freight -- not
                          a root resource type.
                        properties:
                          charts:
                            description: Charts describes specific versions of specific
                              Helm charts.
                            items:
                              description: Chart describes a specific version of a
                                Helm chart.
                              properties:
                                name:
                                  description: Name specifies the name of the chart.
                                  type: string
                                repoURL:
                                  description: |-
                                    RepoURL specifies the URL of a Helm chart repository. Classic chart
                                    repositories (using HTTP/S) can contain differently named charts. When this
                                    field points to such a repository, the Name field will specify the name of
                                    the chart within the repository. In the case of a repository within an OCI
                                    registry, the URL implicitly points to a specific chart and the Name field
                                    will be empty.
                                  type: string
                                version:
                                  description: Version specifies a particular version
                                    of the chart.
                                  type: string
                              type: object
                            type: array
                          commits:
                            description: Commits describes specific Git repository
                              commits.
                            items:
                              description: GitCommit describes a specific commit from
                                a specific Git repository.
                              properties:
                                author:
                                  description: Author is the author of the commit.
                                  type: string
                                branch:
                                  description: Branch denotes the branch of the repository
                                    where this commit was found.
                                  type: string
                                committer:
                                  description: Committer is the person who committed
                                    the commit.
                                  type: string
                                id:
                                  description: |-
                                    ID is the ID of a specific commit in the Git repository specified by
                                    RepoURL.
                                  type: string
                                message:
                                  description: |-
                                    Message is the message associated with the commit. At present, this only
                                    contains the first line (subject) of the commit message.
                                  type: string
                                repoURL:
                                  description: RepoURL is the URL of a Git repository.
                                  type: string
                                tag:
                                  description: |-
                                    Tag denotes a tag in the repository that matched selection criteria and
                                    resolved to this commit.
                                  type: string
                              type: object
                            type: array
                          images:
                            description: Images describes specific versions of specific
                              container images.
                            items:
                              description: Image describes a specific version of a
                                container image.
                              properties:
                                digest:
                                  description: |-
                                    Digest identifies a specific version of the image in the repository
                                    specified by RepoURL. This is a more precise identifier than Tag.
                                  type: string
                                gitRepoURL:
                                  description: |-
                                    GitRepoURL specifies the URL of a Git repository that contains the source
                                    code for the image repository referenced by the RepoURL field if Kargo was
                                    able to infer it.
                                  type: string
                                repoURL:
                                  description: RepoURL describes the repository in
                                    which the image can be found.
                                  type: string
                                tag:
                                  description: |-
                                    Tag identifies a specific version of the image in the repository specified
                                    by RepoURL.
                                  type: string
                              type: object
                            type: array
                          name:
                            description: |-
                              Name is system-assigned identifier that is derived deterministically from
                              the contents of the Freight. i.e. Two pieces of Freight can be compared for
                              equality by comparing their Names.
                            type: string
                          origin:
                            description: Origin describes a kind of Freight in terms
                              of its origin.
                            properties:
                              kind:
                                description: |-
                                  Kind is the kind of resource from which Freight may have originated. At
                                  present, this can only be "Warehouse".
                                enum:
                                - Warehouse
                                type: string
                              name:
                                description: |-
                                  Name is the name of the resource of the kind indicated by the Kind field
                                  from which Freight may originated.
                                type: string
                            required:
                            - kind
                            - name
                            type: object
                        type: object
                      description: |-
                        Freight is a map of FreightReference objects, indexed by their Warehouse
                        origin.
                      type: object
                    verificationHistory:
                      description: |-
                        VerificationHistory is a stack of recent VerificationInfo. By default,
                        the last ten VerificationInfo are stored.
                      items:
                        description: |-
                          VerificationInfo contains the details of an instance of a Verification
                          process.
                        properties:
                          actor:
                            description: |-
                              Actor is the name of the entity that initiated or aborted the
                              Verification process.
                            type: string
                          analysisRun:
                            description: |-
                              AnalysisRun is a reference to the Argo Rollouts AnalysisRun that implements
                              the Verification process.
                            properties:
                              name:
                                description: Name is the name of the AnalysisRun.
                                type: string
                              namespace:
                                description: Namespace is the namespace of the AnalysisRun.
                                type: string
                              phase:
                                description: Phase is the last observed phase of the
                                  AnalysisRun referenced by Name.
                                type: string
                            required:
                            - name
                            - namespace
                            - phase
                            type: object
                          finishTime:
                            description: FinishTime is the time at which the Verification
                              process finished.
                            format: date-time
                            type: string
                          id:
                            description: ID is the identifier of the Verification
                              process.
                            type: string
                          message:
                            description: |-
                              Message may contain additional information about why the verification
                              process is in its current phase.
                            type: string
                          phase:
                            description: |-
                              Phase describes the current phase of the Verification process. Generally,
                              this will be a reflection of the underlying AnalysisRun's phase, however,
                              there are exceptions to this, such as in the case where an AnalysisRun
                              cannot be launched successfully.
                            type: string
                          startTime:
                            description: StartTime is the time at which the Verification
                              process was started.
                            format: date-time
                            type: string
                        type: object
                      type: array
                  required:
                  - id
                  type: object
                type: array
              freightSummary:
                description: |-
                  FreightSummary is human-readable text maintained by the controller that
                  summarizes what Freight is currently deployed to the Stage. For Stages that
                  request a single piece of Freight AND the request has been fulfilled, this
                  field will simply contain the name of the Freight. For Stages that request
                  a single piece of Freight AND the request has NOT been fulfilled, or for
                  Stages that request multiple pieces of Freight, this field will contain a
                  summary of fulfilled/requested Freight. The existence of this field is a
                  workaround for kubectl limitations so that this complex but valuable
                  information can be displayed in a column in response to `kubectl get
                  stages`.
                type: string
              health:
                description: Health is the Stage's last observed health.
                properties:
                  argoCDApps:
                    description: ArgoCDApps describes the current state of any related
                      ArgoCD Applications.
                    items:
                      description: ArgoCDAppStatus describes the current state of
                        a single ArgoCD Application.
                      properties:
                        healthStatus:
                          description: HealthStatus is the health of the ArgoCD Application.
                          properties:
                            message:
                              type: string
                            status:
                              type: string
                          required:
                          - status
                          type: object
                        name:
                          description: Name is the name of the ArgoCD Application.
                          type: string
                        namespace:
                          description: Namespace is the namespace of the ArgoCD Application.
                          type: string
                        syncStatus:
                          description: SyncStatus is the sync status of the ArgoCD
                            Application.
                          properties:
                            revision:
                              type: string
                            revisions:
                              items:
                                type: string
                              type: array
                            status:
                              type: string
                          required:
                          - status
                          type: object
                      required:
                      - name
                      - namespace
                      type: object
                    type: array
                  config:
                    description: |-
                      Config is the opaque configuration of all health checks performed on this
                      Stage.
                    x-kubernetes-preserve-unknown-fields: true
                  issues:
                    description: |-
                      Issues clarifies why a Stage in any state other than Healthy is in that
                      state. This field will always be the empty when a Stage is Healthy.
                    items:
                      type: string
                    type: array
                  output:
                    description: Output is the opaque output of all health checks
                      performed on this Stage.
                    x-kubernetes-preserve-unknown-fields: true
                  status:
                    description: Status describes the health of the Stage.
                    type: string
                type: object
              lastHandledRefresh:
                description: |-
                  LastHandledRefresh holds the value of the most recent AnnotationKeyRefresh
                  annotation that was handled by the controller. This field can be used to
                  determine whether the request to refresh the resource has been handled.
                type: string
              lastPromotion:
                description: LastPromotion is a reference to the last completed promotion.
                properties:
                  finishedAt:
                    description: FinishedAt is the time at which the Promotion was
                      completed.
                    format: date-time
                    type: string
                  freight:
                    description: Freight is the freight being promoted.
                    properties:
                      charts:
                        description: Charts describes specific versions of specific
                          Helm charts.
                        items:
                          description: Chart describes a specific version of a Helm
                            chart.
                          properties:
                            name:
                              description: Name specifies the name of the chart.
                              type: string
                            repoURL:
                              description: |-
                                RepoURL specifies the URL of a Helm chart repository. Classic chart
                                repositories (using HTTP/S) can contain differently named charts. When this
                                field points to such a repository, the Name field will specify the name of
                                the chart within the repository. In the case of a repository within an OCI
                                registry, the URL implicitly points to a specific chart and the Name field
                                will be empty.
                              type: string
                            version:
                              description: Version specifies a particular version
                                of the chart.
                              type: string
                          type: object
                        type: array
                      commits:
                        description: Commits describes specific Git repository commits.
                        items:
                          description: GitCommit describes a specific commit from
                            a specific Git repository.
                          properties:
                            author:
                              description: Author is the author of the commit.
                              type: string
                            branch:
                              description: Branch denotes the branch of the repository
                                where this commit was found.
                              type: string
                            committer:
                              description: Committer is the person who committed the
                                commit.
                              type: string
                            id:
                              description: |-
                                ID is the ID of a specific commit in the Git repository specified by
                                RepoURL.
                              type: string
                            message:
                              description: |-
                                Message is the message associated with the commit. At present, this only
                                contains the first line (subject) of the commit message.
                              type: string
                            repoURL:
                              description: RepoURL is the URL of a Git repository.
                              type: string
                            tag:
                              description: |-
                                Tag denotes a tag in the repository that matched selection criteria and
                                resolved to this commit.
                              type: string
                          type: object
                        type: array
                      images:
                        description: Images describes specific versions of specific
                          container images.
                        items:
                          description: Image describes a specific version of a container
                            image.
                          properties:
                            digest:
                              description: |-
                                Digest identifies a specific version of the image in the repository
                                specified by RepoURL. This is a more precise identifier than Tag.
                              type: string
                            gitRepoURL:
                              description: |-
                                GitRepoURL specifies the URL of a Git repository that contains the source
                                code for the image repository referenced by the RepoURL field if Kargo was
                                able to infer it.
                              type: string
                            repoURL:
                              description: RepoURL describes the repository in which
                                the image can be found.
                              type: string
                            tag:
                              description: |-
                                Tag identifies a specific version of the image in the repository specified
                                by RepoURL.
                              type: string
                          type: object
                        type: array
                      name:
                        description: |-
                          Name is system-assigned identifier that is derived deterministically from
                          the contents of the Freight. i.e. Two pieces of Freight can be compared for
                          equality by comparing their Names.
                        type: string
                      origin:
                        description: Origin describes a kind of Freight in terms of
                          its origin.
                        properties:
                          kind:
                            description: |-
                              Kind is the kind of resource from which Freight may have originated. At
                              present, this can only be "Warehouse".
                            enum:
                            - Warehouse
                            type: string
                          name:
                            description: |-
                              Name is the name of the resource of the kind indicated by the Kind field
                              from which Freight may originated.
                            type: string
                        required:
                        - kind
                        - name
                        type: object
                    type: object
                  name:
                    description: Name is the name of the Promotion.
                    type: string
                  status:
                    description: Status is the (optional) status of the Promotion.
                    properties:
                      currentStep:
                        description: |-
                          CurrentStep is the index of the current promotion step being executed. This
                          permits steps that have already run successfully to be skipped on
                          subsequent reconciliations attempts.
                        format: int64
                        type: integer
                      currentStepAttempt:
                        description: |-
                          CurrentStepAttempt is the number of times the current step has been
                          attempted.
                        format: int64
                        type: integer
                      finishedAt:
                        description: FinishedAt is the time when the promotion was
                          completed.
                        format: date-time
                        type: string
                      freight:
                        description: Freight is the detail of the piece of freight
                          that was referenced by this promotion.
                        properties:
                          charts:
                            description: Charts describes specific versions of specific
                              Helm charts.
                            items:
                              description: Chart describes a specific version of a
                                Helm chart.
                              properties:
                                name:
                                  description: Name specifies the name of the chart.
                                  type: string
                                repoURL:
                                  description: |-
                                    RepoURL specifies the URL of a Helm chart repository. Classic chart
                                    repositories (using HTTP/S) can contain differently named charts. When this
                                    field points to such a repository, the Name field will specify the name of
                                    the chart within the repository. In the case of a repository within an OCI
                                    registry, the URL implicitly points to a specific chart and the Name field
                                    will be empty.
                                  type: string
                                version:
                                  description: Version specifies a particular version
                                    of the chart.
                                  type: string
                              type: object
                            type: array
                          commits:
                            description: Commits describes specific Git repository
                              commits.
                            items:
                              description: GitCommit describes a specific commit from
                                a specific Git repository.
                              properties:
                                author:
                                  description: Author is the author of the commit.
                                  type: string
                                branch:
                                  description: Branch denotes the branch of the repository
                                    where this commit was found.
                                  type: string
                                committer:
                                  description: Committer is the person who committed
                                    the commit.
                                  type: string
                                id:
                                  description: |-
                                    ID is the ID of a specific commit in the Git repository specified by
                                    RepoURL.
                                  type: string
                                message:
                                  description: |-
                                    Message is the message associated with the commit. At present, this only
                                    contains the first line (subject) of the commit message.
                                  type: string
                                repoURL:
                                  description: RepoURL is the URL of a Git repository.
                                  type: string
                                tag:
                                  description: |-
                                    Tag denotes a tag in the repository that matched selection criteria and
                                    resolved to this commit.
                                  type: string
                              type: object
                            type: array
                          images:
                            description: Images describes specific versions of specific
                              container images.
                            items:
                              description: Image describes a specific version of a
                                container image.
                              properties:
                                digest:
                                  description: |-
                                    Digest identifies a specific version of the image in the repository
                                    specified by RepoURL. This is a more precise identifier than Tag.
                                  type: string
                                gitRepoURL:
                                  description: |-
                                    GitRepoURL specifies the URL of a Git repository that contains the source
                                    code for the image repository referenced by the RepoURL field if Kargo was
                                    able to infer it.
                                  type: string
                                repoURL:
                                  description: RepoURL describes the repository in
                                    which the image can be found.
                                  type: string
                                tag:
                                  description: |-
                                    Tag identifies a specific version of the image in the repository specified
                                    by RepoURL.
                                  type: string
                              type: object
                            type: array
                          name:
                            description: |-
                              Name is system-assigned identifier that is derived deterministically from
                              the contents of the Freight. i.e. Two pieces of Freight can be compared for
                              equality by comparing their Names.
                            type: string
                          origin:
                            description: Origin describes a kind of Freight in terms
                              of its origin.
                            properties:
                              kind:
                                description: |-
                                  Kind is the kind of resource from which Freight may have originated. At
                                  present, this can only be "Warehouse".
                                enum:
                                - Warehouse
                                type: string
                              name:
                                description: |-
                                  Name is the name of the resource of the kind indicated by the Kind field
                                  from which Freight may originated.
                                type: string
                            required:
                            - kind
                            - name
                            type: object
                        type: object
                      freightCollection:
                        description: |-
                          FreightCollection contains the details of the piece of Freight referenced
                          by this Promotion as well as any additional Freight that is carried over
                          from the target Stage's current state.
                        properties:
                          id:
                            description: |-
                              ID is a unique and deterministically calculated identifier for the
                              FreightCollection. It is updated on each use of the UpdateOrPush method.
                            type: string
                          items:
                            additionalProperties:
                              description: |-
                                FreightReference is a simplified representation of a piece of Freight -- not
                                a root resource type.
                              properties:
                                charts:
                                  description: Charts describes specific versions
                                    of specific Helm charts.
                                  items:
                                    description: Chart describes a specific version
                                      of a Helm chart.
                                    properties:
                                      name:
                                        description: Name specifies the name of the
                                          chart.
                                        type: string
                                      repoURL:
                                        description: |-
                                          RepoURL specifies the URL of a Helm chart repository. Classic chart
                                          repositories (using HTTP/S) can contain differently named charts. When this
                                          field points to such a repository, the Name field will specify the name of
                                          the chart within the repository. In the case of a repository within an OCI
                                          registry, the URL implicitly points to a specific chart and the Name field
                                          will be empty.
                                        type: string
                                      version:
                                        description: Version specifies a particular
                                          version of the chart.
                                        type: string
                                    type: object
                                  type: array
                                commits:
                                  description: Commits describes specific Git repository
                                    commits.
                                  items:
                                    description: GitCommit describes a specific commit
                                      from a specific Git repository.
                                    properties:
                                      author:
                                        description: Author is the author of the commit.
                                        type: string
                                      branch:
                                        description: Branch denotes the branch of
                                          the repository where this commit was found.
                                        type: string
                                      committer:
                                        description: Committer is the person who committed
                                          the commit.
                                        type: string
                                      id:
                                        description: |-
                                          ID is the ID of a specific commit in the Git repository specified by
                                          RepoURL.
                                        type: string
                                      message:
                                        description: |-
                                          Message is the message associated with the commit. At present, this only
                                          contains the first line (subject) of the commit message.
                                        type: string
                                      repoURL:
                                        description: RepoURL is the URL of a Git repository.
                                        type: string
                                      tag:
                                        description: |-
                                          Tag denotes a tag in the repository that matched selection criteria and
                                          resolved to this commit.
                                        type: string
                                    type: object
                                  type: array
                                images:
                                  description: Images describes specific versions
                                    of specific container images.
                                  items:
                                    description: Image describes a specific version
                                      of a container image.
                                    properties:
                                      digest:
                                        description: |-
                                          Digest identifies a specific version of the image in the repository
                                          specified by RepoURL. This is a more precise identifier than Tag.
                                        type: string
                                      gitRepoURL:
                                        description: |-
                                          GitRepoURL specifies the URL of a Git repository that contains the source
                                          code for the image repository referenced by the RepoURL field if Kargo was
                                          able to infer it.
                                        type: string
                                      repoURL:
                                        description: RepoURL describes the repository
                                          in which the image can be found.
                                        type: string
                                      tag:
                                        description: |-
                                          Tag identifies a specific version of the image in the repository specified
                                          by RepoURL.
                                        type: string
                                    type: object
                                  type: array
                                name:
                                  description: |-
                                    Name is system-assigned identifier that is derived deterministically from
                                    the contents of the Freight. i.e. Two pieces of Freight can be compared for
                                    equality by comparing their Names.
                                  type: string
                                origin:
                                  description: Origin describes a kind of Freight
                                    in terms of its origin.
                                  properties:
                                    kind:
                                      description: |-
                                        Kind is the kind of resource from which Freight may have originated. At
                                        present, this can only be "Warehouse".
                                      enum:
                                      - Warehouse
                                      type: string
                                    name:
                                      description: |-
                                        Name is the name of the resource of the kind indicated by the Kind field
                                        from which Freight may originated.
                                      type: string
                                  required:
                                  - kind
                                  - name
                                  type: object
                              type: object
                            description: |-
                              Freight is a map of FreightReference objects, indexed by their Warehouse
                              origin.
                            type: object
                          verificationHistory:
                            description: |-
                              VerificationHistory is a stack of recent VerificationInfo. By default,
                              the last ten VerificationInfo are stored.
                            items:
                              description: |-
                                VerificationInfo contains the details of an instance of a Verification
                                process.
                              properties:
                                actor:
                                  description: |-
                                    Actor is the name of the entity that initiated or aborted the
                                    Verification process.
                                  type: string
                                analysisRun:
                                  description: |-
                                    AnalysisRun is a reference to the Argo Rollouts AnalysisRun that implements
                                    the Verification process.
                                  properties:
                                    name:
                                      description: Name is the name of the AnalysisRun.
                                      type: string
                                    namespace:
                                      description: Namespace is the namespace of the
                                        AnalysisRun.
                                      type: string
                                    phase:
                                      description: Phase is the last observed phase
                                        of the AnalysisRun referenced by Name.
                                      type: string
                                  required:
                                  - name
                                  - namespace
                                  - phase
                                  type: object
                                finishTime:
                                  description: FinishTime is the time at which the
                                    Verification process finished.
                                  format: date-time
                                  type: string
                                id:
                                  description: ID is the identifier of the Verification
                                    process.
                                  type: string
                                message:
                                  description: |-
                                    Message may contain additional information about why the verification
                                    process is in its current phase.
                                  type: string
                                phase:
                                  description: |-
                                    Phase describes the current phase of the Verification process. Generally,
                                    this will be a reflection of the underlying AnalysisRun's phase, however,
                                    there are exceptions to this, such as in the case where an AnalysisRun
                                    cannot be launched successfully.
                                  type: string
                                startTime:
                                  description: StartTime is the time at which the
                                    Verification process was started.
                                  format: date-time
                                  type: string
                              type: object
                            type: array
                        required:
                        - id
                        type: object
                      healthChecks:
                        description: |-
                          HealthChecks contains the health check directives to be executed after
                          the Promotion has completed.
                        items:
                          description: |-
                            HealthCheckStep describes a health check directive which can be executed by
                            a Stage to verify the health of a Promotion result.
                          properties:
                            config:
                              description: Config is the configuration for the directive.
                              x-kubernetes-preserve-unknown-fields: true
                            uses:
                              description: Uses identifies a runner that can execute
                                this step.
                              minLength: 1
                              type: string
                          required:
                          - uses
                          type: object
                        type: array
                      lastHandledRefresh:
                        description: |-
                          LastHandledRefresh holds the value of the most recent AnnotationKeyRefresh
                          annotation that was handled by the controller. This field can be used to
                          determine whether the request to refresh the resource has been handled.
                        type: string
                      message:
                        description: |-
                          Message is a display message about the promotion, including any errors
                          preventing the Promotion controller from executing this Promotion.
                          i.e. If the Phase field has a value of Failed, this field can be expected
                          to explain why.
                        type: string
                      phase:
                        description: Phase describes where the Promotion currently
                          is in its lifecycle.
                        type: string
                      state:
                        description: |-
                          State stores the state of the promotion process between reconciliation
                          attempts.
                        x-kubernetes-preserve-unknown-fields: true
                    type: object
                required:
                - name
                type: object
              message:
                description: |-
                  Message describes any errors that are preventing the Stage controller
                  from assessing Stage health or from finding new Freight.
                type: string
              observedGeneration:
                description: |-
                  ObservedGeneration represents the .metadata.generation that this Stage
                  status was reconciled against.
                format: int64
                type: integer
              phase:
                description: Phase describes where the Stage currently is in its lifecycle.
                type: string
            type: object
        required:
        - spec
        type: object
    served: true
    storage: true
    subresources:
      status: {}
