mirror of
https://github.com/containrrr/watchtower.git
synced 2025-09-21 21:30:48 +02:00
Re-apply based on new go flags package (#336)
This commit is contained in:
parent
9eca883f17
commit
baf5e50051
7 changed files with 58 additions and 34 deletions
|
@ -1,11 +1,12 @@
|
|||
package flags
|
||||
|
||||
import (
|
||||
"os"
|
||||
"time"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/viper"
|
||||
"os"
|
||||
"time"
|
||||
)
|
||||
|
||||
// RegisterDockerFlags that are used directly by the docker api client
|
||||
|
@ -52,6 +53,12 @@ func RegisterSystemFlags(rootCmd *cobra.Command) {
|
|||
viper.GetBool("WATCHTOWER_CLEANUP"),
|
||||
"remove previously used images after updating")
|
||||
|
||||
flags.BoolP(
|
||||
"remove-volumes",
|
||||
"",
|
||||
viper.GetBool("WATCHTOWER_REMOVE_VOLUMES"),
|
||||
"remove attached volumes before updating")
|
||||
|
||||
flags.BoolP(
|
||||
"label-enable",
|
||||
"e",
|
||||
|
@ -64,7 +71,6 @@ func RegisterSystemFlags(rootCmd *cobra.Command) {
|
|||
viper.GetBool("WATCHTOWER_DEBUG"),
|
||||
"enable debug mode with verbose logging")
|
||||
|
||||
|
||||
flags.BoolP(
|
||||
"monitor-only",
|
||||
"m",
|
||||
|
@ -253,7 +259,6 @@ func ReadFlags(cmd *cobra.Command) (bool, bool, bool, time.Duration) {
|
|||
return cleanup, noRestart, monitorOnly, timeout
|
||||
}
|
||||
|
||||
|
||||
func setEnvOptStr(env string, opt string) error {
|
||||
if opt == "" || opt == os.Getenv(env) {
|
||||
return nil
|
||||
|
@ -271,4 +276,3 @@ func setEnvOptBool(env string, opt bool) error {
|
|||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue