Skip to content
Snippets Groups Projects
Commit 2b0d61eb authored by Neil-Jocelyn Schark's avatar Neil-Jocelyn Schark
Browse files

Switch passthrough flags to work the other way

See merge request !143
parent 86e90455
Branches
No related tags found
1 merge request!143Switch passthrough flags to work the other way
Pipeline #202218 passed
...@@ -83,8 +83,8 @@ Usage of goKMS: ...@@ -83,8 +83,8 @@ Usage of goKMS:
address to bind gNMI to (overwrites settings in config file) (default ":7030") address to bind gNMI to (overwrites settings in config file) (default ":7030")
-gnmiTLS -gnmiTLS
If true do use TLS for gNMI, paths to ca, cert and key must be set aswell (overwrites settings in config file) If true do use TLS for gNMI, paths to ca, cert and key must be set aswell (overwrites settings in config file)
-grpcPassthrough -noGRPCPassthrough
set the default resolve scheme for grpc to passthrough, default is true set the default resolve scheme for grpc to not use passthrough, default is false
-keyFile string -keyFile string
location of the gNMI key file (overwrites settings in config file) location of the gNMI key file (overwrites settings in config file)
-kms_config string -kms_config string
...@@ -175,8 +175,8 @@ Also available are the following arguments: ...@@ -175,8 +175,8 @@ Also available are the following arguments:
Usage of quantumlayer: Usage of quantumlayer:
-config string -config string
path to the config file path to the config file
-grpcPassthrough -noGRPCPassthrough
set the default resolve scheme for grpc to passthrough, default is true (default true) set the default resolve scheme for grpc to not use passthrough, default is false (default false)
-log string -log string
logrus lof level (debug, info, warn, error, fatal, panic), default: info (default "info") logrus lof level (debug, info, warn, error, fatal, panic), default: info (default "info")
``` ```
......
...@@ -55,15 +55,15 @@ func main() { ...@@ -55,15 +55,15 @@ func main() {
certFile := flag.String("certFile", "", "location of the gNMI cert file (overwrites settings in config file)") 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)") 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)") 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() 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.") log.Info("Setting gRPC default resolver scheme to passthrough. No DNS queries are being made when doing a gRPC request.")
resolver.SetDefaultScheme("passthrough") 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 // parse string, this is built-in feature of logrus
......
...@@ -27,15 +27,15 @@ type Config struct { ...@@ -27,15 +27,15 @@ type Config struct {
func main() { func main() {
configPath := flag.String("config", "", "path to the config file") configPath := flag.String("config", "", "path to the config file")
logLevel := flag.String("log", "info", "logrus lof level (debug, info, warn, error, fatal, panic), default: info") logLevel := flag.String("log", "info", "logrus lof level (debug, info, warn, error, fatal, panic), default: info")
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() flag.Parse()
if *gRPCPassthrough { if *noGRPCPassthrough {
logrus.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 {
logrus.Info("Setting gRPC default resolver scheme to passthrough. No DNS queries are being made when doing a gRPC request.") logrus.Info("Setting gRPC default resolver scheme to passthrough. No DNS queries are being made when doing a gRPC request.")
resolver.SetDefaultScheme("passthrough") resolver.SetDefaultScheme("passthrough")
} else {
logrus.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.")
} }
if *configPath == "" { if *configPath == "" {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment