fix: correct env var name FALCO_HOSTNAME

Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
This commit is contained in:
Leonardo Grasso 2022-08-23 17:04:40 +02:00 committed by poiana
parent 928e10f0ce
commit 3d61d3427e

View File

@ -25,9 +25,12 @@ application::run_result application::init_outputs()
{ {
// read hostname // read hostname
std::string hostname; std::string hostname;
if(char* env_hostname = getenv("FALCO_GRPC_HOSTNAME")) char* env_hostname = getenv("FALCO_HOSTNAME");
// todo(leogr): keep FALCO_GRPC_HOSTNAME for backward compatibility. Shall we deprecate it?
if(env_hostname || (env_hostname = getenv("FALCO_GRPC_HOSTNAME")))
{ {
hostname = env_hostname; hostname = env_hostname;
falco_logger::log(LOG_INFO, "Hostname value has been overridden via environment variable to: " + hostname + "\n");
} }
else else
{ {