Skip to content

Commit c09aca1

Browse files
committed
Split etcdctl into etcdctl (public API access) & etcdutl (direct surgery on files)
Motivation is as follows: - etcdctl we only depend on clientv3 APIs, no dependencies of bolt, backend, mvcc, file-layout - etcdctl can be officially supported across wide range of versions, while etcdutl is pretty specific to file format at particular version. it's step towards desired modules layout, documented in: https://etcd.io/docs/next/dev-internal/modules/
1 parent 1675101 commit c09aca1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1788
-963
lines changed

Makefile

+3-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ build:
2525
GO_BUILD_FLAGS="-v" ./build.sh
2626
./bin/etcd --version
2727
./bin/etcdctl version
28+
./bin/etcdutl version
2829

2930
clean:
3031
rm -f ./codecov
@@ -210,7 +211,7 @@ build-docker-release-main:
210211
docker run \
211212
--rm \
212213
gcr.io/etcd-development/etcd:$(ETCD_VERSION) \
213-
/bin/sh -c "/usr/local/bin/etcd --version && /usr/local/bin/etcdctl version"
214+
/bin/sh -c "/usr/local/bin/etcd --version && /usr/local/bin/etcdctl version && /usr/local/bin/etcdutl version"
214215

215216
push-docker-release-main:
216217
$(info ETCD_VERSION: $(ETCD_VERSION))
@@ -529,6 +530,7 @@ build-docker-functional:
529530
/bin/bash -c "./bin/etcd --version && \
530531
./bin/etcd-failpoints --version && \
531532
./bin/etcdctl version && \
533+
./bin/etcdutl version && \
532534
./bin/etcd-agent -help || true && \
533535
./bin/etcd-proxy -help || true && \
534536
./bin/etcd-runner --help || true && \

bill-of-materials.json

+9
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,15 @@
485485
}
486486
]
487487
},
488+
{
489+
"project": "go.etcd.io/etcd/etcdutl/v3",
490+
"licenses": [
491+
{
492+
"type": "Apache License 2.0",
493+
"confidence": 1
494+
}
495+
]
496+
},
488497
{
489498
"project": "go.etcd.io/etcd/pkg/v3",
490499
"licenses": [

build.sh

+10
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,16 @@ etcd_build() {
4747
-o="../${out}/etcd" . || return 2
4848
) || return 2
4949

50+
run rm -f "${out}/etcdutl"
51+
# shellcheck disable=SC2086
52+
(
53+
cd ./etcdutl
54+
run env GO_BUILD_FLAGS="${GO_BUILD_FLAGS}" "${GO_BUILD_ENV[@]}" go build $GO_BUILD_FLAGS \
55+
-installsuffix=cgo \
56+
"-ldflags=${GO_LDFLAGS[*]}" \
57+
-o="../${out}/etcdutl" . || return 2
58+
) || return 2
59+
5060
run rm -f "${out}/etcdctl"
5161
# shellcheck disable=SC2086
5262
(

dummy.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ package main_test
1818
// module (e.g. for sake of 'bom' generation).
1919
// Thanks to this 'go mod tidy' is not removing that dependencies from go.mod.
2020
import (
21-
_ "go.etcd.io/etcd/client/v2" // keep
22-
_ "go.etcd.io/etcd/tests/v3/integration" // keep
21+
_ "go.etcd.io/etcd/client/v2" // keep
22+
_ "go.etcd.io/etcd/etcdctl/v3/ctlv3/command" // keep
23+
_ "go.etcd.io/etcd/etcdutl/v3/etcdutl" // keep
24+
_ "go.etcd.io/etcd/tests/v3/integration" // keep
2325
)

0 commit comments

Comments
 (0)