diff --git a/cli/cmd/root.go b/cli/cmd/root.go index 01e89117c3424d3c1f880e1265c0e46418913087..0f5744bff53c281f1c6e797f862ae18860eba474 100644 --- a/cli/cmd/root.go +++ b/cli/cmd/root.go @@ -46,7 +46,7 @@ import ( var cfgFile string var verbose bool -var gRPCPassthrough bool +var noGRPCPassthrough bool var loglevel string var grpcPort string var cliPnd string @@ -87,7 +87,7 @@ func init() { rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (./.gosdnc.toml)") rootCmd.PersistentFlags().StringVarP(&loglevel, "log-level", "l", "", "log level 'debug' or 'trace'") rootCmd.PersistentFlags().BoolVar(&verbose, "verbose", false, "show mne and sbi info") - rootCmd.PersistentFlags().BoolVar(&gRPCPassthrough, "grpcPassthrough", true, "set the default resolve scheme for grpc to passthrough, default is true") + rootCmd.PersistentFlags().BoolVar(&noGRPCPassthrough, "noGRPCPassthrough", true, "set the default resolve scheme for grpc to not use passthrough, default is false") rootCmd.Flags().StringVar(&grpcPort, "grpc-port", "55055", "port for gRPC NBI") } @@ -150,11 +150,11 @@ func initConfig() { cliPnd = uuid.New().String() } - 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.") } adapter, err := adapter.NewPndAdapter(cliPnd, viper.GetString("controllerAPIEndpoint")) diff --git a/controller/cmd/root.go b/controller/cmd/root.go index cc00b490347ae0b17540e4c2034cc84cabfce9a2..c2dd7fb6c2ff15238c3a6a630fa1d532d31867dc 100644 --- a/controller/cmd/root.go +++ b/controller/cmd/root.go @@ -52,7 +52,7 @@ var csbiOrchestrator string var pluginRegistry string var pluginFolder string var security string -var gRPCPassthrough bool +var noGRPCPassthrough bool // rootCmd represents the base command when called without any subcommands. var rootCmd = &cobra.Command{ @@ -87,7 +87,7 @@ func init() { rootCmd.Flags().StringVar(&pluginRegistry, "plugin-registry", "", "plugin registry address") rootCmd.Flags().StringVar(&pluginFolder, "plugin-folder", "", "folder holding all goSDN specific plugins") rootCmd.Flags().StringVarP(&security, "security", "s", "", "security level 'secure' or 'insecure'") - rootCmd.Flags().BoolVar(&gRPCPassthrough, "grpcPassthrough", true, "set the default resolve scheme for grpc to passthrough, default is true") + rootCmd.Flags().BoolVar(&noGRPCPassthrough, "noGRPCPassthrough", false, "set the default resolve scheme for grpc to not use passthrough, default is false") } const ( diff --git a/controller/controller.go b/controller/controller.go index f79d5ff45167bcea92e333632421e8a53a572c82..7eca04715b4fe5685a4173881171e3b3cc1e0fb6 100644 --- a/controller/controller.go +++ b/controller/controller.go @@ -202,12 +202,12 @@ func setupPluginRegistryClient() rpb.PluginRegistryServiceClient { } func startGrpc() error { - passthrough := viper.GetBool("passthrough") - if passthrough { + noPassthrough := viper.GetBool("noGRPCPassthrough") + if noPassthrough { + 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.") } socket := viper.GetString("socket")