Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
e7f96b0
Bump Go to 1.25.10
silentred May 8, 2026
9bbe31b
Merge pull request #21727 from silentred/release-3.6-bump-go-1.25.10
ahrtr May 8, 2026
49cd4a4
bugfix: MemberUpdate implicitly and unexpectedly promotes a learner
silentred May 11, 2026
00e1b15
Merge pull request #21736 from silentred/release-3.6-bugfix-memberupd…
ahrtr May 11, 2026
449e34b
etcdutl: validate data file path and return consistent errors instead…
silentred May 20, 2026
aaf38f8
Merge pull request #21768 from silentred/release-3.6-etcdutl-invalid-…
fuweid May 20, 2026
e1468c8
client/pkg/fileutil: use os.Getuid() to skip TestIsDirWriteable as root
vivekpatani May 20, 2026
2286051
Merge pull request #21794 from vivekpatani/cherry-pick-21788-release-3.6
ahrtr May 23, 2026
576a6a0
server: allow non-admin maintenance status
Apr 26, 2026
8b95963
Merge pull request #21811 from Deln0r/release-3.6-backport-21666
ahrtr May 27, 2026
4233958
Add V2Depr1WriteOnlySkipCheck to bypass the v2 data store check
sahilpatel09 May 29, 2026
90b034a
version: bump up to 3.6.12
ivanvc Jun 1, 2026
4fc29de
Merge pull request #21850 from sahilpatel09/skip-v2-datastore-check-f…
ahrtr Jun 2, 2026
b054801
Update Go to 1.25.11
AR21SM Jun 3, 2026
2aebc25
Merge pull request #21892 from AR21SM/bump-go-1.25.11-release-3.6
ahrtr Jun 3, 2026
0fb05f8
Bump golang.org/x/crypto to v0.52.0
AR21SM Jun 4, 2026
3c15b48
Merge pull request #21904 from AR21SM/bump-x-crypto-v0.52.0-release-3.6
ahrtr Jun 4, 2026
624550a
build(deps): bump distroless/static-debian12 from `20bc6c0` to `9c346e4`
dependabot[bot] Jun 4, 2026
402d77b
Merge pull request #21886 from etcd-io/dependabot/docker/release-3.6/…
ivanvc Jun 5, 2026
b590da4
Bump OpenTelemetry dependencies to v1.43.0
AR21SM Jun 6, 2026
269a80d
Merge pull request #21918 from AR21SM/bump-otel-release-3.6
ahrtr Jun 7, 2026
380f8cf
server/auth: accept bearer-prefixed auth tokens
sahilpatel09 Jun 4, 2026
6d300b5
Merge pull request #21932 from k8s-infra-cherrypick-robot/cherry-pick…
fuweid Jun 9, 2026
907c334
Update incorrect log message
ahrtr Jun 12, 2026
1663b36
Merge pull request #21955 from k8s-infra-cherrypick-robot/cherry-pick…
fuweid Jun 15, 2026
8221ae8
Reject the client request if the client certificate has been revoked
ahrtr Jul 1, 2026
421b2ec
Merge pull request #22025 from ahrtr/20260701_crl_3.6
ahrtr Jul 1, 2026
b0f9ef1
version: bump up to 3.6.13
ivanvc Jul 1, 2026
afedd47
Merge remote-tracking branch 'openshift/release-5.0' into HEAD
dusk125 Jul 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .go-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.25.9
1.25.11
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG ARCH=amd64
FROM --platform=linux/${ARCH} gcr.io/distroless/static-debian12@sha256:20bc6c0bc4d625a22a8fde3e55f6515709b32055ef8fb9cfbddaa06d1760f838
FROM --platform=linux/${ARCH} gcr.io/distroless/static-debian12@sha256:9c346e4be81b5ca7ff31a0d89eaeade58b0f95cfd3baed1f36083ddb47ca3160

ADD etcd /usr/local/bin/
ADD etcdctl /usr/local/bin/
Expand Down
8 changes: 4 additions & 4 deletions api/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module go.etcd.io/etcd/api/v3

go 1.25.0

toolchain go1.25.9
toolchain go1.25.11

require (
github.com/coreos/go-semver v0.3.1
Expand All @@ -20,9 +20,9 @@ require (
github.com/kr/text v0.2.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rogpeppe/go-internal v1.14.1 // indirect
golang.org/x/net v0.52.0 // indirect
golang.org/x/sys v0.42.0 // indirect
golang.org/x/text v0.36.0 // indirect
golang.org/x/net v0.54.0 // indirect
golang.org/x/sys v0.45.0 // indirect
golang.org/x/text v0.37.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Expand Down
12 changes: 6 additions & 6 deletions api/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,20 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.52.0 h1:He/TN1l0e4mmR3QqHMT2Xab3Aj3L9qjbhRm78/6jrW0=
golang.org/x/net v0.52.0/go.mod h1:R1MAz7uMZxVMualyPXb+VaqGSa3LIaUqk0eEt3w36Sw=
golang.org/x/net v0.54.0 h1:2zJIZAxAHV/OHCDTCOHAYehQzLfSXuf/5SoL/Dv6w/w=
golang.org/x/net v0.54.0/go.mod h1:Sj4oj8jK6XmHpBZU/zWHw3BV3abl4Kvi+Ut7cQcY+cQ=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo=
golang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
golang.org/x/sys v0.45.0 h1:dO4czNzziLiiXplLQgBCEpCvXQ3dnkn0SdaZSYdQ+FY=
golang.org/x/sys v0.45.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.36.0 h1:JfKh3XmcRPqZPKevfXVpI1wXPTqbkE5f7JA92a55Yxg=
golang.org/x/text v0.36.0/go.mod h1:NIdBknypM8iqVmPiuco0Dh6P5Jcdk8lJL0CUebqK164=
golang.org/x/text v0.37.0 h1:Cqjiwd9eSg8e0QAkyCaQTNHFIIzWtidPahFWR83rTrc=
golang.org/x/text v0.37.0/go.mod h1:a5sjxXGs9hsn/AJVwuElvCAo9v8QYLzvavO5z2PiM38=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
Expand Down
2 changes: 1 addition & 1 deletion api/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
var (
// MinClusterVersion is the min cluster version this etcd binary is compatible with.
MinClusterVersion = "3.0.0"
Version = "3.6.11"
Version = "3.6.13"
APIVersion = "unknown"

// Git SHA Value will be set during build
Expand Down
9 changes: 1 addition & 8 deletions client/pkg/fileutil/fileutil_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
"io"
"math/rand"
"os"
"os/user"
"path/filepath"
"runtime"
"strings"
Expand All @@ -35,13 +34,7 @@ func TestIsDirWriteable(t *testing.T) {
tmpdir := t.TempDir()
require.NoErrorf(t, IsDirWriteable(tmpdir), "unexpected IsDirWriteable error")
require.NoErrorf(t, os.Chmod(tmpdir, 0o444), "unexpected os.Chmod error")
me, err := user.Current()
if err != nil {
// err can be non-nil when cross compiled
// http://stackoverflow.com/questions/20609415/cross-compiling-user-current-not-implemented-on-linux-amd64
t.Skipf("failed to get current user: %v", err)
}
if me.Name == "root" || runtime.GOOS == "windows" {
if os.Getuid() == 0 || runtime.GOOS == "windows" {
// ideally we should check CAP_DAC_OVERRIDE.
// but it does not matter for tests.
// Chmod is not supported under windows.
Expand Down
4 changes: 2 additions & 2 deletions client/pkg/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ module go.etcd.io/etcd/client/pkg/v3

go 1.25.0

toolchain go1.25.9
toolchain go1.25.11

require (
github.com/coreos/go-systemd/v22 v22.5.0
github.com/stretchr/testify v1.11.1
go.uber.org/zap v1.27.0
golang.org/x/sys v0.42.0
golang.org/x/sys v0.45.0
)

require (
Expand Down
4 changes: 2 additions & 2 deletions client/pkg/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
golang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo=
golang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
golang.org/x/sys v0.45.0 h1:dO4czNzziLiiXplLQgBCEpCvXQ3dnkn0SdaZSYdQ+FY=
golang.org/x/sys v0.45.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
Expand Down
23 changes: 23 additions & 0 deletions client/pkg/transport/listener_tls.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,29 @@ func (l *tlsListener) acceptLoop() {
}
}

// ConfigureCRLVerification appends a VerifyConnection hook to cfg that
// rejects any peer certificate whose serial number appears in the CRL file
// configured on info. It is a no-op when CRLFile is empty. Any existing
// VerifyConnection hook is called first and its error short-circuits.
func (info TLSInfo) ConfigureCRLVerification(cfg *tls.Config) {
if len(info.CRLFile) == 0 {
return
}
crlFile := info.CRLFile
prev := cfg.VerifyConnection
cfg.VerifyConnection = func(cs tls.ConnectionState) error {
if prev != nil {
if err := prev(cs); err != nil {
return err
}
}
if len(cs.PeerCertificates) == 0 {
return nil
}
return checkCRL(crlFile, cs.PeerCertificates)
}
}
Comment on lines +169 to +190

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Add a unit test for ConfigureCRLVerification.

The method's logic (no-op when CRLFile empty, prior hook short-circuiting, allowing 0-cert connections, delegating to checkCRL) is a good candidate for a focused unit test (e.g., constructing a tls.ConnectionState with a revoked/non-revoked cert and asserting the returned error). Only an e2e test was added for this new security-relevant path.

As per coding guidelines, "All changes are expected to come with a unit test."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@client/pkg/transport/listener_tls.go` around lines 169 - 190, Add a focused
unit test for ConfigureCRLVerification in listener_tls.go that exercises the key
branches: no-op when TLSInfo.CRLFile is empty, existing cfg.VerifyConnection
being called first and short-circuiting on error, nil return when
tls.ConnectionState has no PeerCertificates, and delegation to checkCRL for a
connection with a certificate. Use TLSInfo and ConfigureCRLVerification to
locate the code, and assert both revoked and non-revoked outcomes via a
tls.ConnectionState setup.

Source: Coding guidelines


func checkCRL(crlPath string, cert []*x509.Certificate) error {
// TODO: cache
crlBytes, err := os.ReadFile(crlPath)
Expand Down
12 changes: 6 additions & 6 deletions client/v3/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ module go.etcd.io/etcd/client/v3

go 1.25.0

toolchain go1.25.9
toolchain go1.25.11

require (
github.com/coreos/go-semver v0.3.1
github.com/dustin/go-humanize v1.0.1
github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1
github.com/prometheus/client_golang v1.20.5
github.com/stretchr/testify v1.11.1
go.etcd.io/etcd/api/v3 v3.6.11
go.etcd.io/etcd/client/pkg/v3 v3.6.11
go.etcd.io/etcd/api/v3 v3.6.13
go.etcd.io/etcd/client/pkg/v3 v3.6.13
go.uber.org/zap v1.27.0
google.golang.org/grpc v1.79.3
sigs.k8s.io/yaml v1.4.0
Expand All @@ -33,9 +33,9 @@ require (
github.com/prometheus/common v0.62.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/net v0.52.0 // indirect
golang.org/x/sys v0.42.0 // indirect
golang.org/x/text v0.36.0 // indirect
golang.org/x/net v0.54.0 // indirect
golang.org/x/sys v0.45.0 // indirect
golang.org/x/text v0.37.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect
google.golang.org/protobuf v1.36.10 // indirect
Expand Down
12 changes: 6 additions & 6 deletions client/v3/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -85,20 +85,20 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.52.0 h1:He/TN1l0e4mmR3QqHMT2Xab3Aj3L9qjbhRm78/6jrW0=
golang.org/x/net v0.52.0/go.mod h1:R1MAz7uMZxVMualyPXb+VaqGSa3LIaUqk0eEt3w36Sw=
golang.org/x/net v0.54.0 h1:2zJIZAxAHV/OHCDTCOHAYehQzLfSXuf/5SoL/Dv6w/w=
golang.org/x/net v0.54.0/go.mod h1:Sj4oj8jK6XmHpBZU/zWHw3BV3abl4Kvi+Ut7cQcY+cQ=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo=
golang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
golang.org/x/sys v0.45.0 h1:dO4czNzziLiiXplLQgBCEpCvXQ3dnkn0SdaZSYdQ+FY=
golang.org/x/sys v0.45.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.36.0 h1:JfKh3XmcRPqZPKevfXVpI1wXPTqbkE5f7JA92a55Yxg=
golang.org/x/text v0.36.0/go.mod h1:NIdBknypM8iqVmPiuco0Dh6P5Jcdk8lJL0CUebqK164=
golang.org/x/text v0.37.0 h1:Cqjiwd9eSg8e0QAkyCaQTNHFIIzWtidPahFWR83rTrc=
golang.org/x/text v0.37.0/go.mod h1:a5sjxXGs9hsn/AJVwuElvCAo9v8QYLzvavO5z2PiM38=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
Expand Down
16 changes: 8 additions & 8 deletions etcdctl/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module go.etcd.io/etcd/etcdctl/v3

go 1.25.0

toolchain go1.25.9
toolchain go1.25.11

require (
github.com/bgentry/speakeasy v0.2.0
Expand All @@ -12,10 +12,10 @@ require (
github.com/spf13/cobra v1.10.2
github.com/spf13/pflag v1.0.10
github.com/stretchr/testify v1.11.1
go.etcd.io/etcd/api/v3 v3.6.11
go.etcd.io/etcd/client/pkg/v3 v3.6.11
go.etcd.io/etcd/client/v3 v3.6.11
go.etcd.io/etcd/pkg/v3 v3.6.11
go.etcd.io/etcd/api/v3 v3.6.13
go.etcd.io/etcd/client/pkg/v3 v3.6.13
go.etcd.io/etcd/client/v3 v3.6.13
go.etcd.io/etcd/pkg/v3 v3.6.13
go.uber.org/zap v1.27.0
golang.org/x/time v0.9.0
google.golang.org/grpc v1.79.3
Expand All @@ -37,9 +37,9 @@ require (
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/net v0.52.0 // indirect
golang.org/x/sys v0.42.0 // indirect
golang.org/x/text v0.36.0 // indirect
golang.org/x/net v0.54.0 // indirect
golang.org/x/sys v0.45.0 // indirect
golang.org/x/text v0.37.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect
google.golang.org/protobuf v1.36.10 // indirect
Expand Down
12 changes: 6 additions & 6 deletions etcdctl/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -112,21 +112,21 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.52.0 h1:He/TN1l0e4mmR3QqHMT2Xab3Aj3L9qjbhRm78/6jrW0=
golang.org/x/net v0.52.0/go.mod h1:R1MAz7uMZxVMualyPXb+VaqGSa3LIaUqk0eEt3w36Sw=
golang.org/x/net v0.54.0 h1:2zJIZAxAHV/OHCDTCOHAYehQzLfSXuf/5SoL/Dv6w/w=
golang.org/x/net v0.54.0/go.mod h1:Sj4oj8jK6XmHpBZU/zWHw3BV3abl4Kvi+Ut7cQcY+cQ=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo=
golang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
golang.org/x/sys v0.45.0 h1:dO4czNzziLiiXplLQgBCEpCvXQ3dnkn0SdaZSYdQ+FY=
golang.org/x/sys v0.45.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.36.0 h1:JfKh3XmcRPqZPKevfXVpI1wXPTqbkE5f7JA92a55Yxg=
golang.org/x/text v0.36.0/go.mod h1:NIdBknypM8iqVmPiuco0Dh6P5Jcdk8lJL0CUebqK164=
golang.org/x/text v0.37.0 h1:Cqjiwd9eSg8e0QAkyCaQTNHFIIzWtidPahFWR83rTrc=
golang.org/x/text v0.37.0/go.mod h1:a5sjxXGs9hsn/AJVwuElvCAo9v8QYLzvavO5z2PiM38=
golang.org/x/time v0.9.0 h1:EsRrnYcQiGH+5FfbgvV4AP7qEZstoyrHB0DzarOQ4ZY=
golang.org/x/time v0.9.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
Expand Down
14 changes: 14 additions & 0 deletions etcdutl/etcdutl/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package etcdutl

import (
"errors"
"os"

"go.uber.org/zap"
"go.uber.org/zap/zapcore"
Expand All @@ -29,6 +30,19 @@ import (
"go.etcd.io/raft/v3/raftpb"
)

// validateDataDir checks if the data directory's backend database file exists.
func validateDataDir(dataDir string) error {
dbPath := datadir.ToBackendFileName(dataDir)
return validateFilePath(dbPath)
}

// validateFilePath checks if the specified file exists.
// It returns an error encountered by os.Stat, such as os.ErrNotExist, os.ErrPermission, etc.
func validateFilePath(filePath string) error {
_, err := os.Stat(filePath)
return err
}

func GetLogger() *zap.Logger {
config := logutil.DefaultZapLoggerConfig
config.Encoding = "console"
Expand Down
9 changes: 7 additions & 2 deletions etcdutl/etcdutl/defrag_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,13 @@ func defragCommandFunc(cmd *cobra.Command, args []string) {
}

func DefragData(dataDir string) error {
var be backend.Backend
lg := GetLogger()
var (
be backend.Backend
lg = GetLogger()
)
if err := validateDataDir(dataDir); err != nil {
return err
}
bch := make(chan struct{})
dbDir := datadir.ToBackendFileName(dataDir)
go func() {
Expand Down
3 changes: 3 additions & 0 deletions etcdutl/etcdutl/hashkv_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ type HashKV struct {
}

func calculateHashKV(dbPath string, rev int64) (HashKV, error) {
if err := validateFilePath(dbPath); err != nil {
return HashKV{}, err
}
cfg := backend.DefaultBackendConfig(zap.NewNop())
cfg.Path = dbPath
b := backend.New(cfg)
Expand Down
3 changes: 3 additions & 0 deletions etcdutl/etcdutl/migrate_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ func (c *migrateConfig) finalize() error {
}

func migrateCommandFunc(c *migrateConfig) error {
if err := validateDataDir(c.dataDir); err != nil {
return err
}
dbPath := datadir.ToBackendFileName(c.dataDir)
be := backend.NewDefaultBackend(GetLogger(), dbPath)
defer be.Close()
Expand Down
3 changes: 3 additions & 0 deletions etcdutl/etcdutl/snapshot_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ func SnapshotStatusCommandFunc(cmd *cobra.Command, args []string) {
err := fmt.Errorf("snapshot status requires exactly one argument")
cobrautl.ExitWithError(cobrautl.ExitBadArgs, err)
}
if err := validateFilePath(args[0]); err != nil {
cobrautl.ExitWithError(cobrautl.ExitError, err)
}
printer := initPrinterFromCmd(cmd)

lg := GetLogger()
Expand Down
28 changes: 14 additions & 14 deletions etcdutl/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module go.etcd.io/etcd/etcdutl/v3

go 1.25.0

toolchain go1.25.9
toolchain go1.25.11

replace (
go.etcd.io/etcd/api/v3 => ../api
Expand All @@ -27,11 +27,11 @@ require (
github.com/spf13/cobra v1.10.2
github.com/stretchr/testify v1.11.1
go.etcd.io/bbolt v1.4.3
go.etcd.io/etcd/api/v3 v3.6.11
go.etcd.io/etcd/client/pkg/v3 v3.6.11
go.etcd.io/etcd/client/v3 v3.6.11
go.etcd.io/etcd/pkg/v3 v3.6.11
go.etcd.io/etcd/server/v3 v3.6.11
go.etcd.io/etcd/api/v3 v3.6.13
go.etcd.io/etcd/client/pkg/v3 v3.6.13
go.etcd.io/etcd/client/v3 v3.6.13
go.etcd.io/etcd/pkg/v3 v3.6.13
go.etcd.io/etcd/server/v3 v3.6.13
go.etcd.io/raft/v3 v3.6.0
go.uber.org/zap v1.27.0
)
Expand Down Expand Up @@ -72,18 +72,18 @@ require (
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 // indirect
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.59.0 // indirect
go.opentelemetry.io/otel v1.40.0 // indirect
go.opentelemetry.io/otel v1.43.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0 // indirect
go.opentelemetry.io/otel/metric v1.40.0 // indirect
go.opentelemetry.io/otel/sdk v1.40.0 // indirect
go.opentelemetry.io/otel/trace v1.40.0 // indirect
go.opentelemetry.io/otel/metric v1.43.0 // indirect
go.opentelemetry.io/otel/sdk v1.43.0 // indirect
go.opentelemetry.io/otel/trace v1.43.0 // indirect
go.opentelemetry.io/proto/otlp v1.5.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.49.0 // indirect
golang.org/x/net v0.52.0 // indirect
golang.org/x/sys v0.42.0 // indirect
golang.org/x/text v0.36.0 // indirect
golang.org/x/crypto v0.52.0 // indirect
golang.org/x/net v0.54.0 // indirect
golang.org/x/sys v0.45.0 // indirect
golang.org/x/text v0.37.0 // indirect
golang.org/x/time v0.9.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect
Expand Down
Loading