. kapow server generates on startup a pair of certificates
that will use to secure communications to its control server.
It will communicate the server and client certificates as well
as the client private key to the init programs it launches,
via environment variables.
. kapow server now understands a new flag --control-reachable-addr
which accepts either a IP address or a DNS name, that can be used
to ensure that the generated server certificate will be appropiate
in case the control server must be accessed from something other
than localhost.
Co-authored-by: Roberto Abdelkader Martínez Pérez <robertomartinezp@gmail.com>
As per the doc¹:
If the returned error is nil, the Response will contain a non-nil Body which the user is expected to close.
...
On error, any Response can be ignored. A non-nil Response with a non-nil error
only occurs when CheckRedirect fails, and even then the returned Response.Body
is already closed.
It is thus safe to defer res.Body.Close() as soon as err has been determined to
be nil.
Also, I've dispensed with the separate variable client, since it is not used
later.
¹: https://godoc.org/net/http#Client.Do