Merge remote-tracking branch 'upstream/master' into network-topo

This commit is contained in:
Monokaix 2025-01-20 09:44:17 +08:00
commit 098cadb1fa
12 changed files with 142 additions and 69 deletions

20
go.mod
View File

@ -3,11 +3,11 @@ module volcano.sh/apis
go 1.22.0 go 1.22.0
require ( require (
k8s.io/api v0.31.1 k8s.io/api v0.31.3
k8s.io/apimachinery v0.31.1 k8s.io/apimachinery v0.31.3
k8s.io/apiserver v0.31.1 k8s.io/apiserver v0.31.3
k8s.io/client-go v0.31.1 k8s.io/client-go v0.31.3
k8s.io/code-generator v0.31.1 k8s.io/code-generator v0.31.3
k8s.io/klog/v2 v2.130.1 k8s.io/klog/v2 v2.130.1
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 sigs.k8s.io/structured-merge-diff/v4 v4.4.1
@ -57,7 +57,7 @@ require (
gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/component-base v0.31.1 // indirect k8s.io/component-base v0.31.3 // indirect
k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70 // indirect k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70 // indirect
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // indirect k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
@ -65,8 +65,8 @@ require (
) )
replace ( replace (
k8s.io/api => k8s.io/api v0.31.1 k8s.io/api => k8s.io/api v0.31.3
k8s.io/apimachinery => k8s.io/apimachinery v0.31.1 k8s.io/apimachinery => k8s.io/apimachinery v0.31.3
k8s.io/apiserver => k8s.io/apiserver v0.31.1 k8s.io/apiserver => k8s.io/apiserver v0.31.3
k8s.io/client-go => k8s.io/client-go v0.31.1 k8s.io/client-go => k8s.io/client-go v0.31.3
) )

24
go.sum
View File

@ -154,18 +154,18 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
k8s.io/api v0.31.1 h1:Xe1hX/fPW3PXYYv8BlozYqw63ytA92snr96zMW9gWTU= k8s.io/api v0.31.3 h1:umzm5o8lFbdN/hIXbrK9oRpOproJO62CV1zqxXrLgk8=
k8s.io/api v0.31.1/go.mod h1:sbN1g6eY6XVLeqNsZGLnI5FwVseTrZX7Fv3O26rhAaI= k8s.io/api v0.31.3/go.mod h1:UJrkIp9pnMOI9K2nlL6vwpxRzzEX5sWgn8kGQe92kCE=
k8s.io/apimachinery v0.31.1 h1:mhcUBbj7KUjaVhyXILglcVjuS4nYXiwC+KKFBgIVy7U= k8s.io/apimachinery v0.31.3 h1:6l0WhcYgasZ/wk9ktLq5vLaoXJJr5ts6lkaQzgeYPq4=
k8s.io/apimachinery v0.31.1/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= k8s.io/apimachinery v0.31.3/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo=
k8s.io/apiserver v0.31.1 h1:Sars5ejQDCRBY5f7R3QFHdqN3s61nhkpaX8/k1iEw1c= k8s.io/apiserver v0.31.3 h1:+1oHTtCB+OheqFEz375D0IlzHZ5VeQKX1KGXnx+TTuY=
k8s.io/apiserver v0.31.1/go.mod h1:lzDhpeToamVZJmmFlaLwdYZwd7zB+WYRYIboqA1kGxM= k8s.io/apiserver v0.31.3/go.mod h1:PrxVbebxrxQPFhJk4powDISIROkNMKHibTg9lTRQ0Qg=
k8s.io/client-go v0.31.1 h1:f0ugtWSbWpxHR7sjVpQwuvw9a3ZKLXX0u0itkFXufb0= k8s.io/client-go v0.31.3 h1:CAlZuM+PH2cm+86LOBemaJI/lQ5linJ6UFxKX/SoG+4=
k8s.io/client-go v0.31.1/go.mod h1:sKI8871MJN2OyeqRlmA4W4KM9KBdBUpDLu/43eGemCg= k8s.io/client-go v0.31.3/go.mod h1:2CgjPUTpv3fE5dNygAr2NcM8nhHzXvxB8KL5gYc3kJs=
k8s.io/code-generator v0.31.1 h1:GvkRZEP2g2UnB2QKT2Dgc/kYxIkDxCHENv2Q1itioVs= k8s.io/code-generator v0.31.3 h1:Pj0fYOBms+ZrsulLi4DMsCEx1jG8fWKRLy44onHsLBI=
k8s.io/code-generator v0.31.1/go.mod h1:oL2ky46L48osNqqZAeOcWWy0S5BXj50vVdwOtTefqIs= k8s.io/code-generator v0.31.3/go.mod h1:/umCIlT84g1+Yu5ZXtP1KGSRTnGiIzzX5AzUAxsNlts=
k8s.io/component-base v0.31.1 h1:UpOepcrX3rQ3ab5NB6g5iP0tvsgJWzxTyAo20sgYSy8= k8s.io/component-base v0.31.3 h1:DMCXXVx546Rfvhj+3cOm2EUxhS+EyztH423j+8sOwhQ=
k8s.io/component-base v0.31.1/go.mod h1:WGeaw7t/kTsqpVTaCoVEtillbqAhF2/JgvO0LDOMa0w= k8s.io/component-base v0.31.3/go.mod h1:xME6BHfUOafRgT0rGVBGl7TuSg8Z9/deT7qq6w7qjIU=
k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70 h1:NGrVE502P0s0/1hudf8zjgwki1X/TByhmAoILTarmzo= k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70 h1:NGrVE502P0s0/1hudf8zjgwki1X/TByhmAoILTarmzo=
k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8= k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8=
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=

View File

@ -46,7 +46,7 @@ APIS_PKG="$3"
GROUPS_WITH_VERSIONS="$4" GROUPS_WITH_VERSIONS="$4"
shift 4 shift 4
go install k8s.io/code-generator/cmd/{defaulter-gen,client-gen,lister-gen,informer-gen,deepcopy-gen,conversion-gen}@v0.31.1 go install k8s.io/code-generator/cmd/{defaulter-gen,client-gen,lister-gen,informer-gen,deepcopy-gen,conversion-gen}@v0.31.3
# Go installs the above commands to get installed in $GOBIN if defined, and $GOPATH/bin otherwise: # Go installs the above commands to get installed in $GOBIN if defined, and $GOPATH/bin otherwise:
GOBIN="$(go env GOBIN)" GOBIN="$(go env GOBIN)"

View File

@ -47,7 +47,7 @@ EXT_APIS_PKG="$4"
GROUPS_WITH_VERSIONS="$5" GROUPS_WITH_VERSIONS="$5"
shift 5 shift 5
go install k8s.io/code-generator/cmd/{defaulter-gen,conversion-gen,client-gen,lister-gen,informer-gen,deepcopy-gen,openapi-gen}@v0.31.1 go install k8s.io/code-generator/cmd/{defaulter-gen,conversion-gen,client-gen,lister-gen,informer-gen,deepcopy-gen,openapi-gen}@v0.31.3
# Go installs the above commands to get installed in $GOBIN if defined, and $GOPATH/bin otherwise: # Go installs the above commands to get installed in $GOBIN if defined, and $GOPATH/bin otherwise:
GOBIN="$(go env GOBIN)" GOBIN="$(go env GOBIN)"

View File

@ -87,6 +87,7 @@ type JobSpec struct {
// Specifies the maximum number of retries before marking this Job failed. // Specifies the maximum number of retries before marking this Job failed.
// Defaults to 3. // Defaults to 3.
// +kubebuilder:default:=3
// +optional // +optional
MaxRetry int32 `json:"maxRetry,omitempty" protobuf:"bytes,9,opt,name=maxRetry"` MaxRetry int32 `json:"maxRetry,omitempty" protobuf:"bytes,9,opt,name=maxRetry"`
@ -203,6 +204,7 @@ type LifecyclePolicy struct {
Timeout *metav1.Duration `json:"timeout,omitempty" protobuf:"bytes,5,opt,name=timeout"` Timeout *metav1.Duration `json:"timeout,omitempty" protobuf:"bytes,5,opt,name=timeout"`
} }
// +kubebuilder:validation:Enum=none;best-effort;restricted;single-numa-node
type NumaPolicy string type NumaPolicy string
const ( const (

View File

@ -28,10 +28,16 @@ const (
// RestartJobAction if this action is set, the whole job will be restarted // RestartJobAction if this action is set, the whole job will be restarted
RestartJobAction Action = "RestartJob" RestartJobAction Action = "RestartJob"
// RestartTaskAction if this action is set, only the task will be restarted; default action. // RestartTaskAction if this action is set, only the task will be restarted
// It means that all pods under the task will be deleted and recreated.
// This action can not work together with job level events, e.g. JobUnschedulable // This action can not work together with job level events, e.g. JobUnschedulable
RestartTaskAction Action = "RestartTask" RestartTaskAction Action = "RestartTask"
// RestartPodAction if this action is set, only the pod will be restarted
// It means that only the pod corresponding to the event will be deleted and recreated.
// This action can just work together with pod level events, e.g. PodFailed
RestartPodAction Action = "RestartPod"
// TerminateJobAction if this action is set, the whole job wil be terminated // TerminateJobAction if this action is set, the whole job wil be terminated
// and can not be resumed: all Pod of Job will be evicted, and no Pod will be recreated. // and can not be resumed: all Pod of Job will be evicted, and no Pod will be recreated.
TerminateJobAction Action = "TerminateJob" TerminateJobAction Action = "TerminateJob"

View File

@ -14,9 +14,11 @@ type Command struct {
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Action defines the action that will be took to the target object. // Action defines the action that will be took to the target object.
// +optional
Action string `json:"action,omitempty" protobuf:"bytes,2,opt,name=action"` Action string `json:"action,omitempty" protobuf:"bytes,2,opt,name=action"`
// TargetObject defines the target object of this command. // TargetObject defines the target object of this command.
// +optional
TargetObject *metav1.OwnerReference `json:"target,omitempty" protobuf:"bytes,3,opt,name=target"` TargetObject *metav1.OwnerReference `json:"target,omitempty" protobuf:"bytes,3,opt,name=target"`
// Unique, one-word, CamelCase reason for this command. // Unique, one-word, CamelCase reason for this command.

View File

@ -17,6 +17,7 @@ limitations under the License.
package v1alpha1 package v1alpha1
// Event represent the phase of Job, e.g. pod-failed. // Event represent the phase of Job, e.g. pod-failed.
// +kubebuilder:validation:Enum=*;PodPending;PodRunning;PodFailed;PodEvicted;Unknown;TaskCompleted;OutOfSync;CommandIssued;JobUpdated;TaskFailed
type Event string type Event string
const ( const (

View File

@ -31,41 +31,63 @@ type JobFlowSpec struct {
// Important: Run "make" to regenerate code after modifying this file // Important: Run "make" to regenerate code after modifying this file
// Foo is an example field of JobFlow. Edit jobflow_types.go to remove/update // Foo is an example field of JobFlow. Edit jobflow_types.go to remove/update
// +optional
Flows []Flow `json:"flows,omitempty"` Flows []Flow `json:"flows,omitempty"`
JobRetainPolicy string `json:"jobRetainPolicy,omitempty"` // +optional
JobRetainPolicy RetainPolicy `json:"jobRetainPolicy,omitempty"`
} }
// Flow defines the dependent of jobs // Flow defines the dependent of jobs
type Flow struct { type Flow struct {
// +kubebuilder:validation:MinLength=1
// +required
Name string `json:"name"` Name string `json:"name"`
// +optional
DependsOn *DependsOn `json:"dependsOn,omitempty"` DependsOn *DependsOn `json:"dependsOn,omitempty"`
} }
type DependsOn struct { type DependsOn struct {
// +optional
Targets []string `json:"targets,omitempty"` Targets []string `json:"targets,omitempty"`
// +optional
Probe *Probe `json:"probe,omitempty"` Probe *Probe `json:"probe,omitempty"`
} }
type Probe struct { type Probe struct {
// +optional
HttpGetList []HttpGet `json:"httpGetList,omitempty"` HttpGetList []HttpGet `json:"httpGetList,omitempty"`
// +optional
TcpSocketList []TcpSocket `json:"tcpSocketList,omitempty"` TcpSocketList []TcpSocket `json:"tcpSocketList,omitempty"`
// +optional
TaskStatusList []TaskStatus `json:"taskStatusList,omitempty"` TaskStatusList []TaskStatus `json:"taskStatusList,omitempty"`
} }
type HttpGet struct { type HttpGet struct {
// +optional
TaskName string `json:"taskName,omitempty"` TaskName string `json:"taskName,omitempty"`
// +optional
Path string `json:"path,omitempty"` Path string `json:"path,omitempty"`
// +optional
// +kubebuilder:validation:Minimum=0
// +kubebuilder:validation:Maximum=65535
Port int `json:"port,omitempty"` Port int `json:"port,omitempty"`
// +optional
HTTPHeader v1.HTTPHeader `json:"httpHeader,omitempty"` HTTPHeader v1.HTTPHeader `json:"httpHeader,omitempty"`
} }
type TcpSocket struct { type TcpSocket struct {
// +optional
TaskName string `json:"taskName,omitempty"` TaskName string `json:"taskName,omitempty"`
// +kubebuilder:validation:Minimum=0
// +kubebuilder:validation:Maximum=65535
// +required
Port int `json:"port"` Port int `json:"port"`
} }
type TaskStatus struct { type TaskStatus struct {
// +optional
TaskName string `json:"taskName,omitempty"` TaskName string `json:"taskName,omitempty"`
// +optional
Phase string `json:"phase,omitempty"` Phase string `json:"phase,omitempty"`
} }
@ -73,44 +95,65 @@ type TaskStatus struct {
type JobFlowStatus struct { type JobFlowStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file // Important: Run "make" to regenerate code after modifying this file
// +optional
PendingJobs []string `json:"pendingJobs,omitempty"` PendingJobs []string `json:"pendingJobs,omitempty"`
// +optional
RunningJobs []string `json:"runningJobs,omitempty"` RunningJobs []string `json:"runningJobs,omitempty"`
// +optional
FailedJobs []string `json:"failedJobs,omitempty"` FailedJobs []string `json:"failedJobs,omitempty"`
// +optional
CompletedJobs []string `json:"completedJobs,omitempty"` CompletedJobs []string `json:"completedJobs,omitempty"`
// +optional
TerminatedJobs []string `json:"terminatedJobs,omitempty"` TerminatedJobs []string `json:"terminatedJobs,omitempty"`
// +optional
UnKnowJobs []string `json:"unKnowJobs,omitempty"` UnKnowJobs []string `json:"unKnowJobs,omitempty"`
// +optional
JobStatusList []JobStatus `json:"jobStatusList,omitempty"` JobStatusList []JobStatus `json:"jobStatusList,omitempty"`
// +optional
Conditions map[string]Condition `json:"conditions,omitempty"` Conditions map[string]Condition `json:"conditions,omitempty"`
// +optional
State State `json:"state,omitempty"` State State `json:"state,omitempty"`
} }
type JobStatus struct { type JobStatus struct {
// +optional
Name string `json:"name,omitempty"` Name string `json:"name,omitempty"`
// +optional
State v1alpha1.JobPhase `json:"state,omitempty"` State v1alpha1.JobPhase `json:"state,omitempty"`
// +optional
StartTimestamp metav1.Time `json:"startTimestamp,omitempty"` StartTimestamp metav1.Time `json:"startTimestamp,omitempty"`
// +optional
EndTimestamp metav1.Time `json:"endTimestamp,omitempty"` EndTimestamp metav1.Time `json:"endTimestamp,omitempty"`
// +optional
RestartCount int32 `json:"restartCount,omitempty"` RestartCount int32 `json:"restartCount,omitempty"`
// +optional
RunningHistories []JobRunningHistory `json:"runningHistories,omitempty"` RunningHistories []JobRunningHistory `json:"runningHistories,omitempty"`
} }
type JobRunningHistory struct { type JobRunningHistory struct {
// +optional
StartTimestamp metav1.Time `json:"startTimestamp,omitempty"` StartTimestamp metav1.Time `json:"startTimestamp,omitempty"`
// +optional
EndTimestamp metav1.Time `json:"endTimestamp,omitempty"` EndTimestamp metav1.Time `json:"endTimestamp,omitempty"`
// +optional
State v1alpha1.JobPhase `json:"state,omitempty"` State v1alpha1.JobPhase `json:"state,omitempty"`
} }
type State struct { type State struct {
// +optional
Phase Phase `json:"phase,omitempty"` Phase Phase `json:"phase,omitempty"`
} }
type Phase string // +kubebuilder:validation:Enum=retain;delete
type RetainPolicy string
const ( const (
Retain = "retain" Retain RetainPolicy = "retain"
Delete = "delete" Delete RetainPolicy = "delete"
) )
type Phase string
const ( const (
Succeed Phase = "Succeed" Succeed Phase = "Succeed"
Terminating Phase = "Terminating" Terminating Phase = "Terminating"

View File

@ -25,18 +25,27 @@ import (
// ResourceInfo is the sets about resource capacity and allocatable // ResourceInfo is the sets about resource capacity and allocatable
type ResourceInfo struct { type ResourceInfo struct {
// +optional
Allocatable string `json:"allocatable,omitempty"` Allocatable string `json:"allocatable,omitempty"`
// +optional
Capacity int `json:"capacity,omitempty"` Capacity int `json:"capacity,omitempty"`
} }
// CPUInfo is the cpu topology detail // CPUInfo is the cpu topology detail
type CPUInfo struct { type CPUInfo struct {
// +kubebuilder:validation:Minimum=0
// +optional
NUMANodeID int `json:"numa,omitempty"` NUMANodeID int `json:"numa,omitempty"`
// +kubebuilder:validation:Minimum=0
// +optional
SocketID int `json:"socket,omitempty"` SocketID int `json:"socket,omitempty"`
// +kubebuilder:validation:Minimum=0
// +optional
CoreID int `json:"core,omitempty"` CoreID int `json:"core,omitempty"`
} }
// PolicyName is the policy name type // PolicyName is the policy name type
// +kubebuilder:validation:Enum=CPUManagerPolicy;TopologyManagerPolicy
type PolicyName string type PolicyName string
const ( const (

View File

@ -21,9 +21,6 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
) )
// PodGroupPhase is the phase of a pod group at the current time.
type PodGroupPhase string
// QueueState is state type of queue. // QueueState is state type of queue.
type QueueState string type QueueState string
@ -38,6 +35,9 @@ const (
QueueStateUnknown QueueState = "Unknown" QueueStateUnknown QueueState = "Unknown"
) )
// PodGroupPhase is the phase of a pod group at the current time.
type PodGroupPhase string
// These are the valid phase of podGroups. // These are the valid phase of podGroups.
const ( const (
// PodGroupPending means the pod group has been accepted by the system, but scheduler can not allocate // PodGroupPending means the pod group has been accepted by the system, but scheduler can not allocate
@ -337,8 +337,11 @@ type QueueStatus struct {
// CluterSpec represents the template of Cluster // CluterSpec represents the template of Cluster
type Cluster struct { type Cluster struct {
// +optional
Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"` Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"`
// +optional
Weight int32 `json:"weight,omitempty" protobuf:"bytes,2,opt,name=weight"` Weight int32 `json:"weight,omitempty" protobuf:"bytes,2,opt,name=weight"`
// +optional
Capacity v1.ResourceList `json:"capacity,omitempty" protobuf:"bytes,3,opt,name=capacity"` Capacity v1.ResourceList `json:"capacity,omitempty" protobuf:"bytes,3,opt,name=capacity"`
} }
@ -369,7 +372,10 @@ type NodeGroupAntiAffinity struct {
// QueueSpec represents the template of Queue. // QueueSpec represents the template of Queue.
type QueueSpec struct { type QueueSpec struct {
// +optional
Weight int32 `json:"weight,omitempty" protobuf:"bytes,1,opt,name=weight"` Weight int32 `json:"weight,omitempty" protobuf:"bytes,1,opt,name=weight"`
// +optional
Capability v1.ResourceList `json:"capability,omitempty" protobuf:"bytes,2,opt,name=capability"` Capability v1.ResourceList `json:"capability,omitempty" protobuf:"bytes,2,opt,name=capability"`
// Reclaimable indicate whether the queue can be reclaimed by other queue // Reclaimable indicate whether the queue can be reclaimed by other queue

View File

@ -17,11 +17,15 @@ limitations under the License.
package v1alpha1 package v1alpha1
import (
flowv1alpha1 "volcano.sh/apis/pkg/apis/flow/v1alpha1"
)
// JobFlowSpecApplyConfiguration represents a declarative configuration of the JobFlowSpec type for use // JobFlowSpecApplyConfiguration represents a declarative configuration of the JobFlowSpec type for use
// with apply. // with apply.
type JobFlowSpecApplyConfiguration struct { type JobFlowSpecApplyConfiguration struct {
Flows []FlowApplyConfiguration `json:"flows,omitempty"` Flows []FlowApplyConfiguration `json:"flows,omitempty"`
JobRetainPolicy *string `json:"jobRetainPolicy,omitempty"` JobRetainPolicy *flowv1alpha1.RetainPolicy `json:"jobRetainPolicy,omitempty"`
} }
// JobFlowSpecApplyConfiguration constructs a declarative configuration of the JobFlowSpec type for use with // JobFlowSpecApplyConfiguration constructs a declarative configuration of the JobFlowSpec type for use with
@ -46,7 +50,7 @@ func (b *JobFlowSpecApplyConfiguration) WithFlows(values ...*FlowApplyConfigurat
// WithJobRetainPolicy sets the JobRetainPolicy field in the declarative configuration to the given value // WithJobRetainPolicy sets the JobRetainPolicy field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the JobRetainPolicy field is set to the value of the last call. // If called multiple times, the JobRetainPolicy field is set to the value of the last call.
func (b *JobFlowSpecApplyConfiguration) WithJobRetainPolicy(value string) *JobFlowSpecApplyConfiguration { func (b *JobFlowSpecApplyConfiguration) WithJobRetainPolicy(value flowv1alpha1.RetainPolicy) *JobFlowSpecApplyConfiguration {
b.JobRetainPolicy = &value b.JobRetainPolicy = &value
return b return b
} }