From d47c31ffdd4977ea63cffb8aa97d316dae6fa998 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 15 Oct 2024 14:21:27 +0200 Subject: [PATCH 1/2] daemon: deprecate Daemon.Exists This function was poorly documented as it uses fuzzy matching under the hood, and it's no longer used. Mark it as deprecated, and to be removed in the next release. Signed-off-by: Sebastiaan van Stijn --- daemon/container.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/daemon/container.go b/daemon/container.go index d43e95489db1b..80b1a2c296e1a 100644 --- a/daemon/container.go +++ b/daemon/container.go @@ -70,6 +70,8 @@ func (daemon *Daemon) GetContainer(prefixOrName string) (*container.Container, e // Exists returns a true if a container of the specified ID or name exists, // false otherwise. +// +// Deprecated: use [Daemon.GetContainer] to look up a container by ID, Name, or ID-prefix. This function will be removed in the next release. func (daemon *Daemon) Exists(id string) bool { c, _ := daemon.GetContainer(id) return c != nil From ac6e32cb5c2cc0620f260c671529c6df445a03df Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sun, 20 Oct 2024 12:26:00 +0200 Subject: [PATCH 2/2] daemon: deprecate Daemon.IsPaused This function was poorly documented as it uses fuzzy matching under the hood, and it's no longer used. Mark it as deprecated, and to be removed in the next release. Signed-off-by: Sebastiaan van Stijn --- daemon/container.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/daemon/container.go b/daemon/container.go index 80b1a2c296e1a..af708ffa937a2 100644 --- a/daemon/container.go +++ b/daemon/container.go @@ -78,6 +78,8 @@ func (daemon *Daemon) Exists(id string) bool { } // IsPaused returns a bool indicating if the specified container is paused. +// +// Deprecated: use [Daemon.GetContainer] to look up a container by ID, Name, or ID-prefix, and use [container.State.IsPaused]. This function will be removed in the next release. func (daemon *Daemon) IsPaused(id string) bool { c, _ := daemon.GetContainer(id) return c.State.IsPaused()