Skip to content

Commit

Permalink
add PromotedFreight
Browse files Browse the repository at this point in the history
Signed-off-by: Nguyen Duy Phuong <knowledge.phuongnguyen@gmail.com>
  • Loading branch information
phuongdnguyen committed Apr 2, 2024
1 parent 46bf153 commit 868d68f
Show file tree
Hide file tree
Showing 8 changed files with 573 additions and 596 deletions.
462 changes: 228 additions & 234 deletions api/v1alpha1/generated.pb.go

Large diffs are not rendered by default.

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

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

5 changes: 2 additions & 3 deletions api/v1alpha1/promotion_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,8 @@ type PromotionStatus struct {
// 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"`
// History is a stack of recent Freight. By default, the last ten Freight are
// stored.
History FreightReferenceStack `json:"history,omitempty" protobuf:"bytes,4,rep,name=history"`
// PromotedFreight is the detail of the piece of freight that was promoted.
PromotedFreight *FreightReference `json:"promotedFreight,omitempty" protobuf:"bytes,4,opt,name=promotedFreight"`
}

// WithPhase returns a copy of PromotionStatus with the given phase
Expand Down
10 changes: 4 additions & 6 deletions api/v1alpha1/zz_generated.deepcopy.go

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

366 changes: 179 additions & 187 deletions charts/kargo/resources/crds/kargo.akuity.io_promotions.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion internal/controller/promotions/promotions.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ func (r *reconciler) promote(
err,
)
}
newStatus.History.UpdateOrPush(nextFreight)
newStatus.PromotedFreight = &nextFreight
}

return newStatus, nil
Expand Down
310 changes: 153 additions & 157 deletions ui/src/gen/schema/promotions.kargo.akuity.io_v1alpha1.json

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions ui/src/gen/v1alpha1/generated_pb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2866,12 +2866,11 @@ export class PromotionStatus extends Message<PromotionStatus> {
metadata: { [key: string]: string } = {};

/**
* History is a stack of recent Freight. By default, the last ten Freight are
* stored.
* PromotedFreight is the detail of the piece of freight that was promoted.
*
* @generated from field: repeated git.luolix.top.akuity.kargo.api.v1alpha1.FreightReference history = 4;
* @generated from field: optional git.luolix.top.akuity.kargo.api.v1alpha1.FreightReference promotedFreight = 4;
*/
history: FreightReference[] = [];
promotedFreight?: FreightReference;

constructor(data?: PartialMessage<PromotionStatus>) {
super();
Expand All @@ -2884,7 +2883,7 @@ export class PromotionStatus extends Message<PromotionStatus> {
{ no: 1, name: "phase", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
{ no: 2, name: "message", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
{ no: 3, name: "metadata", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 9 /* ScalarType.STRING */} },
{ no: 4, name: "history", kind: "message", T: FreightReference, repeated: true },
{ no: 4, name: "promotedFreight", kind: "message", T: FreightReference, opt: true },
]);

static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): PromotionStatus {
Expand Down

0 comments on commit 868d68f

Please sign in to comment.