API update to support staggered updates prototype.
This commit is contained in:
parent
40153d5cb1
commit
77bb78927e
4 changed files with 191 additions and 73 deletions
13
updatejob.go
13
updatejob.go
|
@ -60,7 +60,6 @@ func NewDefaultUpdateJob(config *aurora.TaskConfig) *UpdateJob {
|
|||
req.Settings.MaxPerInstanceFailures = 0
|
||||
req.Settings.MaxFailedInstances = 0
|
||||
req.Settings.RollbackOnFailure = true
|
||||
req.Settings.VariableUpdateGroupSize = []int32{1, 2, 3}
|
||||
|
||||
//TODO(rdelvalle): Deep copy job struct to avoid unexpected behavior
|
||||
return &UpdateJob{Job: job, req: req}
|
||||
|
@ -139,6 +138,18 @@ func (u *UpdateJob) RollbackOnFail(rollback bool) *UpdateJob {
|
|||
return u
|
||||
}
|
||||
|
||||
func (u *UpdateJob) UpdateStrategy(strategy aurora.JobUpdateStrategyType) *UpdateJob {
|
||||
u.req.Settings.UpdateStrategyType = &strategy
|
||||
return u
|
||||
}
|
||||
|
||||
func (u *UpdateJob) GroupsSize(groupSizes []int32) *UpdateJob {
|
||||
u.req.Settings.GroupsSize = make([]int32, len(groupSizes))
|
||||
|
||||
copy(u.req.Settings.GroupsSize, groupSizes)
|
||||
return u
|
||||
}
|
||||
|
||||
func NewUpdateSettings() *aurora.JobUpdateSettings {
|
||||
|
||||
us := new(aurora.JobUpdateSettings)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue