envoyproxy / xds-relay

Caching, aggregation, and relaying for xDS compliant clients and origin servers
Apache License 2.0
131 stars 29 forks source link

Do not print warn message when keep alive time is unset #216

Closed nak3 closed 3 years ago

nak3 commented 3 years ago

The warning message is always printed when keep alive time is unset. The current example config also causes validation error as:

$ ./bin/xds-relay  -m validate --aggregation-rules example/config-files/aggregation-rules.yaml -c example/config-files/xds-relay-bootstrap.yaml
{"level":"info","ts":1609554826.4375143,"logger":"upstream_client","msg":"Initiating upstream connection","json":{"address":"0.0.0.0:18000"}}
{"level":"warn","ts":1609554826.4375317,"msg":"Keepalive time parsing failed%!(EXTRA string=time: invalid duration \"\")","json":{},"stacktrace":"github.com/envoyproxy/xds-relay/internal/pkg/log.(*logger).Warn\n\t/home/knakayam/dev/xds-relay/internal/pkg/log/zap.go:95\ngithub.com/envoyproxy/xds-relay/internal/app/upstream.getKeepaliveParams\n\t/home/knakayam/dev/xds-relay/internal/app/upstream/client.go:379\ngithub.com/envoyproxy/xds-relay/internal/app/upstream.New\n\t/home/knakayam/dev/xds-relay/internal/app/upstream/client.go:107\ngithub.com/envoyproxy/xds-relay/internal/app/server.RunWithContext\n\t/home/knakayam/dev/xds-relay/internal/app/server/server.go:95\ngithub.com/envoyproxy/xds-relay/internal/app/server.Run\n\t/home/knakayam/dev/xds-relay/internal/app/server/server.go:46\nmain.glob..func1\n\t/home/knakayam/dev/xds-relay/main.go:45\ngithub.com/spf13/cobra.(*Command).execute\n\t/home/knakayam/.go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:846\ngithub.com/spf13/cobra.(*Command).ExecuteC\n\t/home/knakayam/.go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:950\ngithub.com/spf13/cobra.(*Command).Execute\n\t/home/knakayam/.go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:887\nmain.main\n\t/home/knakayam/dev/xds-relay/main.go:67\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:204"}

Hence this patch stops warning message when keep alive is unset and the default value (5m) is used.

Signed-off-by: Kenjiro Nakayama nakayamakenjiro@gmail.com