Skip to content

Commit

Permalink
if max_in_flight is not set, it is converted to "" to avoid max in fl…
Browse files Browse the repository at this point in the history
…ight is 0
  • Loading branch information
cappyzawa committed Apr 2, 2019
1 parent bef4fbf commit 93190b5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion bosh/director.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func (d BoshDirector) Deploy(manifestBytes []byte, deployParams DeployParams) er
Args: boshcmd.DeployArgs{Manifest: boshcmd.FileBytesArg{Bytes: manifestBytes}},
NoRedact: deployParams.NoRedact,
DryRun: deployParams.DryRun,
MaxInFlight: strconv.Itoa(deployParams.MaxInFlight),
MaxInFlight: convertMaxInFlight(deployParams.MaxInFlight),
Recreate: deployParams.Recreate,
SkipDrain: skipDrains,
VarFlags: boshcmd.VarFlags{
Expand Down Expand Up @@ -387,6 +387,13 @@ func parsedSkipDrains(drains []string) ([]boshdir.SkipDrain, error) {
return parsedDrains, nil
}

func convertMaxInFlight(maxInFlight int) string {
if maxInFlight == 0 {
return ""
}
return strconv.Itoa(maxInFlight)
}

func boshFileSystem() boshsys.FileSystem {
nullLogger := boshlog.NewWriterLogger(boshlog.LevelInfo, ioutil.Discard)
return boshsys.NewOsFileSystemWithStrictTempRoot(nullLogger)
Expand Down

0 comments on commit 93190b5

Please sign in to comment.