• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

coryodaniel / k8s / 807e93631268e5fd52ca29e3e4755088cf11bf27-PR-262

pending completion
807e93631268e5fd52ca29e3e4755088cf11bf27-PR-262

Pull #262

github

mruoss
add possibility to wait for delete
Pull Request #262: add possibility to wait for delete

6 of 6 new or added lines in 1 file covered. (100.0%)

732 of 1009 relevant lines covered (72.55%)

44.92 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/lib/k8s/client/runner/stream_to.ex
1
defmodule K8s.Client.Runner.StreamTo do
2
  @moduledoc """
3
  Takes a `K8s.Client.list/3` operation and returns an Elixir [`Stream`](https://hexdocs.pm/elixir/Stream.html) of resources.
4
  """
5
  alias K8s.Client.Provider
6
  alias K8s.Client.Runner.Base
7
  alias K8s.Conn
8
  alias K8s.Operation
9
  alias K8s.Operation.Error
10

11
  @supported_operations [:connect]
12

13
  @doc """
14
  Validates operation type before calling `stream/3`. Only supports verbs: `list_all_namespaces` and `list`.
15
  """
16
  @spec run(Operation.t(), stream_to :: pid()) :: Provider.stream_to_response_t()
17
  def run(%Operation{conn: %Conn{} = conn} = op, stream_to), do: run(conn, op, [], stream_to)
×
18

19
  @spec run(Operation.t(), keyword(), stream_to :: pid()) ::
20
          Provider.stream_to_response_t()
21
  def run(%Operation{conn: %Conn{} = conn} = op, http_opts, stream_to),
22
    do: run(conn, op, http_opts, stream_to)
×
23

24
  @spec run(Conn.t(), Operation.t(), stream_to :: pid()) ::
25
          Provider.stream_to_response_t()
26
  def run(%Conn{} = conn, %Operation{} = op, stream_to), do: run(conn, op, [], stream_to)
×
27

28
  @spec run(Conn.t(), Operation.t(), keyword(), stream_to :: pid()) ::
29
          Provider.stream_to_response_t()
30
  def run(%Conn{} = conn, %Operation{verb: :connect} = op, http_opts, stream_to) do
31
    Base.stream_to(conn, op, http_opts, stream_to)
×
32
  end
33

34
  def run(op, _, _, _) do
35
    msg = "Only #{inspect(@supported_operations)} operations can be streamed. #{inspect(op)}"
×
36

37
    {:error, %Error{message: msg}}
38
  end
39
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc