Skip to content

Commit

Permalink
Merge pull request openshift#207 from tjungblu/rebase_4.12_3.5.9
Browse files Browse the repository at this point in the history
OCPBUGS-15860: [4.12] Rebase openshift/etcd to 3.5.9
  • Loading branch information
openshift-merge-robot authored Aug 7, 2023
2 parents c1d76ff + 07d0ec7 commit 9f987a5
Show file tree
Hide file tree
Showing 181 changed files with 4,512 additions and 1,728 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
name: E2E
on: [push, pull_request]
jobs:
goversion:
uses: ./.github/workflows/go-version.yaml
test:
runs-on: ubuntu-latest
needs: goversion
strategy:
fail-fast: true
matrix:
Expand All @@ -13,20 +16,20 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: "1.16.15"
go-version: ${{ needs.goversion.outputs.goversion }}
- run: date
- env:
TARGET: ${{ matrix.target }}
run: |
set -euo pipefail
echo "${TARGET}"
case "${TARGET}" in
linux-amd64-e2e)
PASSES='build release e2e' MANUAL_VER=v3.4.7 CPU='4' EXPECT_DEBUG='true' COVER='false' RACE='true' ./test.sh 2>&1 | tee test.log
! egrep "(--- FAIL:|DATA RACE|panic: test timed out|appears to have leaked)" -B50 -A10 test.log
PASSES='build release e2e' MANUAL_VER=v3.4.7 CPU='4' EXPECT_DEBUG='true' COVER='false' RACE='true' ./test.sh
;;
linux-386-e2e)
GOARCH=386 PASSES='build e2e' CPU='4' EXPECT_DEBUG='true' COVER='false' RACE='true' ./test.sh 2>&1 | tee test.log
! egrep "(--- FAIL:|DATA RACE|panic: test timed out|appears to have leaked)" -B50 -A10 test.log
GOARCH=386 PASSES='build e2e' CPU='4' EXPECT_DEBUG='true' COVER='false' RACE='true' ./test.sh
;;
*)
echo "Failed to find target"
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/functional.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
name: functional-tests
on: [push, pull_request]
jobs:
goversion:
uses: ./.github/workflows/go-version.yaml
test:
runs-on: ubuntu-latest
needs: goversion
strategy:
fail-fast: true
matrix:
Expand All @@ -12,11 +15,13 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: "1.16.15"
go-version: ${{ needs.goversion.outputs.goversion }}
- run: date
- env:
TARGET: ${{ matrix.target }}
run: |
set -euo pipefail
echo "${TARGET}"
case "${TARGET}" in
linux-amd64-functional)
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/go-version.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Go version setup

on:
workflow_call:
outputs:
goversion:
value: ${{ jobs.version.outputs.goversion }}

jobs:
version:
name: Set Go version variable for all the workflows
runs-on: ubuntu-latest
outputs:
goversion: ${{ steps.goversion.outputs.goversion }}
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- id: goversion
run: |
GO_VERSION=$(cat .go-version)
echo "Go Version: $GO_VERSION"
echo "goversion=$GO_VERSION" >> $GITHUB_OUTPUT
10 changes: 7 additions & 3 deletions .github/workflows/grpcproxy.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
name: grpcProxy-tests
on: [push, pull_request]
jobs:
goversion:
uses: ./.github/workflows/go-version.yaml
test:
runs-on: ubuntu-latest
needs: goversion
strategy:
fail-fast: true
matrix:
Expand All @@ -12,16 +15,17 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: "1.16.15"
go-version: ${{ needs.goversion.outputs.goversion }}
- run: date
- env:
TARGET: ${{ matrix.target }}
run: |
set -euo pipefail
echo "${TARGET}"
case "${TARGET}" in
linux-amd64-grpcproxy)
PASSES='build grpcproxy' CPU='4' COVER='false' RACE='true' ./test.sh 2>&1 | tee test.log
! egrep "(--- FAIL:|DATA RACE|panic: test timed out|appears to have leaked)" -B50 -A10 test.log
PASSES='build grpcproxy' CPU='4' COVER='false' RACE='true' ./test.sh
;;
*)
echo "Failed to find target"
Expand Down
15 changes: 12 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
name: Release
on: [push, pull_request]
jobs:
goversion:
uses: ./.github/workflows/go-version.yaml
main:
runs-on: ubuntu-latest
needs: goversion
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: "1.16.15"
- run: |
go-version: ${{ needs.goversion.outputs.goversion }}
- name: release
run: |
set -euo pipefail
git config --global user.email "[email protected]"
git config --global user.name "Github Action"
gpg --batch --gen-key <<EOF
Expand All @@ -21,4 +27,7 @@ jobs:
Name-Email: [email protected]
Expire-Date: 0
EOF
DRY_RUN=true BRANCH=release-3.5 ./scripts/release --no-upload --no-docker-push 3.5.99
DRY_RUN=true ./scripts/release --no-upload --no-docker-push --in-place 3.5.99
- name: test-image
run: |
VERSION=3.5.99 ./scripts/test_images.sh
7 changes: 6 additions & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
name: Tests
on: [push, pull_request]
jobs:
goversion:
uses: ./.github/workflows/go-version.yaml
test:
runs-on: ubuntu-latest
needs: goversion
strategy:
fail-fast: false
matrix:
Expand All @@ -18,11 +21,13 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: "1.16.15"
go-version: ${{ needs.goversion.outputs.goversion }}
- run: date
- env:
TARGET: ${{ matrix.target }}
run: |
set -euo pipefail
echo "${TARGET}"
case "${TARGET}" in
linux-amd64-fmt)
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/trivy-nightly-scan.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Trivy Nightly Scan
on:
schedule:
- cron: '0 2 * * *' # run at 2 AM UTC

permissions: read-all
jobs:
nightly-scan:
name: Trivy Scan nightly
strategy:
fail-fast: false
matrix:
# maintain the versions of etcd that need to be actively
# security scanned
versions: [v3.5.6]
permissions:
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results

runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
with:
ref: release-3.5
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@9ab158e8597f3b310480b9a69402b419bc03dbd5 # master
with:
image-ref: 'gcr.io/etcd-development/etcd:${{ matrix.versions }}'
severity: 'CRITICAL,HIGH'
format: 'template'
template: '@/contrib/sarif.tpl'
output: 'trivy-results-3-5.sarif'

- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@a669cc5936cc5e1b6a362ec1ff9e410dc570d190 # v2.1.36
with:
sarif_file: 'trivy-results-3-5.sarif'
1 change: 1 addition & 0 deletions .go-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.19.9
51 changes: 0 additions & 51 deletions .travis.yml

This file was deleted.

12 changes: 3 additions & 9 deletions Dockerfile-release.amd64
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
# TODO: move to k8s.gcr.io/build-image/debian-base:bullseye-v1.y.z when patched
FROM debian:bullseye-20220328
FROM --platform=linux/amd64 gcr.io/distroless/static-debian11

ADD etcd /usr/local/bin/
ADD etcdctl /usr/local/bin/
ADD etcdutl /usr/local/bin/
RUN mkdir -p /var/etcd/
RUN mkdir -p /var/lib/etcd/

# Alpine Linux doesn't use pam, which means that there is no /etc/nsswitch.conf,
# but Golang relies on /etc/nsswitch.conf to check the order of DNS resolving
# (see https://github.com/golang/go/commit/9dee7771f561cf6aee081c0af6658cc81fac3918)
# To fix this we just create /etc/nsswitch.conf and add the following line:
RUN echo 'hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4' >> /etc/nsswitch.conf
WORKDIR /var/etcd/
WORKDIR /var/lib/etcd/

EXPOSE 2379 2380

Expand Down
9 changes: 4 additions & 5 deletions Dockerfile-release.arm64
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# TODO: move to k8s.gcr.io/build-image/debian-base-arm64:bullseye-1.y.z when patched
FROM arm64v8/debian:bullseye-20220328
FROM --platform=linux/arm64 gcr.io/distroless/static-debian11

ADD etcd /usr/local/bin/
ADD etcdctl /usr/local/bin/
ADD etcdutl /usr/local/bin/
ADD var/etcd /var/etcd
ADD var/lib/etcd /var/lib/etcd
ENV ETCD_UNSUPPORTED_ARCH=arm64

WORKDIR /var/etcd/
WORKDIR /var/lib/etcd/

EXPOSE 2379 2380

Expand Down
8 changes: 4 additions & 4 deletions Dockerfile-release.ppc64le
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# TODO: move to k8s.gcr.io/build-image/debian-base-ppc64le:bullseye-1.y.z when patched
FROM ppc64le/debian:bullseye-20220328
FROM --platform=linux/ppc64le gcr.io/distroless/static-debian11

ADD etcd /usr/local/bin/
ADD etcdctl /usr/local/bin/
ADD etcdutl /usr/local/bin/
ADD var/etcd /var/etcd
ADD var/lib/etcd /var/lib/etcd

WORKDIR /var/etcd/
WORKDIR /var/lib/etcd/

EXPOSE 2379 2380

Expand Down
8 changes: 4 additions & 4 deletions Dockerfile-release.s390x
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# TODO: move to k8s.gcr.io/build-image/debian-base-s390x:bullseye-1.y.z when patched
FROM s390x/debian:bullseye-20220328
FROM --platform=linux/s390x gcr.io/distroless/static-debian11

ADD etcd /usr/local/bin/
ADD etcdctl /usr/local/bin/
ADD etcdutl /usr/local/bin/
ADD var/etcd /var/etcd
ADD var/lib/etcd /var/lib/etcd

WORKDIR /var/etcd/
WORKDIR /var/lib/etcd/

EXPOSE 2379 2380

Expand Down
3 changes: 2 additions & 1 deletion Dockerfile.art
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM registry.ci.openshift.org/ocp/builder:rhel-8-etcd-golang-1.16 AS builder
FROM registry.ci.openshift.org/ocp/builder:rhel-8-etcd-golang-1.19 AS builder

COPY $REMOTE_SOURCES $REMOTE_SOURCES_DIR
WORKDIR $REMOTE_SOURCES_DIR/cachito-gomod-with-deps/app
Expand All @@ -16,6 +16,7 @@ ENTRYPOINT ["/usr/bin/etcd"]

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" \
Expand Down
4 changes: 3 additions & 1 deletion Dockerfile.rhel
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
FROM registry.ci.openshift.org/ocp/builder:rhel-8-etcd-golang-1.16 AS builder
FROM registry.ci.openshift.org/ocp/builder:rhel-8-etcd-golang-1.19 AS builder

WORKDIR /go/src/go.etcd.io/etcd


COPY . .

RUN GOFLAGS='-mod=readonly' GO_BUILD_FLAGS='-v' ./build.sh
Expand All @@ -13,6 +14,7 @@ ENTRYPOINT ["/usr/bin/etcd"]

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" \
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ docker-remove:



GO_VERSION ?= 1.16.15
GO_VERSION ?= 1.19.9
ETCD_VERSION ?= $(shell git rev-parse --short HEAD || echo "GitNotFound")

TEST_SUFFIX = $(shell date +%s | base64 | head -c 15)
Expand Down
2 changes: 1 addition & 1 deletion api/etcdserverpb/raft_internal_stringer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
pb "go.etcd.io/etcd/api/v3/etcdserverpb"
)

// TestInvalidGoYypeIntPanic tests conditions that caused
// TestInvalidGoTypeIntPanic tests conditions that caused
// panic: invalid Go type int for field k8s_io.kubernetes.vendor.go_etcd_io.etcd.etcdserver.etcdserverpb.loggablePutRequest.value_size
// See https://github.com/kubernetes/kubernetes/issues/91937 for more details
func TestInvalidGoTypeIntPanic(t *testing.T) {
Expand Down
Loading

0 comments on commit 9f987a5

Please sign in to comment.