Skip to content

Commit 14715e3

Browse files
committed
Fix crash on events from the pods without annotations
1 parent 9e22e18 commit 14715e3

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/kube-vxlan-controller.app.src.script

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{application, 'kube-vxlan-controller', [
22
{description, "Kubernetes VXLAN contoller"},
3-
{vsn, "0.10.0"},
3+
{vsn, "0.10.1"},
44
{modules, []},
55
{applications, [kernel, stdlib, inets, cpflib, hackney, ewsc, jsx]},
66
{env, [

src/kube_vxlan_controller_run.erl

+5-3
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,10 @@ read_event(#{
118118
type := Type,
119119
object := #{
120120
kind := Kind,
121-
metadata := #{
121+
metadata := Metadata = #{
122122
namespace := Namespace,
123123
uid := PodUid,
124124
name := PodName,
125-
annotations := Annotations,
126125
resourceVersion := ResourceVersion
127126
},
128127
status := Status = #{
@@ -136,7 +135,10 @@ read_event(#{
136135
pod_uid => binary_to_list(PodUid),
137136
pod_name => binary_to_list(PodName),
138137
pod_ip => binary_to_list(maps:get(podIP, Status, <<>>)),
139-
nets_data => ?Tools:pod_nets_data(Annotations, Config),
138+
nets_data => ?Tools:pod_nets_data(
139+
maps:get(annotations, Metadata, #{}),
140+
Config
141+
),
140142
phase => binary_to_list(Phase),
141143
agent => ?Tools:pod_container_state(
142144
maps:get(agent_container_name, Config),

0 commit comments

Comments
 (0)