Skip to content

Commit

Permalink
introduce golang-version file for kubernetes release branches (#269)
Browse files Browse the repository at this point in the history
* introduce golang-version file for kubernetes release branches

* space
  • Loading branch information
jaxesn authored Mar 30, 2021
1 parent dffd877 commit 8894d4e
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 23 deletions.
1 change: 1 addition & 0 deletions projects/kubernetes/kubernetes/1-18/GOLANG_VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.13
1 change: 1 addition & 0 deletions projects/kubernetes/kubernetes/1-19/GOLANG_VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.15
1 change: 1 addition & 0 deletions projects/kubernetes/kubernetes/1-20/GOLANG_VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.15
7 changes: 4 additions & 3 deletions projects/kubernetes/kubernetes/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ RELEASE_BRANCH?=$(shell cat $(BASE_DIRECTORY)/release/DEFAULT_RELEASE_BRANCH)
RELEASE?=$(shell cat $(BASE_DIRECTORY)/release/$(RELEASE_BRANCH)/RELEASE)
ARTIFACT_BUCKET?=my-s3-bucket
GIT_TAG?=$(shell cat ./$(RELEASE_BRANCH)/GIT_TAG)
GOLANG_VERSION?=$(shell cat ./$(RELEASE_BRANCH)/GOLANG_VERSION)

REPO=kubernetes
COMPONENT=kubernetes/$(REPO)
Expand Down Expand Up @@ -44,7 +45,7 @@ update-checksums: binaries

.PHONY: binaries
binaries:
build/create_binaries.sh $(CLONE_URL) $(RELEASE_BRANCH) $(GIT_TAG)
build/create_binaries.sh $(CLONE_URL) $(RELEASE_BRANCH) $(GIT_TAG) $(GOLANG_VERSION)

.PHONY: tarballs
tarballs:
Expand Down Expand Up @@ -117,11 +118,11 @@ all: release

.PHONY: test
test: binaries
build/run_tests.sh $(RELEASE_BRANCH)
build/run_tests.sh $(RELEASE_BRANCH) $(GOLANG_VERSION)

.PHONY: attribution
attribution:
build/create_attribution.sh $(RELEASE_BRANCH)
build/create_attribution.sh $(RELEASE_BRANCH) $(GOLANG_VERSION)

.PHONY: clean-repo
clean-repo:
Expand Down
3 changes: 2 additions & 1 deletion projects/kubernetes/kubernetes/build/create_attribution.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ source "${MAKE_ROOT}/build/lib/init.sh"
source "${MAKE_ROOT}/../../../build/lib/common.sh"

RELEASE_BRANCH="$1"
GOLANG_VERSION=$(build::binaries::get_go_version_k8s "$RELEASE_BRANCH")
GOLANG_VERSION="$2"

OUTPUT_RELEASE_DIR="${OUTPUT_DIR}/${RELEASE_BRANCH}"

# a number of k8s.io dependencies which come from the main repo show
Expand Down
5 changes: 3 additions & 2 deletions projects/kubernetes/kubernetes/build/create_binaries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ MAKE_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)"

CLONE_URL="$1"
RELEASE_BRANCH="$2"
GIT_TAG="${3:-$(cat ${MAKE_ROOT}/${RELEASE_BRANCH}/GIT_TAG)}"
GIT_TAG="$3"
GOLANG_VERSION="$4"

source "${MAKE_ROOT}/build/lib/init.sh"
source "${MAKE_ROOT}/../../../build/lib/common.sh"
Expand All @@ -36,7 +37,7 @@ if [ -d ${OUTPUT_DIR}/${RELEASE_BRANCH}/bin ]; then
fi
build::git::clone "$CLONE_URL" "$SOURCE_DIR"
build::git::patch "$SOURCE_DIR" "$GIT_TAG" "$PATCH_DIR"
build::binaries::use_go_version_k8s "$RELEASE_BRANCH"
build::common::use_go_version $GOLANG_VERSION
build::binaries::kube_bins "$SOURCE_DIR"

mkdir -p ${OUTPUT_DIR}/${RELEASE_BRANCH}/bin
Expand Down
16 changes: 0 additions & 16 deletions projects/kubernetes/kubernetes/build/lib/binaries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

function build::binaries::get_go_version_k8s() {
local -r releasebranch="$1"

if [[ "$releasebranch" == "1-18" ]]; then
echo "1.13"
else
echo "1.15"
fi
}

function build::binaries::use_go_version_k8s() {
local -r releasebranch="$1"

build::common::use_go_version $(build::binaries::get_go_version_k8s $releasebranch)
}

function build::binaries::kube_bins() {
local -r repository="$1"
# Build all core components for linux arm64 and amd64
Expand Down
5 changes: 4 additions & 1 deletion projects/kubernetes/kubernetes/build/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,16 @@ MAKE_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)"
source "${MAKE_ROOT}/build/lib/init.sh"
source "${MAKE_ROOT}/../../../build/lib/common.sh"

RELEASE_BRANCH="$1"
GOLANG_VERSION="$2"

export ARTIFACTS=${ARTIFACTS:-"./_artifacts"}
export KUBE_JUNIT_REPORT_DIR="${ARTIFACTS}"
export KUBE_KEEP_VERBOSE_TEST_OUTPUT=y
export LOG_LEVEL=4
export KUBE_TIMEOUT=${KUBE_TIMEOUT:-"--timeout=600s"}

build::binaries::use_go_version_k8s "$RELEASE_BRANCH"
build::common::use_go_version $GOLANG_VERSION

go get gotest.tools/gotestsum

Expand Down

0 comments on commit 8894d4e

Please sign in to comment.