зеркало из https://github.com/Azure/orkestra.git
Find max interval to use as defaultExecutor timout (#227)
Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com>
This commit is contained in:
Родитель
d131337643
Коммит
de882016fa
|
@ -363,7 +363,7 @@ func (a *argo) generateAppGroupTpls(ctx context.Context, g *v1alpha1.Application
|
|||
|
||||
// TODO: Add the executor template
|
||||
// This should eventually be configurable
|
||||
updateWorkflowTemplates(a.wf, defaultExecutor(5*time.Minute))
|
||||
updateWorkflowTemplates(a.wf, defaultExecutor(maxInterval(g.Spec.Applications)))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
@ -771,3 +771,14 @@ func workflowServiceAccountName() string {
|
|||
}
|
||||
return "orkestra"
|
||||
}
|
||||
|
||||
func maxInterval(apps []v1alpha1.Application) time.Duration {
|
||||
// set the default to 5m
|
||||
max := 5 * time.Minute
|
||||
for _, app := range apps {
|
||||
if app.Spec.Release.Interval.Seconds() > max.Seconds() {
|
||||
max = app.Spec.Release.Interval.Duration
|
||||
}
|
||||
}
|
||||
return max
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче