From 3208b6e37fab46734ee87dd93b4ef93f623fd289 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mustafa=20Ak=C4=B1n?= Date: Sat, 6 Nov 2021 12:45:19 +0300 Subject: [PATCH] throttle period fix --- Dockerfile | 2 +- config.yaml | 2 +- main.go | 4 ++++ pkg/exporter/config.go | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 76df78df..af3b9a43 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.16 AS builder +FROM golang:1.17 AS builder ADD . /app WORKDIR /app diff --git a/config.yaml b/config.yaml index cfd89e8f..4c3de560 100644 --- a/config.yaml +++ b/config.yaml @@ -1,4 +1,4 @@ -logLevel: error +logLevel: debug logFormat: json route: routes: diff --git a/main.go b/main.go index a2d4735e..61060446 100644 --- a/main.go +++ b/main.go @@ -57,6 +57,10 @@ func main() { log.Fatal().Str("log_format", cfg.LogFormat).Msg("Unknown log format") } + if cfg.ThrottlePeriod == 0 { + cfg.ThrottlePeriod = 5 + } + kubeconfig, err := kube.GetKubernetesConfig() if err != nil { log.Fatal().Err(err).Msg("cannot get kubeconfig") diff --git a/pkg/exporter/config.go b/pkg/exporter/config.go index f5c8b5a8..160da4f8 100644 --- a/pkg/exporter/config.go +++ b/pkg/exporter/config.go @@ -12,7 +12,7 @@ type Config struct { // TODO: I am not sure what to do here. LogLevel string `yaml:"logLevel"` LogFormat string `yaml:"logFormat"` - ThrottlePeriod int64 `yaml:"throttlePeriod" default:"5""` + ThrottlePeriod int64 `yaml:"throttlePeriod"` Namespace string `yaml:"namespace"` LeaderElection kube.LeaderElectionConfig `yaml:"leaderElection"` Route Route `yaml:"route"`