pkg: remove capnslog (#11616)

* pkg: remove capnslog

* CHANGELOG: function signature change
This commit is contained in:
Jingyi Hu
2020-02-12 11:15:41 -08:00
committed by GitHub
parent bb29615359
commit ae983523db
16 changed files with 81 additions and 61 deletions

View File

@@ -25,6 +25,7 @@ import (
"go.etcd.io/etcd/pkg/flags"
"github.com/spf13/cobra"
"go.uber.org/zap"
)
var epClusterEndpoints bool
@@ -85,7 +86,11 @@ type epHealth struct {
// epHealthCommandFunc executes the "endpoint-health" command.
func epHealthCommandFunc(cmd *cobra.Command, args []string) {
flags.SetPflagsFromEnv("ETCDCTL", cmd.InheritedFlags())
lg, err := zap.NewProduction()
if err != nil {
ExitWithError(ExitError, err)
}
flags.SetPflagsFromEnv(lg, "ETCDCTL", cmd.InheritedFlags())
initDisplayFromCmd(cmd)
sec := secureCfgFromCmd(cmd)

View File

@@ -113,6 +113,10 @@ func (*discardValue) Set(string) error { return nil }
func (*discardValue) Type() string { return "" }
func clientConfigFromCmd(cmd *cobra.Command) *clientConfig {
lg, err := zap.NewProduction()
if err != nil {
ExitWithError(ExitError, err)
}
fs := cmd.InheritedFlags()
if strings.HasPrefix(cmd.Use, "watch") {
// silence "pkg/flags: unrecognized environment variable ETCDCTL_WATCH_KEY=foo" warnings
@@ -120,7 +124,7 @@ func clientConfigFromCmd(cmd *cobra.Command) *clientConfig {
fs.AddFlag(&pflag.Flag{Name: "watch-key", Value: &discardValue{}})
fs.AddFlag(&pflag.Flag{Name: "watch-range-end", Value: &discardValue{}})
}
flags.SetPflagsFromEnv("ETCDCTL", fs)
flags.SetPflagsFromEnv(lg, "ETCDCTL", fs)
debug, err := cmd.Flags().GetBool("debug")
if err != nil {