Skip to content

Commit

Permalink
chore(ctrl): enable max running pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
squakez committed May 19, 2023
1 parent fbe85cf commit fdc1973
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions pkg/apis/camel/v1/build_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ import (
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
// Important: Run "make generate-deepcopy" to regenerate code after modifying this file

// PipelineSpec defines the Build operation to be executed
// PipelineSpec defines the Pipeline to be execute
type PipelineSpec struct {
// The sequence of Build tasks to be performed as part of the Build execution.
// The sequence of Pipeline tasks to be performed.
Tasks []Task `json:"tasks,omitempty"`
// Timeout defines the Pipeline maximum execution duration.
// The Pipeline deadline is set to the Pipeline start time plus the Timeout duration.
Expand Down
10 changes: 6 additions & 4 deletions pkg/controller/build/build_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,13 @@ func (r *reconcileBuild) Reconcile(ctx context.Context, request reconcile.Reques
targetLog := rlog.ForBuild(target)

var actions []Action

ip, err := platform.GetOrFindForResource(ctx, r.client, &instance, true)
if err != nil {
rlog.Error(err, "Could not find a platform bound to this Build")
return reconcile.Result{}, err
}
buildMonitor := Monitor{
// TODO enable this where we have the MaxRunningPipelines (the platform likely)
// maxRunningBuilds: instance.Spec.MaxRunningBuilds,
maxRunningBuilds: 10,
maxRunningBuilds: ip.Status.Pipeline.MaxRunningPipelines,
}

switch instance.BuilderConfiguration().Strategy {
Expand Down
2 changes: 1 addition & 1 deletion pkg/trait/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ func getImageName(e *Environment) string {
}

func (t *builderTrait) customTasks() []v1.Task {
customTasks := make([]v1.Task, 0, len(t.Tasks))
customTasks := make([]v1.Task, len(t.Tasks), len(t.Tasks))
for i, t := range t.Tasks {
// TODO, better strategy than a simple split!
splitted := strings.Split(t, ";")
Expand Down

0 comments on commit fdc1973

Please sign in to comment.