Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add Freight to PromotionStatus #1721

Merged
merged 5 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
236 changes: 145 additions & 91 deletions api/v1alpha1/generated.pb.go

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions api/v1alpha1/generated.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions api/v1alpha1/promotion_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@
// Metadata holds arbitrary metadata set by promotion mechanisms
// (e.g. for display purposes, or internal bookkeeping)
Metadata map[string]string `json:"metadata,omitempty" protobuf:"bytes,3,rep,name=metadata" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
// Freight is the detail of the piece of freight that was referenced by this promotion.
Freight *FreightReference `json:"freight,omitempty" protobuf:"bytes,5,opt,name=freight"`
}

// WithPhase returns a copy of PromotionStatus with the given phase
Expand All @@ -110,6 +112,13 @@
return status
}

// WithFreight returns a copy of PromotionStatus with the given freight
func (p *PromotionStatus) WithFreight(freight *FreightReference) *PromotionStatus {
status := p.DeepCopy()
status.Freight = freight
return status

Check warning on line 119 in api/v1alpha1/promotion_types.go

View check run for this annotation

Codecov / codecov/patch

api/v1alpha1/promotion_types.go#L116-L119

Added lines #L116 - L119 were not covered by tests
}

// +kubebuilder:object:root=true

// PromotionList contains a list of Promotion
Expand Down
5 changes: 5 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

226 changes: 226 additions & 0 deletions charts/kargo/resources/crds/kargo.akuity.io_promotions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,232 @@ spec:
Status describes the current state of the transition represented by this
Promotion.
properties:
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 git commit author
type: string
branch:
description: Branch denotes the branch of the repository
where this commit was found.
type: string
healthCheckCommit:
description: |-
HealthCheckCommit is the ID of a specific commit. When specified,
assessments of Stage health will used this value (instead of ID) when
determining if applicable sources of Argo CD Application resources
associated with the Stage are or are not synced to this commit. Note that
there are cases (as in that of Kargo Render being utilized as a promotion
mechanism) wherein the value of this field may differ from the commit ID
found in the ID field.
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 git 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
verificationHistory:
description: |-
VerificationHistory is a stack of recent VerificationInfo. By default,
the last ten VerificationInfo are stored.
items:
description: |-
VerificationInfo contains information about the currently running
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
verificationInfo:
description: |-
VerificationInfo is information about any verification process that was
associated with this Freight for this Stage.
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
warehouse:
description: Warehouse is the name of the Warehouse that created
this Freight.
type: string
type: object
lastHandledRefresh:
description: |-
LastHandledRefresh holds the value of the most recent AnnotationKeyRefresh
Expand Down
Loading
Loading