Skip to content

Commit

Permalink
Use ewsc 0.2.0
Browse files Browse the repository at this point in the history
Eliminates exception on exec against terminating pod, therefore mitigation
code avoiding crash on that is removed.

More details on the issue:
aialferov/ewsc@7f6de55
  • Loading branch information
aialferov committed Mar 14, 2019
1 parent 660e359 commit 5b05b46
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion rebar.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{deps, [
{cpflib, {git, "git://github.com/aialferov/cpflib", {tag, "master"}}},
{hackney, {git, "git://github.com/benoitc/hackney.git", {tag, "1.11.0"}}},
{ewsc, {git, "git://github.com/aialferov/ewsc", {tag, "master"}}},
{ewsc, {git, "git://github.com/aialferov/ewsc", {tag, "0.2.0"}}},
{jsx, {git, "https://github.com/talentdeficit/jsx.git", {tag, "master"}}}
]}.
{plugins, [
Expand Down
2 changes: 1 addition & 1 deletion src/kube-vxlan-controller.app.src.script
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{application, 'kube-vxlan-controller', [
{description, "Kubernetes VXLAN contoller"},
{vsn, "0.10.2"},
{vsn, "0.10.3"},
{modules, []},
{applications, [kernel, stdlib, inets, cpflib, hackney, ewsc, jsx]},
{env, [
Expand Down
6 changes: 1 addition & 5 deletions src/kube_vxlan_controller_pod.erl
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ exec(Namespace, PodName, ContainerName, Command, Config) ->
lists:reverse(string:split(Command, " ", all))
),

try ?K8s:ws_connect(Resource, Query, Config) of
case ?K8s:ws_connect(Resource, Query, Config) of
{ok, Socket} ->
case ?K8s:ws_recv(Socket) of
{ok, Result} ->
Expand All @@ -66,10 +66,6 @@ exec(Namespace, PodName, ContainerName, Command, Config) ->
{error, Reason} ->
?Log:error(Reason),
""
catch
_ClassN:_ExceptionPatternN:Stacktrace ->
?Log:error(Stacktrace),
""
end.

fmt(Format, Args) -> lists:flatten(io_lib:format(Format, Args)).

0 comments on commit 5b05b46

Please sign in to comment.