forked from akuity/kargo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: (cluster) Promotion tasks (akuity#3121)
Signed-off-by: Hidde Beydals <[email protected]> Co-authored-by: Mayursinh Sarvaiya <[email protected]>
- Loading branch information
1 parent
2b5bf7d
commit c8efb84
Showing
48 changed files
with
5,333 additions
and
487 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package v1alpha1 | ||
|
||
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
|
||
// +kubebuilder:resource:scope=Cluster,shortName={clusterpromotask,clusterpromotasks} | ||
// +kubebuilder:object:root=true | ||
// +kubebuilder:printcolumn:name=Age,type=date,JSONPath=`.metadata.creationTimestamp` | ||
|
||
type ClusterPromotionTask struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` | ||
|
||
// Spec describes the desired transition of a specific Stage into a specific | ||
// Freight. | ||
// | ||
// +kubebuilder:validation:Required | ||
Spec PromotionTaskSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"` | ||
} | ||
|
||
// +kubebuilder:object:root=true | ||
|
||
// ClusterPromotionTaskList contains a list of PromotionTasks. | ||
type ClusterPromotionTaskList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` | ||
Items []ClusterPromotionTask `json:"items" protobuf:"bytes,2,rep,name=items"` | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package v1alpha1 | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// +kubebuilder:resource:shortName={promotask,promotasks} | ||
// +kubebuilder:object:root=true | ||
// +kubebuilder:printcolumn:name=Age,type=date,JSONPath=`.metadata.creationTimestamp` | ||
|
||
type PromotionTask struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` | ||
|
||
// Spec describes the composition of a PromotionTask, including the | ||
// variables available to the task and the steps. | ||
// | ||
// +kubebuilder:validation:Required | ||
Spec PromotionTaskSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"` | ||
} | ||
|
||
type PromotionTaskSpec struct { | ||
// Vars specifies the variables available to the PromotionTask. The | ||
// values of these variables are the default values that can be | ||
// overridden by the step referencing the task. | ||
Vars []PromotionVariable `json:"vars,omitempty" protobuf:"bytes,1,rep,name=vars"` | ||
// Steps specifies the directives to be executed as part of this | ||
// PromotionTask. The steps as defined here are inflated into a | ||
// Promotion when it is built from a PromotionTemplate. | ||
// | ||
// +kubebuilder:validation:Required | ||
// +kubebuilder:validation:MinItems=1 | ||
// +kubebuilder:validation:items:XValidation:message="PromotionTask step must have uses set and must not reference another task",rule="has(self.uses) && !has(self.task)" | ||
Steps []PromotionStep `json:"steps" protobuf:"bytes,2,rep,name=steps"` | ||
} | ||
|
||
// +kubebuilder:object:root=true | ||
|
||
// PromotionTaskList contains a list of PromotionTasks. | ||
type PromotionTaskList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` | ||
Items []PromotionTask `json:"items" protobuf:"bytes,2,rep,name=items"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.