TestcontainerEx.PullPolicy (testcontainer_ex v0.8.0)

Copy Markdown View Source

Pull policies that control whether an image is fetched from a remote registry before starting a container.

Summary

Functions

Returns a pull policy that always pulls the image.

Returns a pull policy that never pulls the image.

Returns a pull policy that pulls only when the image is not present locally.

Types

t()

@type t() :: %TestcontainerEx.PullPolicy{
  always_pull: boolean() | nil,
  pull_condition: (struct(), Req.Response.t() -> boolean()) | nil,
  pull_if_missing: boolean() | nil
}

Functions

always_pull()

@spec always_pull() :: t()

Returns a pull policy that always pulls the image.

iex> TestcontainerEx.PullPolicy.always_pull()
%TestcontainerEx.PullPolicy{always_pull: true, pull_if_missing: nil, pull_condition: nil}

never_pull()

@spec never_pull() :: t()

Returns a pull policy that never pulls the image.

iex> TestcontainerEx.PullPolicy.never_pull()
%TestcontainerEx.PullPolicy{always_pull: nil, pull_if_missing: nil, pull_condition: nil}

pull_condition(expr)

@spec pull_condition(
  expr :: (config :: struct(), conn :: Req.Response.t() -> true | false)
) :: t()

pull_if_missing()

@spec pull_if_missing() :: t()

Returns a pull policy that pulls only when the image is not present locally.

iex> TestcontainerEx.PullPolicy.pull_if_missing()
%TestcontainerEx.PullPolicy{always_pull: nil, pull_if_missing: true, pull_condition: nil}