Skip to content

Commit

Permalink
Merge pull request moby#48670 from thaJeztah/deprecate_daemon_exists
Browse files Browse the repository at this point in the history
daemon: deprecate Daemon.Exists and Daemon.IsPaused
  • Loading branch information
AkihiroSuda authored Oct 21, 2024
2 parents 3f9e489 + ac6e32c commit d99294e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions daemon/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,16 @@ 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
}

// 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()
Expand Down

0 comments on commit d99294e

Please sign in to comment.