Skip to content
Snippets Groups Projects

Switch passthrough flags to work the other way

Merged Neil-Jocelyn Schark requested to merge rework-passthrough-flags into master
3 files
+ 12
12
Compare changes
  • Side-by-side
  • Inline
Files
3
+ 4
4
@@ -55,15 +55,15 @@ func main() {
certFile := flag.String("certFile", "", "location of the gNMI cert file (overwrites settings in config file)")
keyFile := flag.String("keyFile", "", "location of the gNMI key file (overwrites settings in config file)")
caFile := flag.String("caFile", "", "location of the gNMI ca file (overwrites settings in config file)")
gRPCPassthrough := flag.Bool("grpcPassthrough", true, "set the default resolve scheme for grpc to passthrough, default is true")
noGRPCPassthrough := flag.Bool("noGRPCPassthrough", true, "set the default resolve scheme for grpc to not use passthrough, default is false")
flag.Parse()
if *gRPCPassthrough {
if *noGRPCPassthrough {
log.Info("gRPC default resolver scheme is not set to passthrough. This might cause issues with the gRPC connection when no real DNS server is available as each gRPC requests requires a DNS request.")
} else {
log.Info("Setting gRPC default resolver scheme to passthrough. No DNS queries are being made when doing a gRPC request.")
resolver.SetDefaultScheme("passthrough")
} else {
log.Info("gRPC default resolver scheme is not set to passthrough. This might cause issues with the gRPC connection when no real DNS server is available as each gRPC requests requires a DNS request.")
}
// parse string, this is built-in feature of logrus
Loading