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

Find max interval to use as defaultExecutor timout #227

Merged
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
13 changes: 12 additions & 1 deletion pkg/workflow/argo.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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
}