[VOL-2735]Durations should be specified as type time.Duration not int
Change-Id: Ibf1128aea75e9cb53f2bf15949215cf81829580b
diff --git a/internal/pkg/commands/log.go b/internal/pkg/commands/log.go
index d755d86..c745424 100644
--- a/internal/pkg/commands/log.go
+++ b/internal/pkg/commands/log.go
@@ -188,7 +188,7 @@
log.SetAllLogLevel(log.FatalLevel)
- client, err := kvstore.NewEtcdClient(GlobalConfig.KvStore, int(GlobalConfig.KvStoreConfig.Timeout.Seconds()), log.FatalLevel)
+ client, err := kvstore.NewEtcdClient(GlobalConfig.KvStore, GlobalConfig.KvStoreConfig.Timeout, log.FatalLevel)
if err != nil {
return nil, fmt.Errorf("Unable to create kvstore client %s", err)
}
@@ -196,7 +196,7 @@
// Already error checked during option processing
host, port, _ := splitEndpoint(GlobalConfig.KvStore, defaultKvHost, defaultKvPort)
- cm := config.NewConfigManager(client, supportedKvStoreType, host, port, int(GlobalConfig.KvStoreConfig.Timeout.Seconds()))
+ cm := config.NewConfigManager(client, supportedKvStoreType, host, port, GlobalConfig.KvStoreConfig.Timeout)
ctx, cancel := context.WithTimeout(context.Background(), GlobalConfig.KvStoreConfig.Timeout)
defer cancel()
@@ -313,7 +313,7 @@
log.SetAllLogLevel(log.FatalLevel)
- client, err := kvstore.NewEtcdClient(GlobalConfig.KvStore, int(GlobalConfig.KvStoreConfig.Timeout.Seconds()), log.FatalLevel)
+ client, err := kvstore.NewEtcdClient(GlobalConfig.KvStore, GlobalConfig.KvStoreConfig.Timeout, log.FatalLevel)
if err != nil {
return list
}
@@ -321,7 +321,7 @@
// Already error checked during option processing
host, port, _ := splitEndpoint(GlobalConfig.KvStore, defaultKvHost, defaultKvPort)
- cm := config.NewConfigManager(client, supportedKvStoreType, host, port, int(GlobalConfig.KvStoreConfig.Timeout.Seconds()))
+ cm := config.NewConfigManager(client, supportedKvStoreType, host, port, GlobalConfig.KvStoreConfig.Timeout)
ctx, cancel := context.WithTimeout(context.Background(), GlobalConfig.KvStoreConfig.Timeout)
defer cancel()
@@ -499,7 +499,7 @@
return fmt.Errorf(err.Error())
}
- client, err := kvstore.NewEtcdClient(GlobalConfig.KvStore, int(GlobalConfig.KvStoreConfig.Timeout.Seconds()), log.FatalLevel)
+ client, err := kvstore.NewEtcdClient(GlobalConfig.KvStore, GlobalConfig.KvStoreConfig.Timeout, log.FatalLevel)
if err != nil {
return fmt.Errorf("Unable to create kvstore client %s", err)
}
@@ -507,7 +507,7 @@
// Already error checked during option processing
host, port, _ := splitEndpoint(GlobalConfig.KvStore, defaultKvHost, defaultKvPort)
- cm := config.NewConfigManager(client, supportedKvStoreType, host, port, int(GlobalConfig.KvStoreConfig.Timeout.Seconds()))
+ cm := config.NewConfigManager(client, supportedKvStoreType, host, port, GlobalConfig.KvStoreConfig.Timeout)
var output []LogLevelOutput
@@ -606,7 +606,7 @@
log.SetAllLogLevel(log.FatalLevel)
- client, err := kvstore.NewEtcdClient(GlobalConfig.KvStore, int(GlobalConfig.KvStoreConfig.Timeout.Seconds()), log.FatalLevel)
+ client, err := kvstore.NewEtcdClient(GlobalConfig.KvStore, GlobalConfig.KvStoreConfig.Timeout, log.FatalLevel)
if err != nil {
return fmt.Errorf("Unable to create kvstore client %s", err)
}
@@ -614,7 +614,7 @@
// Already error checked during option processing
host, port, _ := splitEndpoint(GlobalConfig.KvStore, defaultKvHost, defaultKvPort)
- cm := config.NewConfigManager(client, supportedKvStoreType, host, port, int(GlobalConfig.KvStoreConfig.Timeout.Seconds()))
+ cm := config.NewConfigManager(client, supportedKvStoreType, host, port, GlobalConfig.KvStoreConfig.Timeout)
ctx, cancel := context.WithTimeout(context.Background(), GlobalConfig.KvStoreConfig.Timeout)
defer cancel()
@@ -728,7 +728,7 @@
return fmt.Errorf("%s", err)
}
- client, err := kvstore.NewEtcdClient(GlobalConfig.KvStore, int(GlobalConfig.KvStoreConfig.Timeout.Seconds()), log.FatalLevel)
+ client, err := kvstore.NewEtcdClient(GlobalConfig.KvStore, GlobalConfig.KvStoreConfig.Timeout, log.FatalLevel)
if err != nil {
return fmt.Errorf("Unable to create kvstore client %s", err)
}
@@ -736,7 +736,7 @@
// Already error checked during option processing
host, port, _ := splitEndpoint(GlobalConfig.KvStore, defaultKvHost, defaultKvPort)
- cm := config.NewConfigManager(client, supportedKvStoreType, host, port, int(GlobalConfig.KvStoreConfig.Timeout.Seconds()))
+ cm := config.NewConfigManager(client, supportedKvStoreType, host, port, GlobalConfig.KvStoreConfig.Timeout)
var output []LogLevelOutput
@@ -794,7 +794,7 @@
log.SetAllLogLevel(log.FatalLevel)
- client, err := kvstore.NewEtcdClient(GlobalConfig.KvStore, int(GlobalConfig.KvStoreConfig.Timeout.Seconds()), log.FatalLevel)
+ client, err := kvstore.NewEtcdClient(GlobalConfig.KvStore, GlobalConfig.KvStoreConfig.Timeout, log.FatalLevel)
if err != nil {
return fmt.Errorf("Unable to create kvstore client %s", err)
}
@@ -802,7 +802,7 @@
// Already error checked during option processing
host, port, _ := splitEndpoint(GlobalConfig.KvStore, defaultKvHost, defaultKvPort)
- cm := config.NewConfigManager(client, supportedKvStoreType, host, port, int(GlobalConfig.KvStoreConfig.Timeout.Seconds()))
+ cm := config.NewConfigManager(client, supportedKvStoreType, host, port, GlobalConfig.KvStoreConfig.Timeout)
ctx, cancel := context.WithTimeout(context.Background(), GlobalConfig.KvStoreConfig.Timeout)
defer cancel()