From 72bec60c49ec841434ba426e0dcdd781e0838c5a Mon Sep 17 00:00:00 2001 From: i344628 Date: Tue, 3 Dec 2019 16:22:01 +0530 Subject: [PATCH] Skiped flag.Parse as it interferes with the root command. Switched GO111MODULE=on --- .ci/check | 1 + .ci/test | 1 + cmd/probe.go | 2 ++ cmd/root.go | 4 ++-- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.ci/check b/.ci/check index 37e537de..f00eb288 100755 --- a/.ci/check +++ b/.ci/check @@ -43,6 +43,7 @@ if [[ "${SOURCE_PATH}" != *"src/${REPOSITORY}" ]]; then export GOPATH="${SOURCE_PATH}/tmp" export GOBIN="${SOURCE_PATH}/tmp/bin" export PATH="${GOBIN}:${PATH}" + export GO111MODULE=on fi # Install Golint (linting tool). diff --git a/.ci/test b/.ci/test index 673073e3..23cb0106 100755 --- a/.ci/test +++ b/.ci/test @@ -48,6 +48,7 @@ if [[ "${SOURCE_PATH}" != *"src/${REPOSITORY}" ]]; then export GOPATH="${SOURCE_PATH}/tmp" export GOBIN="${SOURCE_PATH}/tmp/bin" export PATH="${GOBIN}:${PATH}" + export GO111MODULE=on fi # Install Ginkgo (test framework) to be able to execute the tests. diff --git a/cmd/probe.go b/cmd/probe.go index 42299dae..a8e0ac67 100644 --- a/cmd/probe.go +++ b/cmd/probe.go @@ -50,6 +50,8 @@ func init() { } func runProbe(cmd *cobra.Command, args []string) { + klog.V(5).Info("Running probe command") + // set up signals so we handle the first shutdown signal gracefully stopCh := setupSignalHandler() deps, err := scaler.LoadProbeDependantsListFile(configFile) diff --git a/cmd/root.go b/cmd/root.go index ffdd36ee..3e2d8971 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -100,12 +100,12 @@ func init() { rootCmd.Flags().StringVar(&strWatchDuration, "watch-duration", defaultWatchDuration, "The duration to watch dependencies after the service is ready.") klog.InitFlags(nil) - flag.Parse() + flag.Set("logtostderr", "true") pflag.CommandLine.AddGoFlagSet(flag.CommandLine) } func runRoot(cmd *cobra.Command, args []string) { - flag.Set("logtostderr", "true") + klog.V(5).Info("Running root command") watchDuration, err := time.ParseDuration(strWatchDuration) if err != nil {