Skip to content

Commit

Permalink
chore: ignore some new events
Browse files Browse the repository at this point in the history
Signed-off-by: Brooks Townsend <brooksmtownsend@gmail.com>

fix tests

Signed-off-by: Brooks Townsend <brooksmtownsend@gmail.com>
  • Loading branch information
brooksmtownsend committed Oct 24, 2023
1 parent edb76b9 commit 8f00103
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/lattice_observer/observed/event_processor.ex
Original file line number Diff line number Diff line change
Expand Up @@ -257,13 +257,13 @@ defmodule LatticeObserver.Observed.EventProcessor do
end)

l =
List.foldl(actors_expanded, l, fn public_key, acc ->
List.foldl(actors_expanded, l, fn {public_key, annotations}, acc ->
put_actor_instance(
acc,
source_host,
public_key,
"n/a",
%{},
annotations,
stamp,
%{}
)
Expand Down Expand Up @@ -294,8 +294,8 @@ defmodule LatticeObserver.Observed.EventProcessor do
acc,
source_host,
x["public_key"],
"n/a",
x["annotations"],
Map.get(x, "instance_id", "n/a"),
Map.get(x, "annotations", %{}),
stamp,
%{}
)
Expand All @@ -308,8 +308,8 @@ defmodule LatticeObserver.Observed.EventProcessor do
x["public_key"],
x["link_name"],
x["contract_id"],
"n/a",
x["annotations"],
Map.get(x, "instance_id", "n/a"),
Map.get(x, "annotations", %{}),
stamp,
%{}
)
Expand Down
39 changes: 39 additions & 0 deletions lib/lattice_observer/observed/lattice.ex
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,45 @@ defmodule LatticeObserver.Observed.Lattice do
l
end

def apply_event(
l = %Lattice{},
%Cloudevents.Format.V_1_0.Event{
source: _source_host,
datacontenttype: "application/json",
time: _stamp,
type: "com.wasmcloud.lattice.health_check_status"
}
) do
# This does not currently affect state, but shouldn't generate a warning either
l
end

def apply_event(
l = %Lattice{},
%Cloudevents.Format.V_1_0.Event{
source: _source_host,
datacontenttype: "application/json",
time: _stamp,
type: "com.wasmcloud.lattice.actors_started"
}
) do
# This does not currently affect state, but shouldn't generate a warning either
l
end

def apply_event(
l = %Lattice{},
%Cloudevents.Format.V_1_0.Event{
source: _source_host,
datacontenttype: "application/json",
time: _stamp,
type: "com.wasmcloud.lattice.actors_stopped"
}
) do
# This does not currently affect state, but shouldn't generate a warning either
l
end

def apply_event(
l = %Lattice{},
%Cloudevents.Format.V_1_0.Event{
Expand Down

0 comments on commit 8f00103

Please sign in to comment.