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 <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2024-10-15 14:21:27 +02:00
parent 71fffa7a03
commit d47c31ffdd

View File

@@ -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