Skip to content

Commit

Permalink
Reorganize code
Browse files Browse the repository at this point in the history
Signed-off-by: Raul Sevilla <[email protected]>
  • Loading branch information
rsevilla87 committed Oct 27, 2020
1 parent 8ea410b commit bdde864
Show file tree
Hide file tree
Showing 18 changed files with 491 additions and 1,284 deletions.
11 changes: 6 additions & 5 deletions cmd/kube-burner.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,11 @@ func destroyCmd() *cobra.Command {
Short: "Destroy old namespaces labeled with the given UUID.",
Args: cobra.MaximumNArgs(0),
Run: func(cmd *cobra.Command, args []string) {
err := config.Parse(configFile, false)
if err != nil {
log.Fatalf("Error parsing configuration: %s", err)
if configFile != "" {
err := config.Parse(configFile, false)
if err != nil {
log.Fatalf("Error parsing configuration: %s", err)
}
}
selector := util.NewSelector()
selector.Configure("", fmt.Sprintf("kube-burner-uuid=%s", uuid), "")
Expand All @@ -112,7 +114,6 @@ func destroyCmd() *cobra.Command {
},
}
cmd.Flags().StringVar(&uuid, "uuid", "", "UUID")
cmd.Flags().StringVarP(&configFile, "config", "c", "", "Config file path")
return cmd
}

Expand Down Expand Up @@ -242,7 +243,7 @@ func steps(uuid string, p *prometheus.Prometheus, prometheusStep time.Duration)
}
// If prometheus is enabled query metrics from the start of the first job to the end of the last one
if p != nil {
log.Infof("Waiting an extra %v before scraping prometheus metrics", prometheusStep*4)
log.Infof("Waiting %v extra before scraping prometheus metrics", prometheusStep*4)
time.Sleep(prometheusStep * 4)
if err := p.ScrapeMetrics(start, time.Now().UTC(), config.ConfigSpec, indexer); err != nil {
log.Error(err)
Expand Down
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFG
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls=
github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903 h1:LbsanbbD6LieFkXbj9YNNBupiGHJgFeLpO0j0Fza1h8=
Expand Down
Loading

0 comments on commit bdde864

Please sign in to comment.