Skip to content

Commit

Permalink
Add flag to only generate registry overview once (#29)
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
  • Loading branch information
puiterwijk authored and jessfraz committed Jun 27, 2017
1 parent c1412f3 commit 78e58d7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ func main() {
Name: "insecure, k",
Usage: "do not verify tls certificates of registry",
},
cli.BoolFlag{
Name: "once, o",
Usage: "generate an output once and then exit",
},
cli.StringFlag{
Name: "port",
Value: "8080",
Expand Down Expand Up @@ -183,6 +187,11 @@ func main() {
logrus.Fatalf("Error creating index: %v", err)
}

if c.GlobalBool("once") {
logrus.Info("Output generated")
return nil
}

// parse the duration
dur, err := time.ParseDuration(c.String("interval"))
if err != nil {
Expand Down

0 comments on commit 78e58d7

Please sign in to comment.