Skip to content

Commit

Permalink
Merge pull request #111 from trickest/fix/config-machine-run-version
Browse files Browse the repository at this point in the history
Fix object reference issues
  • Loading branch information
mhmdiaa authored Feb 23, 2024
2 parents f392d62 + 3cd09ec commit 816d325
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 22 deletions.
46 changes: 24 additions & 22 deletions cmd/execute/execute.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,33 +87,35 @@ var ExecuteCmd = &cobra.Command{

allNodes, roots = CreateTrees(version, false)

if maxMachines {
executionMachines = version.MaxMachines
} else if machineConfiguration != "" {
machines, err := parseMachineConfiguration(machineConfiguration)
if err != nil {
fmt.Printf("Error: %s\n", err)
os.Exit(1)
}

if len(fleet.Machines) == 3 {
// 3 types of machines: small, medium, and large
executionMachines = machines

if machines.Default != nil {
fmt.Printf("Error: you need to use the small-medium-large format to specify the numbers of machines (e.g. 1-2-3)")
os.Exit(1)
}
} else {
// 1 type of machine
executionMachines, err = handleSingleMachineType(*fleet, machines)
if executionMachines == (types.Machines{}) {
if maxMachines {
executionMachines = version.MaxMachines
} else if machineConfiguration != "" {
machines, err := parseMachineConfiguration(machineConfiguration)
if err != nil {
fmt.Printf("Error: %s\n", err)
os.Exit(1)
}

if len(fleet.Machines) == 3 {
// 3 types of machines: small, medium, and large
executionMachines = machines

if machines.Default != nil {
fmt.Printf("Error: you need to use the small-medium-large format to specify the numbers of machines (e.g. 1-2-3)")
os.Exit(1)
}
} else {
// 1 type of machine
executionMachines, err = handleSingleMachineType(*fleet, machines)
if err != nil {
fmt.Printf("Error: %s\n", err)
os.Exit(1)
}
}
} else {
executionMachines = setMachinesToMinimum(version.MaxMachines)
}
} else {
executionMachines = setMachinesToMinimum(version.MaxMachines)
}

outputNodes := make([]string, 0)
Expand Down
2 changes: 2 additions & 0 deletions cmd/execute/watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ func WatchRun(runID uuid.UUID, downloadPath string, nodesToDownload map[string]o
mutex.Unlock()
break
}
version := output.GetWorkflowVersionByID(*run.WorkflowVersionInfo, uuid.Nil)
allNodes, roots := CreateTrees(version, false)

out := ""
out += fmt.Sprintf(fmtStr, "Name:", run.WorkflowName)
Expand Down

0 comments on commit 816d325

Please sign in to comment.