Skip to content

Commit

Permalink
Add set-gracetime command
Browse files Browse the repository at this point in the history
  • Loading branch information
Topher Bullock authored and williammartin committed Dec 10, 2018
1 parent 88022eb commit 7e421e7
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions commands/set_grace.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package commands

import (
"time"
)

type SetGraceTime struct {
Grace time.Duration `short:"g" long:"grace" description:"grace time (resetting ttl) of container" required:"true"`
}

func (command *SetGraceTime) Execute(maybeHandle []string) error {
container, err := globalClient().Lookup(handle(maybeHandle))
failIf(err)

err = container.SetGraceTime(command.Grace)
failIf(err)
return nil
}

0 comments on commit 7e421e7

Please sign in to comment.