Compare commits

...

11 Commits

Author SHA1 Message Date
openeuler-ci-bot
ab090525b1
!34 添加sw架构
From: @wuzx065891 
Reviewed-by: @jxy_git 
Signed-off-by: @jxy_git
2022-12-08 11:16:51 +00:00
wzx
4d6793d18a Add sw64 architecture
Signed-off-by: wzx <wuzx1226@qq.com>
2022-11-03 19:41:36 +08:00
openeuler-ci-bot
7737dc5861 !17 [sync] PR-16: etcd进行编译选项增强
From: @openeuler-sync-bot
Reviewed-by: @caihaomin
Signed-off-by: @caihaomin
2021-09-02 08:37:11 +00:00
jikui
5305e6518b modify build flags for secure compilation options
Signed-off-by: jikui <jikui2@huawei.com>
(cherry picked from commit 9f3fd7d3fba62a11332973ba78eb9a29f6db893d)
2021-09-02 11:58:59 +08:00
openeuler-ci-bot
4e09cd9150 !12 Solve the problem of etcd on unsupported platform without ETCD_UNSUPPORTED_ARCH=arm64 set
From: @jxy_git
Reviewed-by: @disnight,@yangzhao_kl
Signed-off-by: @yangzhao_kl
2021-06-03 10:54:58 +08:00
jiangxinyu
a1b2f44f17 Solve the problem of etcd on unsupported platform without ETCD_UNSUPPORTED_ARCH=arm64 set 2021-06-02 17:45:49 +08:00
openeuler-ci-bot
25058918de !10 Remove the BuildRequires: go-compilers package
From: @jxy_git
Reviewed-by: @yangzhao_kl
Signed-off-by: @yangzhao_kl
2021-03-05 10:37:33 +08:00
jiangxinyu
a1430d120d Remove the BuildRequires: go-compilers package
Remove the BuildRequires: go-compilers package
2021-03-04 13:46:49 +08:00
openeuler-ci-bot
c612624be5 !9 Update to 3.4.14
From: @jxy_git
Reviewed-by: 
Signed-off-by:
2021-02-02 17:20:11 +08:00
jiangxinyu
26b1e3e24c Update to 3.4.14 2021-02-02 16:58:51 +08:00
openeuler-ci-bot
fb44fc6e32 !7 release v3.4.7
Merge pull request !7 from jiangxinyu/release-v3.4.7
2020-08-18 19:11:39 +08:00
11 changed files with 10198 additions and 537 deletions

View File

@ -0,0 +1,61 @@
From 80c8dfe084f44eb660aa1af5b5d49e27e1dfd11e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= <zebob.m@gmail.com>
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 <zebob.m@gmail.com>
---
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

View File

@ -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")
+}

View File

@ -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 {

View File

@ -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: "",

View File

@ -0,0 +1,28 @@
From b84b5ff496fd1f815c89f8431aeca5cfa9c3e390 Mon Sep 17 00:00:00 2001
From: jiangxinyu <jiangxinyu@kylinos.cn>
Date: Wed, 2 Jun 2021 17:04:36 +0800
Subject: [PATCH] =?UTF-8?q?=E5=85=BC=E5=AE=B9=E6=9E=B6=E6=9E=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
etcdmain/etcd.go | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/etcdmain/etcd.go b/etcdmain/etcd.go
index 73328a7..1907f99 100644
--- a/etcdmain/etcd.go
+++ b/etcdmain/etcd.go
@@ -603,7 +603,7 @@ func identifyDataDirOrDie(lg *zap.Logger, dir string) dirType {
func checkSupportArch() {
// TODO qualify arm64
- if runtime.GOARCH == "amd64" || runtime.GOARCH == "ppc64le" {
+ if runtime.GOARCH == "amd64" || runtime.GOARCH == "ppc64le" || runtime.GOARCH == "arm64" {
return
}
// unsupported arch only configured via environment variable
--
2.27.0

10044
0003-etcd-3.4.14-sw.patch Executable file

File diff suppressed because it is too large Load Diff

View File

@ -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"

179
etcd.spec
View File

@ -1,20 +1,24 @@
# 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
%global goipaths0 go.etcd.io/etcd
%global goipathsex0 go.etcd.io/etcd/etcdserver/api/v3rpc/
# Remove in F33
%global godevelheader %{expand:
Obsoletes: etcd-devel < 3.3.12-5
}
%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,98 +30,30 @@ system.}
%global gosupfiles integration/fixtures/* etcdserver/api/v2http/testdata/*
%define debug_package %{nil}
Name: etcd
Release: 1%{?dist}
Release: 5
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}
Source0: %{gosource}
License: ASL 2.0 and MIT
URL: https://github.com/etcd-io/etcd
Source0: etcd-%{version}.tar.gz
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
BuildRequires: compiler(go-compiler)
# BuildRequires: golang(github.com/bgentry/speakeasy)
# 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)
# BuildRequires: golang(github.com/coreos/pkg/capnslog)
# BuildRequires: golang(github.com/creack/pty)
# BuildRequires: golang(github.com/dgrijalva/jwt-go)
# BuildRequires: golang(github.com/dustin/go-humanize)
# 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)
# BuildRequires: golang(github.com/jonboulle/clockwork)
# BuildRequires: golang(github.com/json-iterator/go)
# BuildRequires: golang(github.com/modern-go/reflect2)
# 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/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/urfave/cli)
# BuildRequires: golang(github.com/xiang90/probing)
# BuildRequires: golang(go.etcd.io/bbolt)
# 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/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(sigs.k8s.io/yaml)
# update grpc-go version to v1.32.0
Patch1: 0001-Convert-int-to-string-using-strconv.Itoa.patch
Patch2: 0002-Etcd-on-unsupported-platform-without-ETCD_UNSUPPORTED_ARCH=arm64-set.patch
Patch3: 0003-etcd-3.4.14-sw.patch
BuildRequires: golang
BuildRequires: python3-devel
# BuildRequires: %%{py3_dist sphinx sphinx-rtd-theme}
%{?systemd_requires}
BuildRequires: systemd
Requires(pre): shadow-utils
%if %{with check}
# Tests
# BuildRequires: golang(github.com/prometheus/client_model/go)
%endif
%description
%{common_description}
@ -125,11 +61,12 @@ 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
%patch2 -p1
%ifarch sw_64
%patch3 -p1
%endif
# For compatibility
cp -aR etcdserver/api/snap snap
cp -aR etcdserver/api/membership etcdserver/membership
@ -143,17 +80,29 @@ 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}
CGO_CFLAGS="-fstack-protector-strong -fPIE -D_FORTIFY_SOURCE=2 -O2" \
CGO_LDFLAGS_ALLOW="-Wl,-z,relro,-z,now" \
CGO_LDFLAGS="-Wl,-z,relro,-z,now -Wl,-z,noexecstack" \
GO111MODULE=on GOFLAGS=-mod=vendor \
go build -buildmode=pie -ldflags "-linkmode=external -w -s" \
-o %{gobuilddir}/bin/etcd %{goipath}
for cmd in etcdctl; do
GO111MODULE=on GOFLAGS=-mod=vendor go build -o %{gobuilddir}/bin/$(basename $cmd) %{goipath}/$cmd
CGO_CFLAGS="-fstack-protector-strong -fPIE -D_FORTIFY_SOURCE=2 -O2" \
CGO_LDFLAGS_ALLOW="-Wl,-z,relro,-z,now" \
CGO_LDFLAGS="-Wl,-z,relro,-z,now -Wl,-z,noexecstack" \
GO111MODULE=on GOFLAGS=-mod=vendor \
go build -buildmode=pie -ldflags "-linkmode=external -w -s" \
-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 +116,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 +149,23 @@ 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
* Wed Oct 19 2022 wuzx<wuzx1226@qq.com> - 3.4.14-5
- add sw64 patch
* Wed Sep 2021 jikui <jikui2@huawei.com> - 3.4.14-4
- modify build flags for secure compilation options
* Wed Jun 2021 jiangxinyu <jiangxinyu@kylinos.cn> - 3.4.14-3
- Solve the problem of etcd on unsupported platform without ETCD_UNSUPPORTED_ARCH=arm64 set
* Thu Mar 04 2021 jiangxinyu <jiangxinyu@kylinos.cn> - 3.4.14-2
- Remove the BuildRequires: go-compilers package
* Thu Jan 21 2021 jiangxinyu <jiangxinyu@kylinos.cn> - 3.4.14-1
- Update to 3.4.14
* Thu Aug 13 2020 jiangxinyu <jiangxinyu@kylinos.cn> - 3.4.7-1
- Init etcd project

BIN
man-3.4.14.tar.gz Normal file

Binary file not shown.

Binary file not shown.