From ed7ec9a4046e4c00e4555062750d5641a172dfee Mon Sep 17 00:00:00 2001 From: Dmitri Fedotov Date: Mon, 29 Jul 2024 12:43:45 +0300 Subject: [PATCH] fix port defitions --- internal/cmd/command.go | 6 +++--- internal/config/config.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/cmd/command.go b/internal/cmd/command.go index 7dc0b6d..7bc9ac0 100644 --- a/internal/cmd/command.go +++ b/internal/cmd/command.go @@ -62,8 +62,8 @@ func init() { rootCmd.PersistentFlags().StringVar(&cfg.NodeName, "nodename", "", "Node hostname") rootCmd.PersistentFlags().IntVar(&cfg.InterfaceMtu, "iface_mtu", 1500, "MTU size that replication interface should have") // rootCmd.PersistentFlags().StringSliceVar(&cfg.Peers, "peers", nil, "Resend ICMP frag-needed packets to this peer list (comma separated)") - rootCmd.PersistentFlags().IntVar(&cfg.MetricsPort, "metrics_port", 30040, "Port for Prometheus metrics") - rootCmd.PersistentFlags().IntVar(&cfg.HealthPort, "health_port", 30041, "Port for healthz") + rootCmd.PersistentFlags().StringVar(&cfg.MetricsPort, "metrics_port", ":30040", "Port for Prometheus metrics") + rootCmd.PersistentFlags().StringVar(&cfg.HealthPort, "health_port", ":30041", "Port for healthz") rootCmd.PersistentFlags().Uint16Var(&cfg.NfGroup, "nflog_group", 33, "NFLOG group") rootCmd.PersistentFlags().IntVar(&cfg.TimeToLive, "ttl", 1, "TTL for resent packets") rootCmd.PersistentFlags().IntVar(&cfg.ArpCacheTimeoutMinutes, "node-timeout-minutes", 5, "Timeout in minutes for node arp entry") @@ -105,7 +105,7 @@ func runRootCmd(cmd *cobra.Command, args []string) error { ctrl.SetLogger(log) managerOpts := manager.Options{ Metrics: metricsserver.Options{BindAddress: strconv.Itoa(viper.GetInt("metrics_port"))}, - HealthProbeBindAddress: ":" + strconv.Itoa(cfg.HealthPort), + HealthProbeBindAddress: cfg.HealthPort, } restConfig, err := config.GetConfigWithContext(cfg.KubeContext) if err != nil { diff --git a/internal/config/config.go b/internal/config/config.go index 92309c8..8b3a64d 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -28,8 +28,8 @@ type Config struct { // Peers []string InterfaceNames []string NodeName string - MetricsPort int - HealthPort int + MetricsPort string + HealthPort string TimeToLive int NfGroup uint16 KubeContext string