Skip to content

Commit

Permalink
update(cmd): make unix:// prefix optional for --client-socket
Browse files Browse the repository at this point in the history
That makes flag usage less error prone.

Signed-off-by: Leonardo Grasso <[email protected]>
  • Loading branch information
leogr authored and poiana committed Jan 26, 2021
1 parent 31258a2 commit 4577e13
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/falco-exporter/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"io/ioutil"
"log"
"net/http"
"strings"
"time"

"github.com/falcosecurity/client-go/pkg/client"
Expand Down Expand Up @@ -61,6 +62,9 @@ func main() {
config.UnixSocketPath = ""
log.Printf("connecting to gRPC server at %s:%d (timeout %s)", config.Hostname, config.Port, timeout)
} else {
if !strings.HasPrefix("unix://", config.UnixSocketPath) {
config.UnixSocketPath = "unix://" + config.UnixSocketPath
}
log.Printf("connecting to gRPC server at %s (timeout %s)", config.UnixSocketPath, timeout)
}

Expand Down

0 comments on commit 4577e13

Please sign in to comment.