From e230967196ea88a76804a203e13aaa36c39db636 Mon Sep 17 00:00:00 2001 From: ilike2burnthing <59480337+ilike2burnthing@users.noreply.github.com> Date: Wed, 6 Jan 2021 21:34:58 +0000 Subject: [PATCH] Add WATCHTOWER_INCLUDE_RESTARTING env for include-restarting flag (#720) --- docs/arguments.md | 10 ++++++++++ internal/flags/flags.go | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/docs/arguments.md b/docs/arguments.md index 032affe..fea17a0 100644 --- a/docs/arguments.md +++ b/docs/arguments.md @@ -118,6 +118,16 @@ Environment Variable: DOCKER_API_VERSION Default: "1.24" ``` +## Include restarting +Will also include created and exited containers. + +``` + Argument: --include-restarting +Environment Variable: WATCHTOWER_INCLUDE_RESTARTING + Type: Boolean + Default: false +``` + ## Include stopped Will also include created and exited containers. diff --git a/internal/flags/flags.go b/internal/flags/flags.go index d45f384..c2dc8ad 100644 --- a/internal/flags/flags.go +++ b/internal/flags/flags.go @@ -105,6 +105,12 @@ func RegisterSystemFlags(rootCmd *cobra.Command) { viper.GetBool("WATCHTOWER_RUN_ONCE"), "Run once now and exit") + flags.BoolP( + "include-restarting", + "", + viper.GetBool("WATCHTOWER_INCLUDE_RESTARTING"), + "Will also include restarting containers") + flags.BoolP( "include-stopped", "S",