Skip to content

Commit

Permalink
Merge pull request #106 from trickest/hotfix/machine-config
Browse files Browse the repository at this point in the history
Omit machine types unless they are > 0
  • Loading branch information
mhmdiaa authored Dec 20, 2023
2 parents fd8cef0 + 9d96ba8 commit 099bd41
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions cmd/execute/execute.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,21 @@ func parseMachineConfiguration(config string) (types.Machines, error) {
}
}

return types.Machines{
// sizes = [small, medium, large]
Small: &sizes[0],
Medium: &sizes[1],
Large: &sizes[2],
}, nil
var machines types.Machines

if sizes[0] != 0 {
machines.Small = &sizes[0]
}

if sizes[1] != 0 {
machines.Medium = &sizes[1]
}

if sizes[2] != 0 {
machines.Large = &sizes[2]
}

return machines, nil
}

// One type of machine
Expand Down

0 comments on commit 099bd41

Please sign in to comment.