-
Notifications
You must be signed in to change notification settings - Fork 400
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use cloudbuild, add Makefile targets, and build script for envtest
Signed-off-by: Vince Prignano <vincepri@redhat.com>
- Loading branch information
Showing
8 changed files
with
142 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ | |
*~ | ||
|
||
# Tools binaries. | ||
out | ||
hack/tools/bin | ||
|
||
junit-report.xml | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# See https://cloud.google.com/cloud-build/docs/build-config | ||
# See https://console.cloud.google.com/gcr/images/k8s-staging-test-infra/global/gcb-docker-gcloud | ||
timeout: 2700s | ||
options: | ||
substitution_option: ALLOW_LOOSE | ||
machineType: 'E2_HIGHCPU_8' | ||
steps: | ||
- name: 'gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20230522-312425ae46' | ||
entrypoint: make | ||
env: | ||
- DOCKER_CLI_EXPERIMENTAL=enabled | ||
- TAG=$_GIT_TAG | ||
- PULL_BASE_REF=$_PULL_BASE_REF | ||
- DOCKER_BUILDKIT=1 | ||
args: ['release-envtest', '-j', '8'] | ||
substitutions: | ||
# _GIT_TAG will be filled with a git-based tag for the image, of the form vYYYYMMDD-hash, and | ||
# can be used as a substitution | ||
_GIT_TAG: '12345' | ||
_PULL_BASE_REF: 'dev' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
go: 1.21 | ||
etcd: v3.5.9 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/usr/bin/env bash | ||
# Copyright 2024 The Kubernetes Authors. | ||
# | ||
# 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 | ||
set -x | ||
|
||
# This script is used to build the test binaries for the envtest package. | ||
# It's intended to be run from the root of the repository, through the Makefile. | ||
|
||
envtest_dir=$(dirname ${BASH_SOURCE}) | ||
ROOT=$(dirname "${BASH_SOURCE[0]}")/../../.. | ||
|
||
# Check modified files in hack/envtest/_matrix/*.yaml | ||
# If there are any changes, we need to rebuild the test binaries. | ||
# This is to ensure that the test binaries are always up-to-date with the matrix files. | ||
|
||
changed_files=$(git diff --name-only --relative hack/envtest/_matrix | grep -E '\.yaml$' || true) | ||
|
||
# If there are no changes, we don't need to rebuild the test binaries. | ||
if [ -z "${changed_files}" ]; then | ||
exit 0 | ||
fi | ||
|
||
# For each changed file, grab the desired Kubernetes patch version from the name of the file. | ||
for file in ${changed_files}; do | ||
KUBERNETES_VERSION=$(basename "${file}" .yaml) | ||
echo "Building test binaries for ${KUBERNETES_VERSION}" | ||
|
||
GO_VERSION=$(yq eval .go "${file}") | ||
ETCD_VERSION=$(yq eval .etcd "${file}") | ||
|
||
make release-package-envtest \ | ||
KUBERNETES_VERSION="${KUBERNETES_VERSION}" \ | ||
GO_VERSION="${GO_VERSION}" \ | ||
ETCD_VERSION="${ETCD_VERSION}" | ||
done | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters