Files
velero/hack/build-restic.sh
T
Xun Jiang/Bruce JiangandGitHub 31acdc02d8
Run the E2E test on kind / setup-test-matrix (push) Failing after 4s
e2e-test-kind.yaml / extract (push) Successful in 16s
Run the E2E test on kind / get-go-version (push) Successful in 17s
push.yml / extract (push) Successful in 11s
Main CI / get-go-version (push) Successful in 12s
Run the E2E test on kind / build (push) Failing after 30s
Run the E2E test on kind / run-e2e-test (push) Skipped
Main CI / Build (push) Failing after 33s
Bump Golang and dependencies versions. (#10489)
Bump Golang to latest 1.26: v1.26.8
Bump google.golang.org/grpc to v1.83.1 to fix CVE-2026-84304 for both Velero and Restic
Bump golang.org/x/crypto to v0.56.0 to fix CVE-2026-56854, CVE-2026-56855, and CVE-2026-78662 for both Velero and Restic.
Modify the restic build script to allow verification on local dev environment.
Ignore spell check for the restic patch file.

Signed-off-by: Xun Jiang <xun.jiang@broadcom.com>
2026-09-07 13:21:58 +08:00

58 lines
1.6 KiB
Bash
Executable File

#!/bin/bash
# Copyright 2020 the Velero contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -o errexit
set -o nounset
set -o pipefail
# Use /output/usr/bin/ as the default output directory as this
# is the path expected by the Velero Dockerfile.
velero_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
output_dir=${OUTPUT_DIR:-/output/usr/bin}
restic_bin=${output_dir}/restic
build_path=$(dirname "${velero_dir}")
if [[ -z "${BIN}" ]]; then
echo "BIN must be set"
exit 1
fi
if [[ "${BIN}" != "velero" ]]; then
echo "${BIN} does not need the restic binary"
exit 0
fi
if [[ -z "${GOOS}" ]]; then
echo "GOOS must be set"
exit 1
fi
if [[ -z "${GOARCH}" ]]; then
echo "GOARCH must be set"
exit 1
fi
if [[ -z "${RESTIC_VERSION}" ]]; then
echo "RESTIC_VERSION must be set"
exit 1
fi
mkdir ${build_path}/restic
git clone -b v${RESTIC_VERSION} https://github.com/restic/restic.git ${build_path}/restic
pushd ${build_path}/restic
git apply ${velero_dir}/hack/fix_restic_cve.txt
go run build.go --goos "${GOOS}" --goarch "${GOARCH}" --goarm "${GOARM}" -o ${restic_bin}
chmod +x ${restic_bin}
popd