update: gRPC server sock defaults to /run/falco/falco.sock

Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
This commit is contained in:
Leonardo Grasso 2022-09-12 16:55:13 +02:00 committed by poiana
parent c0ea753262
commit c732e5d800
3 changed files with 6 additions and 6 deletions

View File

@ -296,7 +296,7 @@ http_output:
# gRPC server using an unix socket # gRPC server using an unix socket
grpc: grpc:
enabled: false enabled: false
bind_address: "unix:///var/run/falco.sock" bind_address: "unix:///run/falco/falco.sock"
# when threadiness is 0, Falco automatically guesses it depending on the number of online cores # when threadiness is 0, Falco automatically guesses it depending on the number of online cores
threadiness: 0 threadiness: 0

View File

@ -240,7 +240,7 @@ class FalcoTest(Test):
self.grpcurl_res = None self.grpcurl_res = None
self.grpc_observer = None self.grpc_observer = None
self.grpc_address = self.params.get( self.grpc_address = self.params.get(
'address', 'grpc/*', default='/var/run/falco.sock') 'address', 'grpc/*', default='/run/falco/falco.sock')
if self.grpc_address.startswith("unix://"): if self.grpc_address.startswith("unix://"):
self.is_grpc_using_unix_socket = True self.is_grpc_using_unix_socket = True
self.grpc_address = self.grpc_address[len("unix://"):] self.grpc_address = self.grpc_address[len("unix://"):]

View File

@ -21,20 +21,20 @@ TEST_CASE("is_unix_scheme matches", "[utils]")
{ {
SECTION("rvalue") SECTION("rvalue")
{ {
bool res = falco::utils::network::is_unix_scheme("unix:///var/run/falco.sock"); bool res = falco::utils::network::is_unix_scheme("unix:///run/falco/falco.sock");
REQUIRE(res); REQUIRE(res);
} }
SECTION("std::string") SECTION("std::string")
{ {
std::string url("unix:///var/run/falco.sock"); std::string url("unix:///run/falco/falco.sock");
bool res = falco::utils::network::is_unix_scheme(url); bool res = falco::utils::network::is_unix_scheme(url);
REQUIRE(res); REQUIRE(res);
} }
SECTION("char[]") SECTION("char[]")
{ {
char url[] = "unix:///var/run/falco.sock"; char url[] = "unix:///run/falco/falco.sock";
bool res = falco::utils::network::is_unix_scheme(url); bool res = falco::utils::network::is_unix_scheme(url);
REQUIRE(res); REQUIRE(res);
} }
@ -42,7 +42,7 @@ TEST_CASE("is_unix_scheme matches", "[utils]")
TEST_CASE("is_unix_scheme does not match", "[utils]") TEST_CASE("is_unix_scheme does not match", "[utils]")
{ {
bool res = falco::utils::network::is_unix_scheme("something:///var/run/falco.sock"); bool res = falco::utils::network::is_unix_scheme("something:///run/falco/falco.sock");
REQUIRE_FALSE(res); REQUIRE_FALSE(res);
} }