mirror of
https://github.com/kubevela/kubevela.git
synced 2026-02-14 18:10:21 +00:00
Feat: provide stage field for TraitDefinition (#4570)
* Feat: provide stage field for TraitDefinition Signed-off-by: ZhongsJie <zhongsjie@gmail.com> * Feat: Refactor the collect health status fn Signed-off-by: ZhongsJie <zhongsjie@gmail.com> Signed-off-by: ZhongsJie <zhongsjie@gmail.com>
This commit is contained in:
@@ -249,6 +249,12 @@ type ApplicationComponentStatus struct {
|
||||
Scopes []corev1.ObjectReference `json:"scopes,omitempty"`
|
||||
}
|
||||
|
||||
// Equal check if two ApplicationComponentStatus are equal
|
||||
func (in ApplicationComponentStatus) Equal(r ApplicationComponentStatus) bool {
|
||||
return in.Name == r.Name && in.Namespace == r.Namespace &&
|
||||
in.Cluster == r.Cluster && in.Env == r.Env
|
||||
}
|
||||
|
||||
// ApplicationTraitStatus records the trait health status
|
||||
type ApplicationTraitStatus struct {
|
||||
Type string `json:"type"`
|
||||
|
||||
@@ -158,8 +158,29 @@ type TraitDefinitionSpec struct {
|
||||
// ControlPlaneOnly defines which cluster is dispatched to
|
||||
// +optional
|
||||
ControlPlaneOnly bool `json:"controlPlaneOnly,omitempty"`
|
||||
|
||||
// Stage defines the stage information to which this trait resource processing belongs.
|
||||
// Currently, PreDispatch and PostDispatch are provided, which are used to control resource
|
||||
// pre-process and post-process respectively.
|
||||
// +optional
|
||||
Stage StageType `json:"stage,omitempty"`
|
||||
}
|
||||
|
||||
// StageType describes how the manifests should be dispatched.
|
||||
// Only one of the following stage types may be specified.
|
||||
// If none of the following types is specified, the default one
|
||||
// is DefaultDispatch.
|
||||
type StageType string
|
||||
|
||||
const (
|
||||
// PreDispatch means that pre dispatch for manifests
|
||||
PreDispatch StageType = "PreDispatch"
|
||||
// DefaultDispatch means that default dispatch for manifests
|
||||
DefaultDispatch StageType = "DefaultDispatch"
|
||||
// PostDispatch means that post dispatch for manifests
|
||||
PostDispatch StageType = "PostDispatch"
|
||||
)
|
||||
|
||||
// TraitDefinitionStatus is the status of TraitDefinition
|
||||
type TraitDefinitionStatus struct {
|
||||
// ConditionedStatus reflects the observed status of a resource
|
||||
|
||||
Reference in New Issue
Block a user