From 434bd067cffe25d7579edc17325139e069c9ef56 Mon Sep 17 00:00:00 2001 From: Jan Rundshagen Date: Sun, 16 Feb 2025 17:26:12 +0100 Subject: [PATCH] fix: increase default DOCKER_API_VERSION to 1.44 --- cmd/root.go | 11 ----------- docs/arguments.md | 2 +- internal/flags/flags.go | 2 +- 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index e6245a9..e0b9ee2 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -122,17 +122,6 @@ func PreRun(cmd *cobra.Command, _ []string) { log.Warn("Using `WATCHTOWER_NO_PULL` and `WATCHTOWER_MONITOR_ONLY` simultaneously might lead to no action being taken at all. If this is intentional, you may safely ignore this message.") } - // check if DOCKER_API_VERSION is set - if os.Getenv("DOCKER_API_VERSION") == "" { - log.Warn("The DOCKER_API_VERSION environment variable is not set. This may cause unexpected behavior while recreating docker containers. Defaulting to 1.44") - // set DOCKER_API_VERSION to 1.44 - os.Setenv("DOCKER_API_VERSION", "1.44") - } - // check if DOCKER_API_VERSION is set to minimum 1.44 or higher - if os.Getenv("DOCKER_API_VERSION") < "1.44" { - log.Warn("The DOCKER_API_VERSION environment variable is set to a version lower than 1.44. This may cause unexpected behavior while recreating docker containers.") - } - client = container.NewClient(container.ClientOptions{ IncludeStopped: includeStopped, ReviveStopped: reviveStopped, diff --git a/docs/arguments.md b/docs/arguments.md index cef7c88..0ebf868 100644 --- a/docs/arguments.md +++ b/docs/arguments.md @@ -172,7 +172,7 @@ The API version to use by the Docker client for connecting to the Docker daemon. Argument: --api-version, -a Environment Variable: DOCKER_API_VERSION Type: String - Default: "1.24" + Default: "1.44" ``` ## Include restarting diff --git a/internal/flags/flags.go b/internal/flags/flags.go index c11cdae..cc7d9e7 100644 --- a/internal/flags/flags.go +++ b/internal/flags/flags.go @@ -17,7 +17,7 @@ import ( // DockerAPIMinVersion is the minimum version of the docker api required to // use watchtower -const DockerAPIMinVersion string = "1.25" +const DockerAPIMinVersion string = "1.44" var defaultInterval = int((time.Hour * 24).Seconds())