Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
3bb4470
Reject watch request with -1 revision and make rangeEvents safe again…
serathius Sep 21, 2025
4790130
Merge pull request #20707 from k8s-infra-cherrypick-robot/cherry-pick…
serathius Sep 24, 2025
ee85ed3
server/embed: Log EOF on DEBUG in TLS handshake
tchap Aug 27, 2025
3bbdd68
Merge pull request #20749 from k8s-infra-cherrypick-robot/cherry-pick…
ahrtr Oct 2, 2025
4973fd4
Fix endpoint status not retuning the correct storage quota
ahrtr Oct 12, 2025
4dfe6c1
Merge pull request #20790 from ahrtr/20251012_quota_3.6
fuweid Oct 12, 2025
1e02301
Bump go to 1.24.9
hwdef Oct 15, 2025
9d7222c
Merge pull request #20801 from hwdef/release-36-bump-go1249
ahrtr Oct 15, 2025
e88e142
test: add promote with auth e2e tests
xUser5000 Oct 8, 2025
5377bb9
etcdserver: fix cannot promote with auth from follower
xUser5000 Oct 12, 2025
76ee0bc
etcdserver: follow convention to extract auth token in cluster_util.go
xUser5000 Oct 28, 2025
db6be4c
tests: use WaitLeader() in memberPromoteWithAuth()
xUser5000 Oct 28, 2025
52b2948
Merge pull request #20874 from k8s-infra-cherrypick-robot/cherry-pick…
ahrtr Oct 31, 2025
7d3fc02
Add an e2e test cases to reproduce the '--force-new-cluster' can't re…
ahrtr Nov 6, 2025
523100b
Fix the '--force-new-cluster' can't clean up learners issue
ahrtr Nov 6, 2025
d1a3bee
Merge pull request #20896 from k8s-infra-cherrypick-robot/cherry-pick…
ahrtr Nov 6, 2025
2c0db32
Bump from go1.24.9 to go1.24.10
ronaldngounou Nov 7, 2025
88b9794
Merge pull request #20901 from ronaldngounou/release36-bump-go12410
ahrtr Nov 7, 2025
145d927
v3rpc: add and use getServerMetrics() with global metricsServerCached
mingl1 Nov 7, 2025
0745315
Merge pull request #20905 from k8s-infra-cherrypick-robot/cherry-pick…
ahrtr Nov 7, 2025
d2809cf
version: bump up to 3.6.6
ivanvc Nov 12, 2025
554dc70
Print token fingerprint instead of the original tokens in log messages
ahrtr Nov 17, 2025
f185ce6
Merge pull request #20941 from ahrtr/20251117_tokens_3.6
ahrtr Nov 17, 2025
97141e1
Bump go to 1.24.11
hwdef Dec 6, 2025
dbaf5cf
Merge pull request #20998 from hwdef/release36-bump-go-12411
ahrtr Dec 6, 2025
61af088
dependency: Bump golang.org/x/net from 0.38.0 to 0.45.0
ivanvc Dec 16, 2025
6bfd01c
Merge pull request #21024 from ivanvc/release-3.6-x-net-0.45.0
ahrtr Dec 16, 2025
e838ef1
version: bump up to 3.6.7
joshjms Dec 17, 2025
f767aa2
dependency: Bump golang.org/x/crypto from 0.42.0 to 0.45.0
ivanvc Dec 18, 2025
81c32a4
tools: explicitly require golang.org/x/tools/cmd/goimports
ivanvc Dec 19, 2025
fb02473
Merge pull request #21037 from ivanvc/release-3.6-x-crypto-0.45.0
ahrtr Dec 19, 2025
a889244
Remove flag --max-snapshots in 3.8 rather than 3.7
ahrtr Jan 19, 2026
45dbe3c
Merge pull request #21161 from ahrtr/20260119_max_snapshots_3.6
ahrtr Jan 19, 2026
e830821
Keep the --snapshot-count flag
ahrtr Jan 19, 2026
cb073ab
Merge pull request #21163 from ahrtr/20260119_snapshot_count_3.6
ahrtr Jan 20, 2026
ef87996
Bump go version to 1.24.11
ahrtr Jan 30, 2026
451c7d5
Merge pull request #21216 from ahrtr/20260130_go_3.6
ahrtr Jan 30, 2026
bf78336
Remove the use of grpc-go's Metadata field
ahrtr Feb 3, 2026
b17ff7e
Merge pull request #21241 from ahrtr/20260203_metadata_3.6
fuweid Feb 3, 2026
2d3c79c
[release-3.6] Bump go version to 1.24.13
tsujiri Feb 6, 2026
d552466
Merge pull request #21257 from nwnt/bump-3.6-to-gov1.24.3
ahrtr Feb 6, 2026
4e814e2
version: bump up to 3.6.8
ivanvc Feb 13, 2026
f8692e2
server/etcdserver/api/v3rpc: run metrics interceptors before handlers
fuweid Feb 16, 2026
7e2b02c
Merge pull request #21329 from k8s-infra-cherrypick-robot/cherry-pick…
serathius Feb 19, 2026
e4522d8
dependency: bump go.opentelemetry.io/otel/sdk from v1.34.0 to v1.40.0
henrybear327 Feb 22, 2026
259e181
Merge pull request #21340 from henrybear327/dependency/release-3.6/go…
ahrtr Feb 22, 2026
d456631
server/etcdmain: fix deadlock issue for grpcproxy
fuweid Feb 22, 2026
56fff11
Merge pull request #21354 from k8s-infra-cherrypick-robot/cherry-pick…
fuweid Feb 24, 2026
179dcf8
Fix race berween read index and leader change causing a stale read
serathius Feb 25, 2026
ac6f33e
Merge pull request #21378 from k8s-infra-cherrypick-robot/cherry-pick…
fuweid Feb 26, 2026
fe194ee
Fix unit test failure
ahrtr Feb 26, 2026
325f60a
Merge pull request #21381 from ahrtr/test_fix
ahrtr Feb 26, 2026
a6e27ce
Print the endpoint the grpc client connected to in unary interceptor
ahrtr Feb 26, 2026
2c550aa
Merge pull request #21382 from k8s-infra-cherrypick-robot/cherry-pick…
ahrtr Feb 26, 2026
a395a60
Bump golangci lint to v2
ivanvc Feb 27, 2026
51d12af
Add defer-recover block to prevent panic when cc is nil
joshjms Apr 24, 2025
1c4d3e5
Merge pull request #21395 from ivanvc/release-3.6-golangci-lint-v2
ahrtr Feb 28, 2026
1f234c9
[release-3.6] bump Go to 1.25.7
Feb 27, 2026
1006801
etcdctl: fix slice bounds trimming single-quoted args
huajianxiaowanzi Feb 13, 2026
1d60990
etcdctl: add unit test for Argify
huajianxiaowanzi Feb 13, 2026
745da53
etcdctl: add license header
huajianxiaowanzi Mar 1, 2026
95e3042
Merge pull request #21402 from huajianxiaowanzi/manual-backport-21307…
ahrtr Mar 1, 2026
7116d86
Merge pull request #21393 from shuan1026/bump-3.6-to-gov1.25.7
fuweid Mar 2, 2026
928b3c6
devcontainer: bump Go image to 1.25 for release-3.6
shuan1026 Mar 2, 2026
200dbea
Don't reuse same ReadIndex
serathius Feb 27, 2026
c4174a8
Merge pull request #21417 from serathius/read-request-id-release-3.6
serathius Mar 3, 2026
b84d016
Merge pull request #21408 from shuan1026/devcontainer-bump-go-1.25
ahrtr Mar 4, 2026
00bd77f
Bump golang.org/x/net@ v0.51.0 fixes GO-2026-4559
ArkaSaha30 Mar 6, 2026
d131ca7
Revert "Reuse events between sync loops"
serathius Mar 5, 2026
3dd99be
Merge pull request #21440 from ArkaSaha30/fix-cve-GO-2026-4559-3.6
ahrtr Mar 6, 2026
59a0f86
Merge pull request #21443 from serathius/revert-reuse-watch-release-3.6
ahrtr Mar 6, 2026
02bec62
build(deps): bump distroless/static-debian12 from `3f2b64e` to `20bc6c0`
dependabot[bot] Mar 6, 2026
cf9553d
Bump Go to 1.25.8
ivanvc Mar 6, 2026
fff3176
[release-3.6] devcontainer: remove devcontainer config
shuan1026 Mar 6, 2026
bc93060
Merge pull request #21442 from shuan1026/remove-devcontainer-release-3.6
ahrtr Mar 9, 2026
a402fbe
Merge pull request #21463 from ivanvc/release-3.6-go-1.25.8
ahrtr Mar 9, 2026
db3cc27
Merge pull request #21449 from etcd-io/dependabot/docker/release-3.6/…
ahrtr Mar 9, 2026
3080527
server/etcdserver: enforce auth checks for nested txn ops
fuweid Mar 10, 2026
7f73a57
server/etcdserver: guard unauthenticated endpoints with auth checks
fuweid Mar 11, 2026
68551b3
tests: update test for auth
fuweid Mar 16, 2026
2363b86
Merge commit from fork
ahrtr Mar 19, 2026
8f45f52
Merge commit from fork
ahrtr Mar 19, 2026
f899801
dependency: Bump google.golang.org/grpc from v1.75.0 to 1.79.3
ivanvc Mar 19, 2026
1526350
tests/integration: fix flaky testcase
fuweid Mar 19, 2026
2a8cd59
Merge pull request #21497 from fuweid/3.6-weifu-donotreview
ahrtr Mar 20, 2026
d2fd011
Merge pull request #21501 from ivanvc/release-3.6-grpc-go-1.79.3
ahrtr Mar 20, 2026
85651fa
version: bump up to 3.6.9
ivanvc Mar 20, 2026
edb03bb
DOWNSTREAM: <carry>: ETCD-656: Automate datadir move after quorum-res…
tjungblu Sep 12, 2024
5deccc5
NO-JIRA: use golang 1.23 image
Elbehery Sep 26, 2024
81910cc
DOWNSTREAM <carry>: resolve merge conflicts
tjungblu Oct 27, 2023
e553937
Add support for cachi2 based deps
jupierce Oct 28, 2024
bc0d787
Migrate Dockerfile.art for Konflux
jupierce Oct 29, 2024
a1aff0c
DOWNSTREAM: <carry>: ETCD-696: Add rev bumping to force-new-cluster
tjungblu Nov 4, 2024
00f0c5d
DOWNSTREAM: <carry>: OCPBUGS-50510: make hardware related timeout del…
everettraven Feb 26, 2025
ed5a6bb
Updating ose-etcd-container image to be consistent with ART for 4.20
Jun 18, 2025
76727fd
Updating ose-etcd-container image to be consistent with ART for 4.21
Sep 29, 2025
6ed51f6
Merge branch 'openshift-4.22' into rebase-etcd-3.6.9-openshift-4.22
sdodson Mar 25, 2026
f483069
DOWNSTREAM: <drop>: 3.6.9 fixup
sdodson Mar 25, 2026
fe7e37b
DOWNSTREAM: <carry>: Update CLAUDE.md with rebase lessons learned
sdodson Mar 25, 2026
800c8c4
DOWNSTREAM: <drop>: Remove stale tests/integration/cluster.go
sdodson Mar 25, 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 .ci-operator.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
build_root_image:
name: release
namespace: openshift
tag: rhel-9-release-golang-1.24-openshift-4.22
tag: rhel-9-release-golang-1.25-openshift-4.22
22 changes: 0 additions & 22 deletions .devcontainer/devcontainer.json

This file was deleted.

2 changes: 1 addition & 1 deletion .go-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.24.7
1.25.8
140 changes: 140 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
# Claude Code Instructions for openshift/etcd

## Repository Overview

This is the OpenShift fork of [etcd-io/etcd](https://github.com/etcd-io/etcd). It tracks upstream etcd releases with downstream patches applied on top for OpenShift integration.

### Remotes

- `origin` = `git@github.com:openshift/etcd` (the OpenShift fork)
- `upstream` = `https://github.com/etcd-io/etcd` (upstream etcd)
- User forks are added as needed for PRs

### Branch Naming

- `openshift-4.XX` branches track specific OpenShift releases
- Rebase branches follow the pattern `rebase-etcd-<version>-openshift-<release>`

## Upstream Rebase Procedure

When asked to rebase to a new upstream etcd version (e.g., "rebase v3.6.9"), follow these steps:

### 1. Identify the Current Upstream Base

Find which upstream tag the current branch is based on. Look for a commit like `version: bump up to 3.6.X` in the log, or check the most recent upstream tag that is an ancestor:

```
git log --oneline | grep "version: bump up to"
```

### 2. Identify Downstream Patches

List all commits on top of the current upstream base:

```
git log --oneline <current-upstream-tag>..HEAD --no-merges
```

Categorize each commit:

- **`DOWNSTREAM: <carry>:`** - Must be cherry-picked onto the new base. These are ongoing downstream patches.
- **`DOWNSTREAM: <drop>:`** - Skip these. They were fixups specific to the previous upstream version.
- **Merge commits** - Skip these. They will be replaced by the new rebase structure.
- **Other downstream commits** (ART image updates, Dockerfile changes, Konflux/cachi2 support, etc.) - Carry these forward unless they are clearly version-specific.

### 3. Create the Rebase Branch

```
git checkout -b rebase-etcd-<new-version>-openshift-<release> <new-upstream-tag>
```

### 4. Cherry-pick Carry Patches

Cherry-pick in chronological order (oldest first). Resolve conflicts as they arise, preferring the new upstream version for any upstream code and preserving downstream intent for downstream code:

```
git cherry-pick <commit-sha>
```

### 5. Merge the Target Branch to Resolve PR Conflicts

After cherry-picking all carry patches, the PR will likely have merge conflicts because both branches (the target and the rebase) contain the same downstream files applied on different upstream bases. To fix this, merge the target branch into the rebase branch, resolving all conflicts by keeping the rebased (ours) version:

```
git merge origin/openshift-4.XX --no-commit
git checkout --ours <conflicted-files>
git add <conflicted-files>
git commit
```

This merge commit ensures the PR can be merged cleanly on GitHub.

### 6. Create a `DOWNSTREAM: <drop>` Fixup Commit

After cherry-picking and merging, you almost certainly need a fixup commit to resolve build failures caused by upstream API changes. Common issues:

**Moved/renamed packages:** Upstream refactors move packages between versions. Check for import errors and find the new locations using `find` or `ls`. Known moves in recent versions:
- `server/datadir` → `server/storage/datadir`
- `server/wal` → `server/storage/wal`
- `server/wal/walpb` → `server/storage/wal/walpb`
- `pkg/grpc_testing` → `pkg/grpctesting` (also `GrpcRecorder` → `GRPCRecorder`)
- `server/etcdserver/api/v2http` was removed; use `etcdhttp` handlers instead

**Removed/renamed functions:** Check the upstream equivalent code (e.g., `tests/framework/integration/cluster.go` for patterns) when a function like `toErr` is missing — it may have been renamed (e.g., to `ContextError`).

**Missing imports:** Downstream carry patches may add code using stdlib packages (like `os`, `strconv`) that weren't needed in the original file. If upstream refactored imports, those may be lost.

**Dockerfile/CI builder updates:** All `Dockerfile.*` and `.ci-operator.yaml` files reference specific Go versions and OpenShift release versions in their `FROM` lines. These must be updated to match the target OpenShift release and the Go version required by the new upstream tag.

**Do NOT downgrade the Go version:** If the new upstream tag requires a newer Go version (e.g., 1.25), do not attempt to downgrade it. The `go` directive in `go.mod` will be bumped back by `go mod tidy` because upstream dependencies require it.

Build and iterate:
```
make build
go build -v ./openshift-tools/...
```

Commit all fixes as `DOWNSTREAM: <drop>: <version> fixup`.

### 7. Push and Create PR

Push the rebase branch to a personal fork and create a PR against the target `openshift-4.XX` branch.

## Downstream Commit Message Conventions

- `DOWNSTREAM: <carry>: <JIRA-ID>: description` - Patches carried across rebases
- `DOWNSTREAM: <drop>: description` - One-time fixups dropped on next rebase
- `DOWNSTREAM <carry>: description` - Also valid (note: no colon after DOWNSTREAM)

## Build and Test

- Build: `make build` (builds etcd, etcdctl, etcdutl)
- Build downstream tools: `go build -v ./openshift-tools/...`
- Test: `make test`
- The `make build` target also builds etcdctl and etcdutl, so a successful `make build` covers the main binaries
- The `yamlfmt` warning during build is cosmetic and can be ignored

## Key Downstream Files

These files are downstream-only and don't exist in upstream etcd:

- `Dockerfile.art`, `Dockerfile.rhel`, `Dockerfile.installer` - OpenShift container builds
- `Dockerfile.art-cachi2`, `Dockerfile.installer.art-cachi2` - Konflux/cachi2 builds
- `.ci-operator.yaml` - CI configuration
- `build.sh` - OpenShift build script
- `openshift-hack/` - Downstream rebase tooling
- `openshift-tools/` - Downstream tools (e.g., discover-etcd-initial-cluster)
- `client/v3/patch_cluster.go` - Downstream client patch (NonLinearizeableMemberList)
- `server/revbump/` - Downstream revision bumping for force-new-cluster
- `server/config/config.go` - Has downstream additions (OPENSHIFT_ETCD_HARDWARE_DELAY_TIMEOUT)
- `REBASE.openshift.md` - Additional rebase documentation

**Removed files (do not re-add):**
- `tests/integration/cluster.go` - Removed during v3.6.9 rebase. Was a stale carry from v3.5 that duplicated `tests/framework/integration/cluster.go` and could not compile (referenced many removed upstream symbols). The `tests/integration/` package works without it — `lazy_cluster.go` and test files import from `tests/framework/integration` for the actual cluster implementation. If this file reappears in future carries, remove it again.

## Known Fragile Downstream Files

These files reference upstream internal APIs and are most likely to break during a rebase:

- `client/v3/patch_cluster.go` - Uses internal client functions that may be renamed upstream.
- `openshift-tools/pkg/discover-etcd-initial-cluster/walutil.go` - Imports server-internal packages (wal, datadir, snap) that move during upstream refactors.
2 changes: 0 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,6 @@ To get started, create a codespace for this repository by clicking this 👇

[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new?hide_repo_select=true&ref=main&repo=11225014)

A codespace will open in a web-based version of Visual Studio Code. The [dev container](.devcontainer/devcontainer.json) is fully configured with the software needed for this project.

**Note**: Dev containers is an open spec which is supported by [GitHub Codespaces](https://github.com/codespaces) and [other tools](https://containers.dev/supporting).

[file an issue]: https://github.com/etcd-io/etcd/issues/new/choose
Expand Down
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:3f2b64ef97bd285e36132c684e6b2ae8f2723293d09aae046196cca64251acac
FROM --platform=linux/${ARCH} gcr.io/distroless/static-debian12@sha256:20bc6c0bc4d625a22a8fde3e55f6515709b32055ef8fb9cfbddaa06d1760f838

ADD etcd /usr/local/bin/
ADD etcdctl /usr/local/bin/
Expand Down
26 changes: 26 additions & 0 deletions Dockerfile.art
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.25-openshift-4.22 AS builder

COPY $REMOTE_SOURCES $REMOTE_SOURCES_DIR
WORKDIR $REMOTE_SOURCES_DIR/cachito-gomod-with-deps/app
RUN ls -lR $REMOTE_SOURCES_DIR
RUN cat $REMOTE_SOURCES_DIR/cachito-gomod-with-deps/cachito.env
RUN source $REMOTE_SOURCES_DIR/cachito-gomod-with-deps/cachito.env && GOFLAGS='-mod=readonly' GO_BUILD_FLAGS='-v' ./build.sh

RUN mkdir -p /go/src/go.etcd.io/
RUN ln -s $REMOTE_SOURCES_DIR/cachito-gomod-with-deps/app /go/src/go.etcd.io/etcd

# stage 2 (note: any changes should reflect in Dockerfile.rhel)
FROM registry.ci.openshift.org/ocp/4.22:base-rhel9

ENTRYPOINT ["/usr/bin/etcd"]

RUN yum install --setopt=tsflags=nodocs -y jq && yum clean all && rm -rf /var/cache/yum/*

COPY --from=builder /go/src/go.etcd.io/etcd/bin/etcd /usr/bin/
COPY --from=builder /go/src/go.etcd.io/etcd/bin/etcdctl /usr/bin/
COPY --from=builder /go/src/go.etcd.io/etcd/bin/etcdutl /usr/bin/
COPY --from=builder /go/src/go.etcd.io/etcd/bin/discover-etcd-initial-cluster /usr/bin/

LABEL io.k8s.display-name="etcd server" \
io.k8s.description="etcd is a distributed key-value store which stores the persistent master state for Kubernetes and OpenShift." \
maintainer="Sam Batschelet <sbatsche@redhat.com>"
4 changes: 2 additions & 2 deletions Dockerfile.art-cachi2
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.24-openshift-4.21 AS builder
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.25-openshift-4.22 AS builder

WORKDIR /go/src/go.etcd.io/etcd
COPY . .
RUN GOFLAGS='-mod=readonly' GO_BUILD_FLAGS='-v' ./build.sh

# stage 2 (note: any changes should reflect in Dockerfile.rhel)
FROM registry.ci.openshift.org/ocp/4.21:base-rhel9
FROM registry.ci.openshift.org/ocp/4.22:base-rhel9

ENTRYPOINT ["/usr/bin/etcd"]

Expand Down
12 changes: 6 additions & 6 deletions Dockerfile.installer
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
# This Dockerfile builds an image containing Mac and Linux ARM64/AMD64 versions of the etcd.
# The resulting image is used to build the statically-linked openshift-installer binary.

FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.24-openshift-4.21 AS macbuilder
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.25-openshift-4.22 AS macbuilder
ENV GO_COMPLIANCE_EXCLUDE=".*"
WORKDIR /go/src/go.etcd.io/etcd
COPY . .
RUN CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 GOFLAGS='-mod=readonly' GO_BUILD_FLAGS='-v' ./build.sh

FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.24-openshift-4.21 AS macarmbuilder
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.25-openshift-4.22 AS macarmbuilder
ENV GO_COMPLIANCE_EXCLUDE=".*"
WORKDIR /go/src/go.etcd.io/etcd
COPY . .
RUN CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 GOFLAGS='-mod=readonly' GO_BUILD_FLAGS='-v' ./build.sh

FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.24-openshift-4.21 AS linuxbuilder
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.25-openshift-4.22 AS linuxbuilder
ENV GO_COMPLIANCE_EXCLUDE=".*"
WORKDIR /go/src/go.etcd.io/etcd
COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GOFLAGS='-mod=readonly' GO_BUILD_FLAGS='-v' ./build.sh

FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.24-openshift-4.21 AS linuxarmbuilder
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.25-openshift-4.22 AS linuxarmbuilder
ENV GO_COMPLIANCE_EXCLUDE=".*"
WORKDIR /go/src/go.etcd.io/etcd
COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=arm64 GOFLAGS='-mod=readonly' GO_BUILD_FLAGS='-v' ./build.sh

FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.24-openshift-4.21 AS builder
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.25-openshift-4.22 AS builder
ENV GO_COMPLIANCE_EXCLUDE=".*"
WORKDIR /go/src/go.etcd.io/etcd
COPY . .
Expand All @@ -34,7 +34,7 @@ RUN mkdir -p /usr/share/openshift/$(go env GOOS)/$(go env GOHOSTARCH) && \
mv bin/etcd /usr/share/openshift/$(go env GOOS)/$(go env GOHOSTARCH)/

# stage 2
FROM registry.ci.openshift.org/ocp/4.21:base-rhel9
FROM registry.ci.openshift.org/ocp/4.22:base-rhel9

RUN yum install --setopt=tsflags=nodocs -y jq && yum clean all && rm -rf /var/cache/yum/*

Expand Down
87 changes: 87 additions & 0 deletions Dockerfile.installer.art
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# This Dockerfile builds an image containing Mac and Linux ARM64/AMD64 versions of the etcd.
# The resulting image is used to build the statically-linked openshift-installer binary.

FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.25-openshift-4.22 AS macbuilder

ENV GO_COMPLIANCE_EXCLUDE=".*"
COPY $REMOTE_SOURCES $REMOTE_SOURCES_DIR
WORKDIR $REMOTE_SOURCES_DIR/cachito-gomod-with-deps/app
RUN cat $REMOTE_SOURCES_DIR/cachito-gomod-with-deps/cachito.env
RUN mkdir -p /go/src/go.etcd.io/
RUN ln -s $REMOTE_SOURCES_DIR/cachito-gomod-with-deps/app /go/src/go.etcd.io/etcd
WORKDIR /go/src/go.etcd.io/etcd
COPY . .
RUN source $REMOTE_SOURCES_DIR/cachito-gomod-with-deps/cachito.env \
&& export GOFLAGS='-mod=readonly' && export GO_BUILD_FLAGS='-v' \
&& CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 ./build.sh

FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.25-openshift-4.22 AS macarmbuilder

ENV GO_COMPLIANCE_EXCLUDE=".*"
COPY $REMOTE_SOURCES $REMOTE_SOURCES_DIR
WORKDIR $REMOTE_SOURCES_DIR/cachito-gomod-with-deps/app
RUN cat $REMOTE_SOURCES_DIR/cachito-gomod-with-deps/cachito.env
RUN mkdir -p /go/src/go.etcd.io/
RUN ln -s $REMOTE_SOURCES_DIR/cachito-gomod-with-deps/app /go/src/go.etcd.io/etcd
WORKDIR /go/src/go.etcd.io/etcd
COPY . .
RUN source $REMOTE_SOURCES_DIR/cachito-gomod-with-deps/cachito.env \
&& export GOFLAGS='-mod=readonly' && export GO_BUILD_FLAGS='-v' \
&& CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 ./build.sh

FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.25-openshift-4.22 AS linuxbuilder

ENV GO_COMPLIANCE_EXCLUDE=".*"
COPY $REMOTE_SOURCES $REMOTE_SOURCES_DIR
WORKDIR $REMOTE_SOURCES_DIR/cachito-gomod-with-deps/app
RUN cat $REMOTE_SOURCES_DIR/cachito-gomod-with-deps/cachito.env
RUN mkdir -p /go/src/go.etcd.io/
RUN ln -s $REMOTE_SOURCES_DIR/cachito-gomod-with-deps/app /go/src/go.etcd.io/etcd
WORKDIR /go/src/go.etcd.io/etcd
COPY . .
RUN source $REMOTE_SOURCES_DIR/cachito-gomod-with-deps/cachito.env \
&& export GOFLAGS='-mod=readonly' && export GO_BUILD_FLAGS='-v' \
&& CGO_ENABLED=0 GOOS=linux GOARCH=amd64 ./build.sh

FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.25-openshift-4.22 AS linuxarmbuilder

ENV GO_COMPLIANCE_EXCLUDE=".*"
COPY $REMOTE_SOURCES $REMOTE_SOURCES_DIR
WORKDIR $REMOTE_SOURCES_DIR/cachito-gomod-with-deps/app
RUN cat $REMOTE_SOURCES_DIR/cachito-gomod-with-deps/cachito.env
RUN mkdir -p /go/src/go.etcd.io/
RUN ln -s $REMOTE_SOURCES_DIR/cachito-gomod-with-deps/app /go/src/go.etcd.io/etcd
WORKDIR /go/src/go.etcd.io/etcd
COPY . .
RUN source $REMOTE_SOURCES_DIR/cachito-gomod-with-deps/cachito.env \
&& export GOFLAGS='-mod=readonly' && export GO_BUILD_FLAGS='-v' \
&& CGO_ENABLED=0 GOOS=linux GOARCH=arm64 ./build.sh

FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.25-openshift-4.22 AS builder
ENV GO_COMPLIANCE_EXCLUDE=".*"
COPY $REMOTE_SOURCES $REMOTE_SOURCES_DIR
WORKDIR $REMOTE_SOURCES_DIR/cachito-gomod-with-deps/app
RUN cat $REMOTE_SOURCES_DIR/cachito-gomod-with-deps/cachito.env
RUN mkdir -p /go/src/go.etcd.io/
RUN ln -s $REMOTE_SOURCES_DIR/cachito-gomod-with-deps/app /go/src/go.etcd.io/etcd
WORKDIR /go/src/go.etcd.io/etcd
COPY . .
RUN source $REMOTE_SOURCES_DIR/cachito-gomod-with-deps/cachito.env \
&& export GOFLAGS='-mod=readonly' && export GO_BUILD_FLAGS='-v' \
&& CGO_ENABLED=0 ./build.sh
RUN mkdir -p /usr/share/openshift/$(go env GOOS)/$(go env GOHOSTARCH) && \
mv bin/etcd /usr/share/openshift/$(go env GOOS)/$(go env GOHOSTARCH)/

# stage 2
FROM registry.ci.openshift.org/ocp/4.22:base-rhel9

RUN yum install --setopt=tsflags=nodocs -y jq && yum clean all && rm -rf /var/cache/yum/*

COPY --from=macbuilder /go/src/go.etcd.io/etcd/bin/etcd /usr/share/openshift/darwin/amd64/etcd
COPY --from=macarmbuilder /go/src/go.etcd.io/etcd/bin/etcd /usr/share/openshift/darwin/arm64/etcd
COPY --from=linuxbuilder /go/src/go.etcd.io/etcd/bin/etcd /usr/share/openshift/linux/amd64/etcd
COPY --from=linuxarmbuilder /go/src/go.etcd.io/etcd/bin/etcd /usr/share/openshift/linux/arm64/etcd
COPY --from=builder /usr/share/openshift/ /usr/share/openshift/

# This image is not an operator, it is only used as part of the build pipeline
LABEL io.openshift.release.operator=false
Loading