Skip to content

Commit

Permalink
Optimize object creation
Browse files Browse the repository at this point in the history
Signed-off-by: Raul Sevilla <[email protected]>
  • Loading branch information
rsevilla87 committed Oct 9, 2020
1 parent 5a82535 commit 5320eb8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pkg/burner/burner.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,8 @@ func (ex *Executor) RunCreateJob() {
var ns string
var err error
ReadConfig(ex.Config.QPS, ex.Config.Burst)
log.Infof("QPS: %v", RestConfig.QPS)
log.Infof("Burst: %v", RestConfig.Burst)
dynamicClient, err = dynamic.NewForConfig(RestConfig)
if err != nil {
log.Fatal(err)
Expand All @@ -252,9 +254,12 @@ func (ex *Executor) RunCreateJob() {
wg.Add(1)
go ex.replicaHandler(objectIndex, obj, ns, i, &wg)
}
// Wait for all replicaHandlers to finish before move forward to the next interation
wg.Wait()
// Wait for all replicaHandlers to finish before move forward to the next interation, only when using namespaced iterations
if ex.Config.NamespacedIterations {
wg.Wait()
}
if ex.Config.PodWait {
wg.Wait()
ex.waitForObjects(ns)
}
if ex.Config.JobIterationDelay > 0 {
Expand All @@ -263,6 +268,7 @@ func (ex *Executor) RunCreateJob() {
}
}
if ex.Config.WaitWhenFinished && !ex.Config.PodWait {
wg.Wait()
for i := 1; i <= ex.Config.JobIterations; i++ {
if ex.Config.NamespacedIterations {
ns = fmt.Sprintf("%s-%d", ex.Config.Namespace, i)
Expand Down

0 comments on commit 5320eb8

Please sign in to comment.