Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
afcollins committed Aug 10, 2023
1 parent 8d033ae commit 68dae0f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
12 changes: 6 additions & 6 deletions pkg/burner/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,16 @@ func Run(configSpec config.Spec, prometheusClients []*prometheus.Prometheus, ale
}
jobList[jobPosition].Start = time.Now().UTC()
measurements.SetJobConfig(&job.Job)
if job.Cleanup {
ctx, cancel := context.WithTimeout(context.Background(), globalConfig.GCTimeout)
defer cancel()
CleanupNamespaces(ctx, v1.ListOptions{LabelSelector: fmt.Sprintf("kube-burner-job=%s", job.Name)}, true)
CleanupNonNamespacedResources(ctx, v1.ListOptions{LabelSelector: fmt.Sprintf("kube-burner-job=%s", job.Name)}, true)
}
log.Infof("Triggering job: %s", job.Name)
measurements.Start()
switch job.JobType {
case config.CreationJob:
if job.Cleanup {
ctx, cancel := context.WithTimeout(context.Background(), globalConfig.GCTimeout)
defer cancel()
CleanupNamespaces(ctx, v1.ListOptions{LabelSelector: fmt.Sprintf("kube-burner-job=%s", job.Name)}, true)
CleanupNonNamespacedResources(ctx, v1.ListOptions{LabelSelector: fmt.Sprintf("kube-burner-job=%s", job.Name)}, true)
}
if job.Churn {
log.Info("Churning enabled")
log.Infof("Churn duration: %v", job.ChurnDuration)
Expand Down
3 changes: 2 additions & 1 deletion pkg/measurements/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ func SetJobConfig(jobConfig *config.Job) {
// Start starts registered measurements
func Start() {
var wg sync.WaitGroup
for _, measurement := range factory.createFuncs {
for name, measurement := range factory.createFuncs {
log.Infof("Starting measurement: %s", name)
wg.Add(1)
go measurement.start(&wg)
}
Expand Down

0 comments on commit 68dae0f

Please sign in to comment.