Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ARM
k8s
Kured
Commits
d3fa3ffd
Commit
d3fa3ffd
authored
Oct 03, 2017
by
Elena Morozova
Browse files
Close body after error check
Otherwise it panics for nil body
parent
adf8147a
Changes
1
Hide whitespace changes
Inline
Side-by-side
pkg/notifications/slack/slack.go
View file @
d3fa3ffd
...
...
@@ -29,10 +29,10 @@ func NotifyReboot(hookURL, username, nodeID string) error {
}
resp
,
err
:=
httpClient
.
Post
(
hookURL
,
"application/json"
,
&
buf
)
defer
resp
.
Body
.
Close
()
if
err
!=
nil
{
return
err
}
defer
resp
.
Body
.
Close
()
if
resp
.
StatusCode
<
200
||
resp
.
StatusCode
>=
300
{
return
fmt
.
Errorf
(
resp
.
Status
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment