diff --git a/0001-Convert-int-to-string-using-strconv.Itoa.patch b/0001-Convert-int-to-string-using-strconv.Itoa.patch new file mode 100644 index 0000000000000000000000000000000000000000..a2178d7daf0e7c0a531a5b1b18c7720261c4d10c --- /dev/null +++ b/0001-Convert-int-to-string-using-strconv.Itoa.patch @@ -0,0 +1,61 @@ +From 80c8dfe084f44eb660aa1af5b5d49e27e1dfd11e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= +Date: Mon, 10 Aug 2020 15:09:08 +0200 +Subject: [PATCH] Convert int to string using strconv.Itoa +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +See https://github.com/golang/go/issues/32479 + +Signed-off-by: Robert-André Mauchin +--- + etcdserver/api/v2store/store_test.go | 3 ++- + wal/wal_test.go | 3 ++- + 2 files changed, 4 insertions(+), 2 deletions(-) + +diff --git a/etcdserver/api/v2store/store_test.go b/etcdserver/api/v2store/store_test.go +index 76ec02d4e..0b1e9dad1 100644 +--- a/etcdserver/api/v2store/store_test.go ++++ b/etcdserver/api/v2store/store_test.go +@@ -15,6 +15,7 @@ + package v2store_test + + import ( ++ "strconv" + "testing" + "time" + +@@ -844,7 +845,7 @@ func TestStoreWatchSlowConsumer(t *testing.T) { + s.Watch("/foo", true, true, 0) // stream must be true + // Fill watch channel with 100 events + for i := 1; i <= 100; i++ { +- s.Set("/foo", false, string(i), v2store.TTLOptionSet{ExpireTime: v2store.Permanent}) // ok ++ s.Set("/foo", false, strconv.Itoa(i), v2store.TTLOptionSet{ExpireTime: v2store.Permanent}) // ok + } + // testutil.AssertEqual(t, s.WatcherHub.count, int64(1)) + s.Set("/foo", false, "101", v2store.TTLOptionSet{ExpireTime: v2store.Permanent}) // ok +diff --git a/wal/wal_test.go b/wal/wal_test.go +index f457dbf3c..8e8a252a0 100644 +--- a/wal/wal_test.go ++++ b/wal/wal_test.go +@@ -25,6 +25,7 @@ import ( + "path/filepath" + "reflect" + "regexp" ++ "strconv" + "testing" + + "go.etcd.io/etcd/pkg/fileutil" +@@ -239,7 +240,7 @@ func TestVerify(t *testing.T) { + + // make 5 separate files + for i := 0; i < 5; i++ { +- es := []raftpb.Entry{{Index: uint64(i), Data: []byte("waldata" + string(i+1))}} ++ es := []raftpb.Entry{{Index: uint64(i), Data: []byte("waldata" + strconv.Itoa(i+1))}} + if err = w.Save(raftpb.HardState{}, es); err != nil { + t.Fatal(err) + } +-- +2.26.2 + diff --git a/0001-hack-etcdmain-to-generate-etcd.1.patch b/0001-hack-etcdmain-to-generate-etcd.1.patch deleted file mode 100644 index 8f55e5072c3524ac199f3c098c698844db517e0e..0000000000000000000000000000000000000000 --- a/0001-hack-etcdmain-to-generate-etcd.1.patch +++ /dev/null @@ -1,264 +0,0 @@ -diff -up etcd-3.4.3/etcdmain/config.go.orig etcd-3.4.3/etcdmain/config.go ---- etcd-3.4.3/etcdmain/config.go.orig 2019-10-23 19:11:46.000000000 +0200 -+++ etcd-3.4.3/etcdmain/config.go 2020-02-06 01:16:58.443641282 +0100 -@@ -123,14 +123,15 @@ func newConfig() *config { - ), - } - -- fs := cfg.cf.flagSet -- fs.Usage = func() { -+ fs := InitFlagSet(cfg.cf.flagSet) -+ cfg.cf.flagSet.Usage = func() { - fmt.Fprintln(os.Stderr, usageline) - } - - fs.StringVar(&cfg.configFile, "config-file", "", "Path to the server configuration file. Note that if a configuration file is provided, other command line flags and environment variables will be ignored.") - - // member -+ fs.AddGroup("member") - fs.StringVar(&cfg.ec.Dir, "data-dir", cfg.ec.Dir, "Path to the data directory.") - fs.StringVar(&cfg.ec.WalDir, "wal-dir", cfg.ec.WalDir, "Path to the dedicated wal directory.") - fs.Var( -@@ -163,7 +164,7 @@ func newConfig() *config { - fs.DurationVar(&cfg.ec.GRPCKeepAliveInterval, "grpc-keepalive-interval", cfg.ec.GRPCKeepAliveInterval, "Frequency duration of server-to-client ping to check if a connection is alive (0 to disable).") - fs.DurationVar(&cfg.ec.GRPCKeepAliveTimeout, "grpc-keepalive-timeout", cfg.ec.GRPCKeepAliveTimeout, "Additional duration of wait before closing a non-responsive connection (0 to disable).") - -- // clustering -+ fs.AddGroup("clustering") - fs.Var( - flags.NewUniqueURLsWithExceptions(embed.DefaultInitialAdvertisePeerURLs, ""), - "initial-advertise-peer-urls", -@@ -188,7 +189,7 @@ func newConfig() *config { - fs.BoolVar(&cfg.ec.EnableV2, "enable-v2", cfg.ec.EnableV2, "Accept etcd V2 client requests.") - fs.BoolVar(&cfg.ec.PreVote, "pre-vote", cfg.ec.PreVote, "Enable to run an additional Raft election phase.") - -- // proxy -+ fs.AddGroup("proxy") - fs.Var(cfg.cf.proxy, "proxy", fmt.Sprintf("Valid values include %q", cfg.cf.proxy.Valids())) - fs.UintVar(&cfg.cp.ProxyFailureWaitMs, "proxy-failure-wait", cfg.cp.ProxyFailureWaitMs, "Time (in milliseconds) an endpoint will be held in a failed state.") - fs.UintVar(&cfg.cp.ProxyRefreshIntervalMs, "proxy-refresh-interval", cfg.cp.ProxyRefreshIntervalMs, "Time (in milliseconds) of the endpoints refresh interval.") -@@ -196,7 +197,7 @@ func newConfig() *config { - fs.UintVar(&cfg.cp.ProxyWriteTimeoutMs, "proxy-write-timeout", cfg.cp.ProxyWriteTimeoutMs, "Time (in milliseconds) for a write to timeout.") - fs.UintVar(&cfg.cp.ProxyReadTimeoutMs, "proxy-read-timeout", cfg.cp.ProxyReadTimeoutMs, "Time (in milliseconds) for a read to timeout.") - -- // security -+ fs.AddGroup("security") - fs.StringVar(&cfg.ec.ClientTLSInfo.CertFile, "cert-file", "", "Path to the client server TLS cert file.") - fs.StringVar(&cfg.ec.ClientTLSInfo.KeyFile, "key-file", "", "Path to the client server TLS key file.") - fs.BoolVar(&cfg.ec.ClientTLSInfo.ClientCertAuth, "client-cert-auth", false, "Enable client cert authentication.") -@@ -222,7 +223,7 @@ func newConfig() *config { - ) - fs.Var(flags.NewUniqueStringsValue("*"), "host-whitelist", "Comma-separated acceptable hostnames from HTTP client requests, if server is not secure (empty means allow all).") - -- // logging -+ fs.AddGroup("logging") - fs.StringVar(&cfg.ec.Logger, "logger", "capnslog", "Specify 'zap' for structured logging or 'capnslog'. WARN: 'capnslog' is being deprecated in v3.5.") - fs.Var(flags.NewUniqueStringsValue(embed.DefaultLogOutput), "log-output", "[TO BE DEPRECATED IN v3.5] use '--log-outputs'.") - fs.Var(flags.NewUniqueStringsValue(embed.DefaultLogOutput), "log-outputs", "Specify 'stdout' or 'stderr' to skip journald logging even when running under systemd, or list of comma separated output targets.") -@@ -230,26 +231,26 @@ func newConfig() *config { - fs.StringVar(&cfg.ec.LogLevel, "log-level", logutil.DefaultLogLevel, "Configures log level. Only supports debug, info, warn, error, panic, or fatal. Default 'info'.") - fs.StringVar(&cfg.ec.LogPkgLevels, "log-package-levels", "", "[TO BE DEPRECATED IN v3.5] Specify a particular log level for each etcd package (eg: 'etcdmain=CRITICAL,etcdserver=DEBUG').") - -- // version -+ fs.AddGroup("version") - fs.BoolVar(&cfg.printVersion, "version", false, "Print the version and exit.") - - fs.StringVar(&cfg.ec.AutoCompactionRetention, "auto-compaction-retention", "0", "Auto compaction retention for mvcc key value store. 0 means disable auto compaction.") - fs.StringVar(&cfg.ec.AutoCompactionMode, "auto-compaction-mode", "periodic", "interpret 'auto-compaction-retention' one of: periodic|revision. 'periodic' for duration based retention, defaulting to hours if no time unit is provided (e.g. '5m'). 'revision' for revision number based retention.") - -- // pprof profiler via HTTP -+ fs.AddGroup("profiling") - fs.BoolVar(&cfg.ec.EnablePprof, "enable-pprof", false, "Enable runtime profiling data via HTTP server. Address is at client URL + \"/debug/pprof/\"") - - // additional metrics - fs.StringVar(&cfg.ec.Metrics, "metrics", cfg.ec.Metrics, "Set level of detail for exported metrics, specify 'extensive' to include histogram metrics") - -- // auth -+ fs.AddGroup("auth") - fs.StringVar(&cfg.ec.AuthToken, "auth-token", cfg.ec.AuthToken, "Specify auth token specific options.") - fs.UintVar(&cfg.ec.BcryptCost, "bcrypt-cost", cfg.ec.BcryptCost, "Specify bcrypt algorithm cost factor for auth password hashing.") - -- // gateway -+ fs.AddGroup("gateway") - fs.BoolVar(&cfg.ec.EnableGRPCGateway, "enable-grpc-gateway", true, "Enable GRPC gateway.") - -- // experimental -+ fs.AddGroup("experimental") - fs.BoolVar(&cfg.ec.ExperimentalInitialCorruptCheck, "experimental-initial-corrupt-check", cfg.ec.ExperimentalInitialCorruptCheck, "Enable to check data corruption before serving any client/peer traffic.") - fs.DurationVar(&cfg.ec.ExperimentalCorruptCheckTime, "experimental-corrupt-check-time", cfg.ec.ExperimentalCorruptCheckTime, "Duration of time between cluster corruption check passes.") - fs.StringVar(&cfg.ec.ExperimentalEnableV2V3, "experimental-enable-v2v3", cfg.ec.ExperimentalEnableV2V3, "v3 prefix for serving emulated v2 state.") -@@ -257,9 +258,12 @@ func newConfig() *config { - fs.BoolVar(&cfg.ec.ExperimentalEnableLeaseCheckpoint, "experimental-enable-lease-checkpoint", false, "Enable to persist lease remaining TTL to prevent indefinite auto-renewal of long lived leases.") - fs.IntVar(&cfg.ec.ExperimentalCompactionBatchLimit, "experimental-compaction-batch-limit", cfg.ec.ExperimentalCompactionBatchLimit, "Sets the maximum revisions deleted in each compaction batch.") - -- // unsafe -+ fs.AddGroup("unsafe") - fs.BoolVar(&cfg.ec.ForceNewCluster, "force-new-cluster", false, "Force to create a new one member cluster.") - -+ fs.GenMan() -+ os.Exit(0) -+ - // ignored - for _, f := range cfg.ignored { - fs.Var(&flags.IgnoredFlag{Name: f}, f, "") -diff -up etcd-3.4.3/etcdmain/fake_flagset.go.orig etcd-3.4.3/etcdmain/fake_flagset.go ---- etcd-3.4.3/etcdmain/fake_flagset.go.orig 2020-02-06 01:14:12.639989665 +0100 -+++ etcd-3.4.3/etcdmain/fake_flagset.go 2020-02-06 01:14:12.639989665 +0100 -@@ -0,0 +1,157 @@ -+package etcdmain -+ -+import ( -+ "flag" -+ "fmt" -+ "strconv" -+ "strings" -+ "time" -+) -+ -+type flagInfo struct { -+ value fmt.Stringer -+ name string -+ usage string -+} -+ -+type stringValue string -+ -+func (s *stringValue) String() string { return string(*s) } -+ -+type uintValue uint -+ -+func (i *uintValue) String() string { return strconv.FormatUint(uint64(*i), 10) } -+ -+type uint64Value uint64 -+ -+func (i *uint64Value) String() string { return strconv.FormatUint(uint64(*i), 10) } -+ -+type int64Value int64 -+ -+func (i *int64Value) String() string { return strconv.FormatInt(int64(*i), 10) } -+ -+type durationValue time.Duration -+ -+func (d *durationValue) String() string { return (*time.Duration)(d).String() } -+ -+type boolValue bool -+ -+func (b *boolValue) String() string { return strconv.FormatBool(bool(*b)) } -+ -+type FakeFlagSet struct { -+ fs *flag.FlagSet -+ flags map[string][]flagInfo -+ groups []string -+ lastGroup string -+} -+ -+func InitFlagSet(fs *flag.FlagSet) *FakeFlagSet { -+ return &FakeFlagSet{ -+ fs: fs, -+ flags: make(map[string][]flagInfo), -+ } -+} -+ -+func (fs *FakeFlagSet) AddGroup(name string) { -+ fs.flags[name] = nil -+ fs.groups = append(fs.groups, name) -+ fs.lastGroup = name -+} -+ -+func (fs *FakeFlagSet) Var(value flag.Value, name string, usage string) { -+ fs.flags[fs.lastGroup] = append(fs.flags[fs.lastGroup], flagInfo{ -+ value: value, -+ name: name, -+ usage: usage, -+ }) -+ fs.fs.Var(value, name, usage) -+} -+ -+func (fs *FakeFlagSet) StringVar(p *string, name string, value string, usage string) { -+ fs.flags[fs.lastGroup] = append(fs.flags[fs.lastGroup], flagInfo{ -+ value: (*stringValue)(&value), -+ name: name, -+ usage: usage, -+ }) -+ fs.fs.StringVar(p, name, value, usage) -+} -+ -+// -- int Value -+type intValue int -+ -+func (i *intValue) String() string { return strconv.Itoa(int(*i)) } -+ -+func (fs *FakeFlagSet) UintVar(p *uint, name string, value uint, usage string) { -+ fs.flags[fs.lastGroup] = append(fs.flags[fs.lastGroup], flagInfo{ -+ value: (*uintValue)(&value), -+ name: name, -+ usage: usage, -+ }) -+ fs.fs.UintVar(p, name, value, usage) -+} -+ -+func (fs *FakeFlagSet) Uint64Var(p *uint64, name string, value uint64, usage string) { -+ fs.flags[fs.lastGroup] = append(fs.flags[fs.lastGroup], flagInfo{ -+ value: (*uint64Value)(&value), -+ name: name, -+ usage: usage, -+ }) -+ fs.fs.Uint64Var(p, name, value, usage) -+} -+ -+func (fs *FakeFlagSet) IntVar(p *int, name string, value int, usage string) { -+ fs.flags[fs.lastGroup] = append(fs.flags[fs.lastGroup], flagInfo{ -+ value: (*intValue)(&value), -+ name: name, -+ usage: usage, -+ }) -+ fs.fs.IntVar(p, name, value, usage) -+} -+ -+func (fs *FakeFlagSet) Int64Var(p *int64, name string, value int64, usage string) { -+ fs.flags[fs.lastGroup] = append(fs.flags[fs.lastGroup], flagInfo{ -+ value: (*int64Value)(&value), -+ name: name, -+ usage: usage, -+ }) -+ fs.fs.Int64Var(p, name, value, usage) -+} -+ -+func (fs *FakeFlagSet) DurationVar(p *time.Duration, name string, value time.Duration, usage string) { -+ fs.flags[fs.lastGroup] = append(fs.flags[fs.lastGroup], flagInfo{ -+ value: (*durationValue)(&value), -+ name: name, -+ usage: usage, -+ }) -+ fs.fs.DurationVar(p, name, value, usage) -+} -+ -+func (fs *FakeFlagSet) BoolVar(p *bool, name string, value bool, usage string) { -+ fs.flags[fs.lastGroup] = append(fs.flags[fs.lastGroup], flagInfo{ -+ value: (*boolValue)(&value), -+ name: name, -+ usage: usage, -+ }) -+ fs.fs.BoolVar(p, name, value, usage) -+} -+ -+func (fs *FakeFlagSet) GenMan() { -+ fmt.Printf(".TH \"ETCD\" \"1\" \" etcd User Manuals\" \"Etcd contributors\" \"Nov 2017\" \"\"\n") -+ fmt.Printf(".SH NAME:\netcd - Distributed reliable key-value store for the most critical data of a distributed system\n\n") -+ fmt.Printf(".SH USAGE:\netcd [flags]\n\n") -+ fmt.Printf(".SH DESCRIPTION:\nEtcd is a distributed key-value store designed to reliably and quickly preserve and provide access to critical data. It enables reliable distributed coordination through distributed locking, leader elections, and write barriers. An etcd cluster is intended for high availability and permanent data storage and retrieval.\n\n") -+ fmt.Printf(".SH GENERAL OPTIONS\n\n") -+ for _, group := range fs.groups { -+ fmt.Printf(".I %v flags\n\n", strings.Title(group)) -+ for _, flag := range fs.flags[group] { -+ var flagstr string -+ if len(flag.name) == 1 { -+ flagstr = "-" + flag.name -+ } else { -+ flagstr = "--" + flag.name -+ } -+ fmt.Printf(".RS\n\\fB%v %v\\fP\n %v\n\n.RE\n", flagstr, flag.value.String(), flag.usage) -+ } -+ } -+ fmt.Printf(".SH SEE ALSO:\n\\fBetcdctl(1)\\fP, \\fBetcdctl2(1)\\fP, \\fBetcdctl3(1)\\fP\n\n") -+} diff --git a/0001-hack-to-generate-man-pages.patch b/0001-hack-to-generate-man-pages.patch deleted file mode 100644 index b77a8494cb14a4d8fbdaeac0cc9d410fb075e0cc..0000000000000000000000000000000000000000 --- a/0001-hack-to-generate-man-pages.patch +++ /dev/null @@ -1,120 +0,0 @@ -diff -up etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdctl/ctlv2/ctl.go.hack2 etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdctl/ctlv2/ctl.go ---- etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdctl/ctlv2/ctl.go.hack2 2019-03-12 20:09:09.000000000 +0100 -+++ etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdctl/ctlv2/ctl.go 2019-03-14 20:20:04.887079104 +0100 -@@ -36,6 +36,68 @@ func Start() { - } - app.Usage = "A simple command line client for etcd." - -+ cli.AppHelpTemplate = `.TH "ETCD" "1" " etcd User Manuals" "Etcd contributors" "Nov 2017" "" -+.SH NAME: -+{{.Name}} - {{.Usage}} -+ -+{{if .Version}} -+.SH VERSION: -+ {{.Version}} -+{{end}} -+ -+.SH USAGE: -+ {{.HelpName}} {{if .VisibleFlags}}[global options]{{end}}{{if .Commands}} command [command options]{{end}} {{if .ArgsUsage}}{{.ArgsUsage}}{{else}}[arguments...]{{end}} -+ {{if .Commands}} -+ -+.SH COMMANDS: -+{{range .Commands}}{{if not .HideHelp}}\fB{{ .Name }}\fP{{ "\n\t\t\t" }}{{.Usage}}{{ "\n" }} -+ -+{{end}}{{end}}{{end}}{{if .VisibleFlags}} -+ -+.SH GLOBAL OPTIONS: -+{{range .VisibleFlags}}{{ . }} -+ -+{{end}}{{end}} -+ -+.SH SEE ALSO -+{{range .Commands}}{{if not .HideHelp}}{{if ne .Name "help" }}\fBetcdctl-{{ .Name }}(1)\fP, -+{{end}}{{end}}{{end}} -+` -+ -+ cli.CommandHelpTemplate = `.TH "ETCD" "1" " etcd User Manuals" "Etcd contributors" "Nov 2017" "" -+.SH NAME: -+ {{.HelpName}} - {{.Usage}} -+ -+.SH USAGE: -+ {{.HelpName}}{{if .VisibleFlags}} [command options]{{end}} {{if .ArgsUsage}}{{.ArgsUsage}}{{else}}[arguments...]{{end}} -+ -+{{if .VisibleFlags}} -+.SH OPTIONS: -+ {{range .VisibleFlags}}{{.}} -+ {{end}}{{end}} -+` -+ -+ -+ cli.SubcommandHelpTemplate = `.TH "ETCD" "1" " etcd User Manuals" "Etcd contributors" "Nov 2017" "" -+.SH NAME: -+ {{.HelpName}} - {{.Usage}} -+ -+.SH USAGE: -+ {{.HelpName}} command{{if .VisibleFlags}} [command options]{{end}} {{if .ArgsUsage}}{{.ArgsUsage}}{{else}}[arguments...]{{end}} -+ -+.SH COMMANDS: -+{{range .VisibleCategories}}{{if .Name}} -+{{.Name}}:{{end}}{{range .VisibleCommands}} -+\fB{{ .Name }}\fP{{"\n\t\t\t"}}{{.Usage}}{{ "\n" }}{{end}} -+{{end}} -+ -+{{if .VisibleFlags}} -+.SH OPTIONS: -+{{range .VisibleFlags}}{{.}} -+{{end}}{{end}} -+` -+ -+ - app.Flags = []cli.Flag{ - cli.BoolFlag{Name: "debug", Usage: "output cURL commands which can be used to reproduce the request"}, - cli.BoolFlag{Name: "no-sync", Usage: "don't synchronize cluster information before sending request"}, -diff -up etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdctl/ctlv3/ctl_nocov.go.hack2 etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdctl/ctlv3/ctl_nocov.go ---- etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdctl/ctlv3/ctl_nocov.go.hack2 2019-03-14 20:20:04.888079103 +0100 -+++ etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdctl/ctlv3/ctl_nocov.go 2019-03-14 20:32:35.376178988 +0100 -@@ -16,13 +16,20 @@ - - package ctlv3 - --import "go.etcd.io/etcd/etcdctl/ctlv3/command" -+//import "github.com/coreos/etcd/etcdctl/ctlv3/command" -+import cobra "github.com/spf13/cobra/doc" - - func Start() { - rootCmd.SetUsageFunc(usageFunc) - // Make help just show the usage - rootCmd.SetHelpTemplate(`{{.UsageString}}`) -- if err := rootCmd.Execute(); err != nil { -- command.ExitWithError(command.ExitError, err) -+ //if err := rootCmd.Execute(); err != nil { -+ // command.ExitWithError(command.ExitError, err) -+ //} -+ header := &cobra.GenManHeader{ -+ Title: "etcdctl3", -+ Section: "1", - } -+ -+ cobra.GenManTree(rootCmd, header, "") - } -diff -up etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/vendor/github.com/urfave/cli/flag.go.hack2 etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/vendor/github.com/urfave/cli/flag.go ---- etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/vendor/github.com/urfave/cli/flag.go.hack2 2019-03-12 20:09:09.000000000 +0100 -+++ etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/vendor/github.com/urfave/cli/flag.go 2019-03-14 20:20:04.883079109 +0100 -@@ -670,7 +670,7 @@ func prefixedNames(fullName, placeholder - parts := strings.Split(fullName, ",") - for i, name := range parts { - name = strings.Trim(name, " ") -- prefixed += prefixFor(name) + name -+ prefixed += "\\fB" + prefixFor(name) + name + "\\fP" - if placeholder != "" { - prefixed += " " + placeholder - } -@@ -745,7 +745,7 @@ func stringifyFlag(f Flag) string { - usageWithDefault := strings.TrimSpace(fmt.Sprintf("%s%s", usage, defaultValueString)) - - return withEnvHint(fv.FieldByName("EnvVar").String(), -- fmt.Sprintf("%s\t%s", prefixedNames(fv.FieldByName("Name").String(), placeholder), usageWithDefault)) -+ fmt.Sprintf("%s\n\t\t\t%s", prefixedNames(fv.FieldByName("Name").String(), placeholder), usageWithDefault)) - } - - func stringifyIntSliceFlag(f IntSliceFlag) string { diff --git a/0001-remove-unknown-field-Etcd.Debug.patch b/0001-remove-unknown-field-Etcd.Debug.patch deleted file mode 100644 index 76ec8215301d14db4f6a07b80fd3a20ccf9c2538..0000000000000000000000000000000000000000 --- a/0001-remove-unknown-field-Etcd.Debug.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 2c95b49b63651ae3e0a3f63c45c05295d1af2c42 Mon Sep 17 00:00:00 2001 -From: lsytj0413 <511121939@qq.com> -Date: Thu, 19 Sep 2019 09:51:51 +0800 -Subject: [PATCH] test(functional): remove unknown field Etcd.Debug - ---- - functional/tester/cluster_test.go | 3 --- - 1 file changed, 3 deletions(-) - -diff --git a/functional/tester/cluster_test.go b/functional/tester/cluster_test.go -index 7c7b25f2ad..2948c00e7f 100644 ---- a/functional/tester/cluster_test.go -+++ b/functional/tester/cluster_test.go -@@ -64,7 +64,6 @@ func Test_read(t *testing.T) { - InitialCorruptCheck: true, - Logger: "zap", - LogOutputs: []string{"/tmp/etcd-functional-1/etcd.log"}, -- Debug: true, - }, - ClientCertData: "", - ClientCertPath: "", -@@ -117,7 +116,6 @@ func Test_read(t *testing.T) { - InitialCorruptCheck: true, - Logger: "zap", - LogOutputs: []string{"/tmp/etcd-functional-2/etcd.log"}, -- Debug: true, - }, - ClientCertData: "", - ClientCertPath: "", -@@ -170,7 +168,6 @@ func Test_read(t *testing.T) { - InitialCorruptCheck: true, - Logger: "zap", - LogOutputs: []string{"/tmp/etcd-functional-3/etcd.log"}, -- Debug: true, - }, - ClientCertData: "", - ClientCertPath: "", diff --git a/etcd-3.4.14-1.src.rpm b/etcd-3.4.14-1.src.rpm new file mode 100644 index 0000000000000000000000000000000000000000..84c42f8a07291478154227dfb9f69fd1ca20283b Binary files /dev/null and b/etcd-3.4.14-1.src.rpm differ diff --git a/etcd-3.4.7.tar.gz b/etcd-3.4.14.tar.gz similarity index 54% rename from etcd-3.4.7.tar.gz rename to etcd-3.4.14.tar.gz index 063b0b5e0b28e57d6a9e0c0ace3ae8eacbdbbffb..c72439de14d08d0379d3416f39b388dc88879941 100644 Binary files a/etcd-3.4.7.tar.gz and b/etcd-3.4.14.tar.gz differ diff --git a/etcd.service b/etcd.service index 9f367d775884f61b087dcf43ebffd52840517855..c9c3afe09a1c20fbbeb53c3e472f9f9f05b73fcc 100644 --- a/etcd.service +++ b/etcd.service @@ -8,8 +8,6 @@ Wants=network-online.target Type=notify WorkingDirectory=/var/lib/etcd/ EnvironmentFile=-/etc/etcd/etcd.conf -Environment=ETCD_NAME -Environment=ETCD_UNSUPPORTED_ARCH=arm64 User=etcd # set GOMAXPROCS to number of processors ExecStart=/bin/bash -c "GOMAXPROCS=$(nproc) /usr/bin/etcd" diff --git a/etcd.spec b/etcd.spec index 5ea7282515636b2f48de53b67b491aaead7ef27e..a8cf96b9bca2fa62bf51fde9e48abed53d3e8b05 100644 --- a/etcd.spec +++ b/etcd.spec @@ -1,20 +1,26 @@ # Generated by go2rpm %bcond_without check +%bcond_with bootstrap + +%define debug_package %{nil} # https://github.com/etcd-io/etcd %global goipath go.etcd.io/etcd %global forgeurl https://github.com/etcd-io/etcd -Version: 3.4.7 +Version: 3.4.14 %gometa -# Remove in F33 -%global godevelheader %{expand: -Obsoletes: etcd-devel < 3.3.12-5 -} +%global goipaths0 go.etcd.io/etcd +%global goipathsex0 go.etcd.io/etcd/etcdserver/api/v3rpc/ + +%if %{without bootstrap} +%global goipaths1 go.etcd.io/etcd/etcdserver/api/v3rpc/ +%endif + -%global goaltipaths github.com/coreos/etcd -%global man_version 3.4.7 +%global goaltipaths github.com/coreos/etcd go.etcd.io/etcd/v3 +%global man_version 3.4.14 %global common_description %{expand: Distributed reliable key-value store for the most critical data of a distributed @@ -26,30 +32,25 @@ system.} %global gosupfiles integration/fixtures/* etcdserver/api/v2http/testdata/* -%define debug_package %{nil} - Name: etcd -Release: 1%{?dist} +Release: 1 Summary: Distributed reliable key-value store for the most critical data of a distributed system # Upstream license specification: Apache-2.0 -License: ASL 2.0 -URL: %{gourl} +License: ASL 2.0 and MIT +URL: https://github.com/etcd-io/etcd Source0: %{gosource} Source1: %{name}.service Source2: %{name}.conf Source3: man-%{man_version}.tar.gz # sh genmanpages.sh path_to_built_source Source10: genmanpages.sh -# Not patches to apply here, but used on the source to generate man pages -# Source11: 0001-hack-etcdmain-to-generate-etcd.1.patch -# Source12: 0001-hack-to-generate-man-pages.patch -# Fix a test -Patch0: 0001-remove-unknown-field-Etcd.Debug.patch +# update grpc-go version to v1.32.0 +Patch1: 0001-Convert-int-to-string-using-strconv.Itoa.patch -BuildRequires: compiler(go-compiler) +BuildRequires: go-compilers-golang-compiler # BuildRequires: golang(github.com/bgentry/speakeasy) -# BuildRequires: golang(github.com/cockroachdb/datadriven) +# # BuildRequires: golang(github.com/cockroachdb/datadriven) # BuildRequires: golang(github.com/coreos/go-semver/semver) # BuildRequires: golang(github.com/coreos/go-systemd/daemon) # BuildRequires: golang(github.com/coreos/go-systemd/journal) @@ -63,7 +64,9 @@ BuildRequires: compiler(go-compiler) # BuildRequires: golang(github.com/golang/protobuf/proto) # BuildRequires: golang(github.com/google/btree) # BuildRequires: golang(github.com/google/uuid) +# %%if %%{without bootstrap} # BuildRequires: golang(github.com/grpc-ecosystem/go-grpc-middleware) +# %endif # BuildRequires: golang(github.com/grpc-ecosystem/go-grpc-prometheus) # BuildRequires: golang(github.com/grpc-ecosystem/grpc-gateway/runtime) # BuildRequires: golang(github.com/grpc-ecosystem/grpc-gateway/utilities) @@ -97,7 +100,7 @@ BuildRequires: compiler(go-compiler) # BuildRequires: golang(google.golang.org/grpc/health/grpc_health_v1) # BuildRequires: golang(google.golang.org/grpc/keepalive) # BuildRequires: golang(google.golang.org/grpc/metadata) -# BuildRequires: golang(google.golang.org/grpc/naming) +# # BuildRequires: golang(google.golang.org/grpc/naming) # BuildRequires: golang(google.golang.org/grpc/peer) # BuildRequires: golang(google.golang.org/grpc/resolver) # BuildRequires: golang(google.golang.org/grpc/resolver/dns) @@ -106,6 +109,7 @@ BuildRequires: compiler(go-compiler) # BuildRequires: golang(gopkg.in/cheggaaa/pb.v1) # BuildRequires: golang(gopkg.in/yaml.v2) # BuildRequires: golang(sigs.k8s.io/yaml) +BuildRequires: openEuler-rpm-config BuildRequires: python3-devel # BuildRequires: %%{py3_dist sphinx sphinx-rtd-theme} @@ -125,11 +129,8 @@ Requires(pre): shadow-utils %prep %setup -q -n man-%{man_version} -T -b 3 -#%goprep %forgesetup -%patch0 -p1 -rm -rf cmd/vendor -rm -rf raft/rafttest +%patch1 -p1 # For compatibility cp -aR etcdserver/api/snap snap cp -aR etcdserver/api/membership etcdserver/membership @@ -143,17 +144,19 @@ mv etcdctl/READMEv2.md READMEv2-etcdctl.md mkdir -p man/man1 cp ../man-%{man_version}/*.1 man/man1/. +%if %{without bootstrap} %build GO111MODULE=on GOFLAGS=-mod=vendor go build -o %{gobuilddir}/bin/etcd %{goipath} for cmd in etcdctl; do GO111MODULE=on GOFLAGS=-mod=vendor go build -o %{gobuilddir}/bin/$(basename $cmd) %{goipath}/$cmd done +%endif # make -C docs help # make -C docs html %install -#%gopkginstall +%if %{without bootstrap} install -m 0755 -vd %{buildroot}%{_bindir} install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/ @@ -167,28 +170,16 @@ install -pm 644 man/man1/* %{buildroot}%{_mandir}/man1 # And create /var/lib/etcd install -dm 0755 %{buildroot}%{_sharedstatedir}/%{name} +%endif -#%if %{with check} -#%check -#%gocheck -d clientv3 \ -# -d e2e \ -# -d functional/rpcpb \ -# -d functional/tester \ -# -d tools/functional-tester/etcd-agent \ -# -d integration \ -# -d clientv3/integration \ -# -d clientv3/balancer \ -# -d clientv3/snapshot \ -# -d clientv3/ordering \ -# -d pkg/expect \ -# -d pkg/flags \ -# -d pkg/proxy \ -# -d pkg/tlsutil \ -# -d pkg/transport \ -# -t raft \ -# -t tests/e2e -#%endif +%if %{without bootstrap} +%if %{with check} +%check +GO111MODULE=on GOFLAGS=-mod=vendor go test $( GO111MODULE=on GOFLAGS=-mod=vendor go list ./... | grep -v -E "tlsutil|expect|tester|integration|e2e|backend|auth|ordering|snapshot|etcdserver|mvcc") +%endif +%endif +%if %{without bootstrap} %pre getent group %{name} >/dev/null || groupadd -r %{name} getent passwd %{name} >/dev/null || useradd -r -g %{name} -d %{_sharedstatedir}/%{name} \ @@ -212,9 +203,11 @@ getent passwd %{name} >/dev/null || useradd -r -g %{name} -d %{_sharedstatedir}/ %dir %attr(-,%{name},%{name}) %{_sharedstatedir}/%{name} %{_unitdir}/%{name}.service %{_mandir}/man1/*.1* - -#%gopkgfiles +%endif %changelog +* Thu Jan 21 2021 jiangxinyu - 3.4.14-1 +- Update to 3.4.14 + * Thu Aug 13 2020 jiangxinyu - 3.4.7-1 - Init etcd project diff --git a/man-3.4.14.tar.gz b/man-3.4.14.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..528f6ad39a53d4985e62fa63ac327c3957bfe8f0 Binary files /dev/null and b/man-3.4.14.tar.gz differ diff --git a/man-3.4.7.tar.gz b/man-3.4.7.tar.gz deleted file mode 100644 index 998ad95093262dd34cfc16167e879b696f60048b..0000000000000000000000000000000000000000 Binary files a/man-3.4.7.tar.gz and /dev/null differ