diff --git a/.gitignore b/.gitignore index 7c97261..3054b05 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,5 @@ /etcd-3.2.16.tar.gz /man-3.2.16.tar.gz +/etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1.tar.gz +/man-3.3.12.tar.gz +/etcd-f29b1ada19713544b698dab8c94c97cfa1e83dac.tar.gz diff --git a/0001-hack-etcdmain-to-generate-etcd.1.patch b/0001-hack-etcdmain-to-generate-etcd.1.patch index b085093..4476430 100644 --- a/0001-hack-etcdmain-to-generate-etcd.1.patch +++ b/0001-hack-etcdmain-to-generate-etcd.1.patch @@ -1,26 +1,14 @@ -From 81519130b0abec199ddc9e3559e64884742b1bf5 Mon Sep 17 00:00:00 2001 -From: Jan Chaloupka -Date: Tue, 7 Nov 2017 14:04:01 +0100 -Subject: [PATCH] hack etcdmain to generate etcd.1 - ---- - etcdmain/config.go | 25 ++++---- - etcdmain/fake_flagset.go | 157 +++++++++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 171 insertions(+), 11 deletions(-) - create mode 100644 etcdmain/fake_flagset.go - -diff --git a/etcdmain/config.go b/etcdmain/config.go -index b873220..4770334 100644 ---- a/etcdmain/config.go -+++ b/etcdmain/config.go -@@ -118,14 +118,14 @@ func newConfig() *config { +diff -up etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdmain/config.go.hack1 etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdmain/config.go +--- etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdmain/config.go.hack1 2019-03-14 20:11:28.569755622 +0100 ++++ etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdmain/config.go 2019-03-14 20:23:17.601851367 +0100 +@@ -122,14 +122,14 @@ func newConfig() *config { ), } -- fs := cfg.FlagSet +- fs := cfg.cf.flagSet - fs.Usage = func() { -+ fs := InitFlagSet(cfg.FlagSet) -+ cfg.FlagSet.Usage = func() { ++ fs := InitFlagSet(cfg.cf.flagSet) ++ cfg.cf.flagSet.Usage = func() { fmt.Fprintln(os.Stderr, usageline) } @@ -28,78 +16,91 @@ index b873220..4770334 100644 - // member + fs.AddGroup("member") - fs.Var(cfg.CorsInfo, "cors", "Comma-separated white list of origins for CORS (cross-origin resource sharing).") - fs.StringVar(&cfg.Dir, "data-dir", cfg.Dir, "Path to the data directory.") - fs.StringVar(&cfg.WalDir, "wal-dir", cfg.WalDir, "Path to the dedicated wal directory.") -@@ -139,7 +139,7 @@ func newConfig() *config { - fs.UintVar(&cfg.ElectionMs, "election-timeout", cfg.ElectionMs, "Time (in milliseconds) for an election to timeout.") - fs.Int64Var(&cfg.QuotaBackendBytes, "quota-backend-bytes", cfg.QuotaBackendBytes, "Raise alarms when backend size exceeds the given quota. 0 means use the default quota.") + 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( +@@ -162,7 +162,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.NewURLsValue(embed.DefaultInitialAdvertisePeerURLs), "initial-advertise-peer-urls", "List of this member's peer URLs to advertise to the rest of the cluster.") - fs.Var(flags.NewURLsValue(embed.DefaultAdvertiseClientURLs), "advertise-client-urls", "List of this member's client URLs to advertise to the public.") - fs.StringVar(&cfg.Durl, "discovery", cfg.Durl, "Discovery URL used to bootstrap the cluster.") -@@ -160,7 +160,7 @@ func newConfig() *config { - fs.BoolVar(&cfg.StrictReconfigCheck, "strict-reconfig-check", cfg.StrictReconfigCheck, "Reject reconfiguration requests that would cause quorum loss.") - fs.BoolVar(&cfg.EnableV2, "enable-v2", true, "Accept etcd V2 client requests.") + fs.Var( + flags.NewUniqueURLsWithExceptions(embed.DefaultInitialAdvertisePeerURLs, ""), + "initial-advertise-peer-urls", +@@ -187,7 +187,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.proxy, "proxy", fmt.Sprintf("Valid values include %s", strings.Join(cfg.proxy.Values, ", "))) - if err := cfg.proxy.Set(proxyFlagOff); err != nil { - // Should never happen. -@@ -172,7 +172,7 @@ func newConfig() *config { - fs.UintVar(&cfg.ProxyWriteTimeoutMs, "proxy-write-timeout", cfg.ProxyWriteTimeoutMs, "Time (in milliseconds) for a write to timeout.") - fs.UintVar(&cfg.ProxyReadTimeoutMs, "proxy-read-timeout", cfg.ProxyReadTimeoutMs, "Time (in milliseconds) for a read to timeout.") + 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.") +@@ -195,7 +195,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.ClientTLSInfo.CAFile, "ca-file", "", "DEPRECATED: Path to the client server TLS CA file.") - fs.StringVar(&cfg.ClientTLSInfo.CertFile, "cert-file", "", "Path to the client server TLS cert file.") - fs.StringVar(&cfg.ClientTLSInfo.KeyFile, "key-file", "", "Path to the client server TLS key file.") -@@ -186,28 +186,31 @@ func newConfig() *config { - fs.StringVar(&cfg.PeerTLSInfo.TrustedCAFile, "peer-trusted-ca-file", "", "Path to the peer server TLS trusted CA file.") - fs.BoolVar(&cfg.PeerAutoTLS, "peer-auto-tls", false, "Peer TLS using generated certificates") + 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.") +@@ -218,41 +218,44 @@ 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.BoolVar(&cfg.Debug, "debug", false, "Enable debug-level logging for etcd.") - fs.StringVar(&cfg.LogPkgLevels, "log-package-levels", "", "Specify a particular log level for each etcd package (eg: 'etcdmain=CRITICAL,etcdserver=DEBUG').") - fs.StringVar(&cfg.logOutput, "log-output", "default", "Specify 'stdout' or 'stderr' to skip journald logging even when running under systemd.") - -- // unsafe -+ fs.AddGroup("unsafe") - fs.BoolVar(&cfg.ForceNewCluster, "force-new-cluster", false, "Force to create a new one member cluster.") + fs.StringVar(&cfg.ec.Logger, "logger", "capnslog", "Specify 'zap' for structured logging or 'capnslog'.") + fs.Var(flags.NewUniqueStringsValue(embed.DefaultLogOutput), "log-output", "DEPRECATED: 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.") + fs.BoolVar(&cfg.ec.Debug, "debug", false, "Enable debug-level logging for etcd.") + fs.StringVar(&cfg.ec.LogPkgLevels, "log-package-levels", "", "(To be deprecated) 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.IntVar(&cfg.AutoCompactionRetention, "auto-compaction-retention", 0, "Auto compaction retention for mvcc key value store in hour. 0 means disable auto compaction.") + 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.EnablePprof, "enable-pprof", false, "Enable runtime profiling data via HTTP server. Address is at client URL + \"/debug/pprof/\"") + 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.Metrics, "metrics", cfg.Metrics, "Set level of detail for exported metrics, specify 'extensive' to include histogram 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.AuthToken, "auth-token", cfg.AuthToken, "Specify auth token specific options.") + 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.") + fs.StringVar(&cfg.ec.ExperimentalBackendFreelistType, "experimental-backend-bbolt-freelist-type", cfg.ec.ExperimentalBackendFreelistType, "ExperimentalBackendFreelistType specifies the type of freelist that boltdb backend uses(array and map are supported types)") + +- // 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 --git a/etcdmain/fake_flagset.go b/etcdmain/fake_flagset.go -new file mode 100644 -index 0000000..71f230b ---- /dev/null -+++ b/etcdmain/fake_flagset.go +diff -up etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdmain/fake_flagset.go.hack1 etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdmain/fake_flagset.go +--- etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdmain/fake_flagset.go.hack1 2019-03-14 20:11:28.570755620 +0100 ++++ etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdmain/fake_flagset.go 2019-03-14 20:11:28.570755620 +0100 @@ -0,0 +1,157 @@ +package etcdmain + @@ -258,6 +259,3 @@ index 0000000..71f230b + } + fmt.Printf(".SH SEE ALSO:\n\\fBetcdctl(1)\\fP, \\fBetcdctl2(1)\\fP, \\fBetcdctl3(1)\\fP\n\n") +} --- -2.7.5 - diff --git a/0001-hack-to-generate-man-pages.patch b/0001-hack-to-generate-man-pages.patch index cd4dac4..b77a849 100644 --- a/0001-hack-to-generate-man-pages.patch +++ b/0001-hack-to-generate-man-pages.patch @@ -1,43 +1,9 @@ -From 481e731c01426bd7488011352515db03a46aa280 Mon Sep 17 00:00:00 2001 -From: Jan Chaloupka -Date: Mon, 6 Nov 2017 23:05:19 +0100 -Subject: [PATCH] hack-to-generate-man-pages - ---- - .../_workspace/src/github.com/urfave/cli/flag.go | 4 +- - etcdctl/ctlv2/ctl.go | 62 ++++++++++++++++++++++ - etcdctl/ctlv3/ctl_nocov.go | 13 +++-- - 3 files changed, 74 insertions(+), 5 deletions(-) - -diff --git a/Godeps/_workspace/src/github.com/urfave/cli/flag.go b/Godeps/_workspace/src/github.com/urfave/cli/flag.go -index f8a28d1..9787fe1 100644 ---- a/Godeps/_workspace/src/github.com/urfave/cli/flag.go -+++ b/Godeps/_workspace/src/github.com/urfave/cli/flag.go -@@ -752,7 +752,7 @@ func prefixedNames(fullName, placeholder string) string { - 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 - } -@@ -828,7 +828,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/etcdctl/ctlv2/ctl.go b/etcdctl/ctlv2/ctl.go -index e949b06..eb5170a 100644 ---- a/etcdctl/ctlv2/ctl.go -+++ b/etcdctl/ctlv2/ctl.go -@@ -42,6 +42,68 @@ func Start(apiv string) { - " Set environment variable ETCDCTL_API=3 to use v3 API or ETCDCTL_API=2 to use v2 API." +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: @@ -104,17 +70,16 @@ index e949b06..eb5170a 100644 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 --git a/etcdctl/ctlv3/ctl_nocov.go b/etcdctl/ctlv3/ctl_nocov.go -index 52751fe..e3089cf 100644 ---- a/etcdctl/ctlv3/ctl_nocov.go -+++ b/etcdctl/ctlv3/ctl_nocov.go +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 "github.com/coreos/etcd/etcdctl/ctlv3/command" +-import "go.etcd.io/etcd/etcdctl/ctlv3/command" +//import "github.com/coreos/etcd/etcdctl/ctlv3/command" -+import "github.com/spf13/cobra" ++import cobra "github.com/spf13/cobra/doc" func Start() { rootCmd.SetUsageFunc(usageFunc) @@ -132,6 +97,24 @@ index 52751fe..e3089cf 100644 + + cobra.GenManTree(rootCmd, header, "") } --- -2.7.5 - +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/1136ba0e0d4ab628cb13ffd76da47dbea357d0a6.patch b/1136ba0e0d4ab628cb13ffd76da47dbea357d0a6.patch deleted file mode 100644 index 9066984..0000000 --- a/1136ba0e0d4ab628cb13ffd76da47dbea357d0a6.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 1136ba0e0d4ab628cb13ffd76da47dbea357d0a6 Mon Sep 17 00:00:00 2001 -From: Gyuho Lee -Date: Fri, 15 Jun 2018 10:36:17 -0700 -Subject: [PATCH] raft: fix logger variadic parameter - -Signed-off-by: Gyuho Lee ---- - raft/logger.go | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/raft/logger.go b/raft/logger.go -index 92e55b373e..426a77d344 100644 ---- a/raft/logger.go -+++ b/raft/logger.go -@@ -114,7 +114,7 @@ func (l *DefaultLogger) Fatalf(format string, v ...interface{}) { - } - - func (l *DefaultLogger) Panic(v ...interface{}) { -- l.Logger.Panic(v) -+ l.Logger.Panic(v...) - } - - func (l *DefaultLogger) Panicf(format string, v ...interface{}) { diff --git a/Fix-format-errors.patch b/Fix-format-errors.patch deleted file mode 100644 index 5907294..0000000 --- a/Fix-format-errors.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 89901423d929b66240231196616688cddb39b115 Mon Sep 17 00:00:00 2001 -From: Jan Chaloupka -Date: Fri, 9 Mar 2018 17:13:26 +0100 -Subject: [PATCH] Fix format errors - ---- - pkg/pbutil/pbutil_test.go | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/pkg/pbutil/pbutil_test.go b/pkg/pbutil/pbutil_test.go -index fd361ec..21b1870 100644 ---- a/pkg/pbutil/pbutil_test.go -+++ b/pkg/pbutil/pbutil_test.go -@@ -24,7 +24,7 @@ func TestMarshaler(t *testing.T) { - data := []byte("test data") - m := &fakeMarshaler{data: data} - if g := MustMarshal(m); !reflect.DeepEqual(g, data) { -- t.Errorf("data = %s, want %s", g, m) -+ t.Errorf("data = %s, want #%v", g, m) - } - } - -@@ -43,7 +43,7 @@ func TestUnmarshaler(t *testing.T) { - m := &fakeUnmarshaler{} - MustUnmarshal(m, data) - if !reflect.DeepEqual(m.data, data) { -- t.Errorf("data = %s, want %s", m.data, m) -+ t.Errorf("data = %s, want #%v", m.data, m) - } - } - --- -2.7.5 - diff --git a/etcd.service b/etcd.service index afe51ea..c9c3afe 100644 --- a/etcd.service +++ b/etcd.service @@ -10,7 +10,7 @@ WorkingDirectory=/var/lib/etcd/ EnvironmentFile=-/etc/etcd/etcd.conf User=etcd # set GOMAXPROCS to number of processors -ExecStart=/bin/bash -c "GOMAXPROCS=$(nproc) /usr/bin/etcd --name=\"${ETCD_NAME}\" --data-dir=\"${ETCD_DATA_DIR}\" --listen-client-urls=\"${ETCD_LISTEN_CLIENT_URLS}\"" +ExecStart=/bin/bash -c "GOMAXPROCS=$(nproc) /usr/bin/etcd" Restart=on-failure LimitNOFILE=65536 diff --git a/etcd.spec b/etcd.spec index 1299e8c..db2e419 100644 --- a/etcd.spec +++ b/etcd.spec @@ -1,39 +1,45 @@ -# http://github.com/coreos/etcd -%global goipath github.com/coreos/etcd -Version: 3.2.16 +# https://github.com/coreos/etcd +%global goipath go.etcd.io/etcd +%global forgeurl https://github.com/coreos/etcd +%global oldgoipath github.com/coreos/etcd +%global oldgoname %gorpmname %{oldgoipath} +%global commit f29b1ada19713544b698dab8c94c97cfa1e83dac %gometa -%global man_version 3.2.16 +%global man_version 3.3.12 Name: etcd -Release: 6%{?dist} -Summary: A highly-available key value store for shared configuration -License: ASL 2.0 +Version: 3.3.12 +Release: 5%{?dist} +Summary: A highly-available key value store for shared configuration +License: ASL 2.0 URL: %{gourl} Source0: %{gosource} -Source1: %{name}.service -Source2: %{name}.conf +Source1: %{name}.service +Source2: %{name}.conf Source3: man-%{man_version}.tar.gz - -Patch0: Fix-format-errors.patch -Patch1: https://github.com/etcd-io/etcd/commit/1136ba0e0d4ab628cb13ffd76da47dbea357d0a6.patch +# 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 BuildRequires: golang(github.com/bgentry/speakeasy) -BuildRequires: golang(github.com/boltdb/bolt) -BuildRequires: golang(github.com/cheggaaa/pb) -BuildRequires: golang(github.com/cockroachdb/cmux) BuildRequires: golang(github.com/coreos/go-semver/semver) BuildRequires: golang(github.com/coreos/go-systemd/daemon) -BuildRequires: golang(github.com/coreos/go-systemd/util) +BuildRequires: golang(github.com/coreos/go-systemd/journal) BuildRequires: golang(github.com/coreos/pkg/capnslog) BuildRequires: golang(github.com/dgrijalva/jwt-go) BuildRequires: golang(github.com/dustin/go-humanize) BuildRequires: golang(github.com/ghodss/yaml) +BuildRequires: golang(github.com/gogo/protobuf/gogoproto) BuildRequires: golang(github.com/gogo/protobuf/proto) BuildRequires: golang(github.com/golang/groupcache/lru) BuildRequires: golang(github.com/golang/protobuf/proto) BuildRequires: golang(github.com/google/btree) +BuildRequires: golang(github.com/google/uuid) +BuildRequires: golang(github.com/grpc-ecosystem/go-grpc-middleware) 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) @@ -41,99 +47,89 @@ BuildRequires: golang(github.com/jonboulle/clockwork) BuildRequires: golang(github.com/kr/pty) BuildRequires: golang(github.com/olekukonko/tablewriter) BuildRequires: golang(github.com/prometheus/client_golang/prometheus) +BuildRequires: golang(github.com/prometheus/client_golang/prometheus/promhttp) +BuildRequires: golang(github.com/prometheus/client_model/go) +BuildRequires: golang(github.com/soheilhy/cmux) BuildRequires: golang(github.com/spf13/cobra) BuildRequires: golang(github.com/spf13/pflag) +BuildRequires: golang(github.com/tmc/grpc-websocket-proxy/wsproxy) BuildRequires: golang(github.com/ugorji/go/codec) BuildRequires: golang(github.com/urfave/cli) BuildRequires: golang(github.com/xiang90/probing) +BuildRequires: golang(go.uber.org/zap) +BuildRequires: golang(go.uber.org/zap/zapcore) BuildRequires: golang(golang.org/x/crypto/bcrypt) BuildRequires: golang(golang.org/x/net/context) BuildRequires: golang(golang.org/x/net/http2) BuildRequires: golang(golang.org/x/net/trace) BuildRequires: golang(golang.org/x/time/rate) BuildRequires: golang(google.golang.org/grpc) +BuildRequires: golang(google.golang.org/grpc/balancer) BuildRequires: golang(google.golang.org/grpc/codes) +BuildRequires: golang(google.golang.org/grpc/connectivity) BuildRequires: golang(google.golang.org/grpc/credentials) BuildRequires: golang(google.golang.org/grpc/grpclog) -BuildRequires: golang(google.golang.org/grpc/metadata) -BuildRequires: golang(google.golang.org/grpc/naming) -BuildRequires: golang(google.golang.org/grpc/peer) -BuildRequires: golang(google.golang.org/grpc/transport) - -BuildRequires: systemd - -%description -A highly-available key value store for shared configuration. - -%package devel -Summary: etcd golang devel libraries -BuildArch: noarch - -BuildRequires: golang(github.com/bgentry/speakeasy) -BuildRequires: golang(github.com/cheggaaa/pb) -BuildRequires: golang(github.com/cockroachdb/cmux) -BuildRequires: golang(github.com/coreos/bbolt) -BuildRequires: golang(github.com/coreos/go-semver/semver) -BuildRequires: golang(github.com/coreos/go-systemd/daemon) -BuildRequires: golang(github.com/coreos/go-systemd/util) -BuildRequires: golang(github.com/coreos/pkg/capnslog) -BuildRequires: golang(github.com/dgrijalva/jwt-go) -BuildRequires: golang(github.com/dustin/go-humanize) -BuildRequires: golang(github.com/ghodss/yaml) -BuildRequires: golang(github.com/gogo/protobuf/proto) -BuildRequires: golang(github.com/golang/groupcache/lru) -BuildRequires: golang(github.com/golang/protobuf/proto) -BuildRequires: golang(github.com/google/btree) -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) -BuildRequires: golang(github.com/jonboulle/clockwork) -BuildRequires: golang(github.com/kr/pty) -BuildRequires: golang(github.com/olekukonko/tablewriter) -BuildRequires: golang(github.com/prometheus/client_golang/prometheus) -BuildRequires: golang(github.com/spf13/cobra) -BuildRequires: golang(github.com/spf13/pflag) -BuildRequires: golang(github.com/ugorji/go/codec) -BuildRequires: golang(github.com/urfave/cli) -BuildRequires: golang(github.com/xiang90/probing) -BuildRequires: golang(golang.org/x/crypto/bcrypt) -BuildRequires: golang(golang.org/x/net/context) -BuildRequires: golang(golang.org/x/net/http2) -BuildRequires: golang(golang.org/x/net/trace) -BuildRequires: golang(golang.org/x/time/rate) -BuildRequires: golang(google.golang.org/genproto/googleapis/api/annotations) -BuildRequires: golang(google.golang.org/grpc) -BuildRequires: golang(google.golang.org/grpc/codes) -BuildRequires: golang(google.golang.org/grpc/credentials) -BuildRequires: golang(google.golang.org/grpc/grpclog) +BuildRequires: golang(google.golang.org/grpc/health) 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/peer) +BuildRequires: golang(google.golang.org/grpc/resolver) +BuildRequires: golang(google.golang.org/grpc/resolver/dns) +BuildRequires: golang(google.golang.org/grpc/resolver/passthrough) BuildRequires: golang(google.golang.org/grpc/status) +BuildRequires: golang(gopkg.in/cheggaaa/pb.v1) +BuildRequires: golang(gopkg.in/yaml.v2) +BuildRequires: golang(go.etcd.io/bbolt) +%{?systemd_requires} +BuildRequires: systemd +Requires(pre): shadow-utils + +%description +A highly-available key value store for shared configuration. + + +%package devel +Summary: etcd golang devel libraries +BuildArch: noarch %description devel -golang development libraries for etcd, a highly-available key value store for +Golang development libraries for etcd, a highly-available key value store for shared configuration. +This package contains compatibility glue for code that still imports the +%{goipath} Go namespace. + + +%package -n compat-%{oldgoname}-devel +Summary: etcd golang devel libraries +BuildArch: noarch + +%description -n compat-%{oldgoname}-devel +Golang development libraries for etcd, a highly-available key value store for +shared configuration. + +This package contains compatibility glue for code that still imports the +%{oldgoipath} Go namespace. + + %prep %setup -q -n man-%{man_version} -T -b 3 %forgesetup -%patch0 -p1 -%patch1 -p1 + +rm -rf vendor mkdir -p man/man1 cp ../man-%{man_version}/*.1 man/man1/. -sed -i 's/"gopkg\.in\/cheggaaa\/pb\.v1/"github\.com\/cheggaaa\/pb/g' $(find . -name '*.go') -#" %build %gobuildroot -%gobuild -o _bin/etcd %{goipath}/cmd/etcd -%gobuild -o _bin/etcdctl %{goipath}/cmd/etcdctl +%gobuild -o _bin/etcd %{goipath} +%gobuild -o _bin/etcdctl %{goipath}/etcdctl + %install install -D -p -m 0755 _bin/%{name} %{buildroot}%{_bindir}/%{name} @@ -152,26 +148,32 @@ install -d -m 0755 %{buildroot}%{_sharedstatedir}/%{name} # source codes for building projects %goinstall integration/fixtures etcdserver/api/v2http/testdata +install -m 0755 -vd %{buildroot}%{gopath}/src/%(dirname %{oldgoipath}) +ln -s %{gopath}/src/%{goipath} %{buildroot}%{gopath}/src/%{oldgoipath} + + %check # tools/functional-tester/etcd-agent expects etcd binary at GOPATH/bin/etcd %gochecks -d clientv3 -d e2e -d tools/functional-tester/etcd-agent -d integration -d clientv3/integration + %pre getent group %{name} >/dev/null || groupadd -r %{name} getent passwd %{name} >/dev/null || useradd -r -g %{name} -d %{_sharedstatedir}/%{name} \ - -s /sbin/nologin -c "etcd user" %{name} + -s /sbin/nologin -c "etcd user" %{name} + %post %systemd_post %{name}.service + %preun %systemd_preun %{name}.service + %postun %systemd_postun %{name}.service -#define license tag if not already defined -%{!?_licensedir:%global license %doc} %files %license LICENSE @@ -183,12 +185,36 @@ getent passwd %{name} >/dev/null || useradd -r -g %{name} -d %{_sharedstatedir}/ %{_unitdir}/%{name}.service %{_mandir}/man1/*.1* + %files devel -f devel.file-list %license LICENSE %doc *.md -%doc glide.lock + + +%files -n compat-%{oldgoname}-devel +%dir %{gopath}/src/%(dirname %{oldgoipath}) +%{gopath}/src/%{oldgoipath} + %changelog +* Mon Feb 17 2020 Elliott Sales de Andrade - 3.3.12-5 +- Rebuilt for GHSA-jf24-p9p9-4rjh + +* Tue Apr 16 15:51:11 CET 2019 Robert-André Mauchin - 3.3.12-4.20190413gitf29b1ad +- etcd.service: do not pass command line flags already defined in environment + +* Mon Apr 15 15:11:24 CET 2019 Robert-André Mauchin - 3.3.12-3.20190413gitf29b1ad +- Fix building of etcd + +* Sat Apr 13 22:31:30 CET 2019 Robert-André Mauchin - 3.3.12-2.20190413gitf29b1ad +- Bump to commit f29b1ada19713544b698dab8c94c97cfa1e83dac + +* Thu Mar 14 2019 Robert-André Mauchin - 3.3.12-1.20190314gite1ca3b4 +- Bump to commit e1ca3b4434945e57e8e3a451cdbde74a903cc8e1 +- Add new goipath +- Updated patches +- Updated man pages + * Sun Feb 17 2019 Elliott Sales de Andrade - 3.2.16-6 - Fix broken version specification - Backport variadic parameter fix @@ -196,8 +222,7 @@ getent passwd %{name} >/dev/null || useradd -r -g %{name} -d %{_sharedstatedir}/ * Thu Jan 31 2019 Fedora Release Engineering - 3.2.16-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild -* Tue Oct 23 2018 Nicolas Mailhot -- 3.2.16-4 +* Tue Oct 23 2018 Nicolas Mailhot - 3.2.16-4 - redhat-rpm-config-123 triggers bugs in gosetup, remove it from Go spec files as it’s just an alias - https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/RWD5YATAYAFWKIDZBB7EB6N5DAO4ZKFM/ diff --git a/etcdctl.1 b/etcdctl.1 deleted file mode 100644 index bec2361..0000000 --- a/etcdctl.1 +++ /dev/null @@ -1,25 +0,0 @@ -.TH "ETCD" "1" " etcd User Manuals" "Jan Chaloupka" "Oct 2017" "" - - -.SH NAME -.PP -etcdctl \- A simple command line client for etcd - - -.SH SYNOPSIS -.PP -\fB[ETCDCTL_API=3] etctctl\fP [OPTIONS] - - -.SH DESCRIPTION -.PP -Command line client for etcd. -Queries to v2 data model are available through \fBetcdtl\fP command (see \fBetcdctl2(1)\fP). -Queries to v3 data model are available through \fBETCDCTL=3 etcdtl\fP command (see \fBetcdctl3(1)\fP). - -.PP -Find more information at -\[la]https://github.com/coreos/etcd\[ra]. - -.SH SEE ALSO -\fBetcd(1)\fP, \fBetcdctl2(1)\fP, \fBetcdctl3(1)\fP diff --git a/etcdmain-Add-max-snapshots-and-max-wals-to-help.patch b/etcdmain-Add-max-snapshots-and-max-wals-to-help.patch deleted file mode 100644 index d607f64..0000000 --- a/etcdmain-Add-max-snapshots-and-max-wals-to-help.patch +++ /dev/null @@ -1,41 +0,0 @@ -From ddc4f8bd4501826e4c551952a96fcca6dd25bf64 Mon Sep 17 00:00:00 2001 -From: Yiqiao Pu -Date: Wed, 18 Nov 2015 17:54:46 +0800 -Subject: [PATCH] etcdmain: Add max-snapshots and max-wals to help - -Based on the configuration doc, seems these two flags are missing -in the help. So add them and the descriptions are from config.go in -the same directory. - -Signed-off-by: Yiqiao Pu ---- - etcdmain/help.go | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/etcdmain/help.go b/etcdmain/help.go -index e233320..fd23d59 100644 ---- a/etcdmain/help.go -+++ b/etcdmain/help.go -@@ -14,6 +14,8 @@ - - package etcdmain - -+import "strconv" -+ - var ( - usageline = `usage: etcd [flags] - start an etcd server -@@ -43,6 +45,10 @@ member flags: - list of URLs to listen on for peer traffic. - --listen-client-urls 'http://localhost:2379,http://localhost:4001' - list of URLs to listen on for client traffic. -+ --max-snapshots '` + strconv.Itoa(defaultMaxSnapshots) + `' -+ maximum number of snapshot files to retain (0 is unlimited). -+ --max-wals '` + strconv.Itoa(defaultMaxWALs) + `' -+ maximum number of wal files to retain (0 is unlimited). - -cors '' - comma-separated whitelist of origins for CORS (cross-origin resource sharing). - --- -1.9.3 - diff --git a/genmanpages.sh b/genmanpages.sh index fedb2a4..821818f 100755 --- a/genmanpages.sh +++ b/genmanpages.sh @@ -17,7 +17,7 @@ sed -i s"/^\\\fBetcdctl /\\\fBETCDCTL=3 etcdctl /" etcdctl3*.1 cd ../etcdctl2 ../../$1/bin/etcdctl --help > etcdctl.1 -for cmd in $(cat etcdctl.1 | grep "\fBetcdctl" | cut -d'-' -f2-3 | cut -d'(' -f1); do ../../$1/bin/etcdctl $cmd --help > etcdctl-$cmd.1; done +for cmd in $(cat etcdctl.1 | grep "\fBetcdctl\\\-" | cut -d'-' -f2-3 | cut -d'(' -f1); do ../../$1/bin/etcdctl $cmd --help > etcdctl-$cmd.1; done # rename to etcdctl2 for line in $(ls *.1); do mv $line $(echo $line | sed "s/etcdctl/etcdctl2/"); done diff --git a/hack-test.patch b/hack-test.patch deleted file mode 100644 index a6402b3..0000000 --- a/hack-test.patch +++ /dev/null @@ -1,73 +0,0 @@ -From a144093e502d4529d598ecf997fea9e261ac595d Mon Sep 17 00:00:00 2001 -From: Jan Chaloupka -Date: Mon, 15 Aug 2016 16:09:52 +0200 -Subject: [PATCH] hack test - ---- - test | 26 +++++++++++++------------- - 1 file changed, 13 insertions(+), 13 deletions(-) - -diff --git a/test b/test -index 4f24606..deaa527 100755 ---- a/test -+++ b/test -@@ -53,7 +53,7 @@ fi - function unit_tests { - echo "Running tests..." - # only -run=Test so examples can run in integration tests -- go test -timeout 3m ${COVER} ${RACE} -cpu 1,2,4 -run=Test $@ ${TEST} -+ ${GOTEST:-go test} -timeout 3m ${COVER} ${RACE} -cpu 1,2,4 -run=Test $@ ${TEST} - } - - function integration_tests { -@@ -69,16 +69,16 @@ function integration_tests { - mv /tmp/etcd ./bin/etcd-last-release - fi; - -- go test -timeout 10m -v -cpu 1,2,4 $@ ${REPO_PATH}/e2e & -+ ${GOTEST:-go test} -timeout 10m -v -cpu 1,2,4 $@ ${REPO_PATH}/e2e & - e2epid="$!" -- go test -timeout 15m -v -cpu 1,2,4 $@ ${REPO_PATH}/integration & -+ ${GOTEST:-go test} -timeout 15m -v -cpu 1,2,4 $@ ${REPO_PATH}/integration & - intpid="$!" - wait $e2epid - wait $intpid -- go test -timeout 1m -v ${RACE} -cpu 1,2,4 $@ ${REPO_PATH}/client/integration -- go test -timeout 10m -v ${RACE} -cpu 1,2,4 $@ ${REPO_PATH}/clientv3/integration -- go test -timeout 1m -v -cpu 1,2,4 $@ ${REPO_PATH}/contrib/raftexample -- go test -timeout 1m -v ${RACE} -cpu 1,2,4 -run=Example $@ ${TEST} -+ ${GOTEST:-go test} -timeout 1m -v ${RACE} -cpu 1,2,4 $@ ${REPO_PATH}/client/integration -+ ${GOTEST:-go test} -timeout 10m -v ${RACE} -cpu 1,2,4 $@ ${REPO_PATH}/clientv3/integration -+ ${GOTEST:-go test} -timeout 1m -v -cpu 1,2,4 $@ ${REPO_PATH}/contrib/raftexample -+ ${GOTEST:-go test} -timeout 1m -v ${RACE} -cpu 1,2,4 -run=Example $@ ${TEST} - } - - function fmt_tests { -@@ -197,18 +197,18 @@ function dep_tests { - } - - # Set up gopath so tests use vendored dependencies --export GOPATH=${PWD}/gopath --rm -rf $GOPATH/src --mkdir -p $GOPATH --ln -s ${PWD}/cmd/vendor $GOPATH/src -+#export GOPATH=${PWD}/Godeps/_workspace -+#rm -rf $GOPATH/src -+#mkdir -p $GOPATH -+#ln -s ${PWD}/cmd/vendor $GOPATH/src - - # fail fast on static tests - toggle_failpoints disable --fmt_tests -+#fmt_tests - dep_tests - - # fail fast on static tests --GO_BUILD_FLAGS="-a -v" etcd_build -+#GO_BUILD_FLAGS="-a -v" etcd_build - - unit_tests - if [ -n "$INTEGRATION" ]; then --- -1.9.3 - diff --git a/run-etcd-on-ppc64le-by-default.patch b/run-etcd-on-ppc64le-by-default.patch deleted file mode 100644 index e053777..0000000 --- a/run-etcd-on-ppc64le-by-default.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 5f8e74959f19f19018ab0e6400e0f5daba3567e5 Mon Sep 17 00:00:00 2001 -From: Jan Chaloupka -Date: Sat, 26 Nov 2016 13:46:29 +0100 -Subject: [PATCH] run etcd on ppc64le by default - ---- - etcdmain/etcd.go | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/etcdmain/etcd.go b/etcdmain/etcd.go -index 950513e..7225303 100644 ---- a/etcdmain/etcd.go -+++ b/etcdmain/etcd.go -@@ -636,6 +636,14 @@ func checkSupportArch() { - if runtime.GOARCH == "amd64" { - return - } -+ -+ if runtime.GOARCH == "ppc64le" { -+ plog.Warningf("Running etcd on ppc64le architecture is not supported.") -+ plog.Warningf("Be aware you are running the etcd at your own risk.") -+ plog.Warningf("For more information visit https://bugzilla.redhat.com/show_bug.cgi?id=1396463") -+ return -+ } -+ - if env, ok := os.LookupEnv("ETCD_UNSUPPORTED_ARCH"); ok && env == runtime.GOARCH { - plog.Warningf("running etcd on unsupported architecture %q since ETCD_UNSUPPORTED_ARCH is set", env) - return --- -1.9.3 - diff --git a/sources b/sources index 0bd1a5b..73b680e 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (etcd-3.2.16.tar.gz) = 5f3322b30266b0486310243d8f0c549d718687413e82fff27b26f195619a8e70ab5018921e02495f088ebe285559da76dcbfb9da0ef1f1d3c046ff90b8e4904c -SHA512 (man-3.2.16.tar.gz) = 3bb97ea010fed98ea9297b2c4e9222559bff380e77df928c4a145757c9ce09c02ad06403d8e4a68e9f9a391ff3eb81deb77302668a8fb809b8f62ecf0c7bc283 +SHA512 (etcd-f29b1ada19713544b698dab8c94c97cfa1e83dac.tar.gz) = a01b197be1022472916945d7b5e99afa86a4f03f9711ce44bc286e31bbc24d7cf326113cd62f0352806bd8fe862ee76d69833d054f0768f03513d51c21e0ce6c +SHA512 (man-3.3.12.tar.gz) = 981374ac7c071b9541994c4ee921b90281f2f09a1c51fe03fe4d319fc1c3647419cdf688e2ac161098d772cb0264e712dad1ed9a3c12b2454dc21f79e6a5eb8c