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 TargetWithStatus field to DependOn struct for job creation based on specific status #152

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
12 changes: 12 additions & 0 deletions pkg/apis/flow/v1alpha1/jobflow_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@ type DependsOn struct {
Targets []string `json:"targets,omitempty"`
// +optional
Probe *Probe `json:"probe,omitempty"`
// +optional
TargetsWithStatus []Target `json:"targetsWithStatus,omitempty"`
}

type Target struct {
// +kubebuilder:validation:MinLength=1
// +required
Name string `json:"name,omitempty"`
// +optional
Phase v1alpha1.JobPhase `json:"phase,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add more target states. Such as, liveness probe.
Just an open discussion, this maybe an over-design

}

type Probe struct {
Expand Down Expand Up @@ -113,6 +123,8 @@ type JobFlowStatus struct {
Conditions map[string]Condition `json:"conditions,omitempty"`
// +optional
State State `json:"state,omitempty"`
// +optional
FlowStatusMap map[string]v1alpha1.JobPhase `json:"flowStatusMap,omitempty"`
}

type JobStatus struct {
Expand Down
28 changes: 28 additions & 0 deletions pkg/apis/flow/v1alpha1/zz_generated.deepcopy.go

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

18 changes: 16 additions & 2 deletions pkg/client/applyconfiguration/flow/v1alpha1/dependson.go

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

19 changes: 19 additions & 0 deletions pkg/client/applyconfiguration/flow/v1alpha1/jobflowstatus.go

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

51 changes: 51 additions & 0 deletions pkg/client/applyconfiguration/flow/v1alpha1/target.go

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

2 changes: 2 additions & 0 deletions pkg/client/applyconfiguration/utils.go

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