Skip to content

Commit

Permalink
Makefile: drop custom s390x envtest setup
Browse files Browse the repository at this point in the history
setup-envtest seems to support s390x also:
$ setup-envtest list --os linux --arch s390x
(available)  v1.31.0  linux/s390x
(available)  v1.30.3  linux/s390x
(available)  v1.30.2  linux/s390x
(available)  v1.30.0  linux/s390x
(available)  v1.29.5  linux/s390x
(available)  v1.29.4  linux/s390x
(available)  v1.29.3  linux/s390x
(available)  v1.29.1  linux/s390x
(available)  v1.29.0  linux/s390x
(available)  v1.28.3  linux/s390x
(available)  v1.28.0  linux/s390x
(available)  v1.27.1  linux/s390x
(available)  v1.26.1  linux/s390x
(available)  v1.26.0  linux/s390x
(available)  v1.25.0  linux/s390x
(available)  v1.24.2  linux/s390x
(available)  v1.24.1  linux/s390x
(available)  v1.23.5  linux/s390x

Signed-off-by: Mikko Ylinen <[email protected]>
  • Loading branch information
mythi committed Aug 29, 2024
1 parent 3f65585 commit cff5d79
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,24 +59,6 @@ else
GOBIN=$(shell go env GOBIN)
endif

ifeq ($(ARCH),s390x)
K8S_VERSION=v1.24.2
ETCD_VERSION=v3.5.4
ETCD_BASE_NAME=etcd-$(ETCD_VERSION)-linux-$(ARCH)
KUBEBUILDER_PATH=$${PWD}/kubebuilder-tools/bin
# ATM, there is no s390x support for kubebuilder-tools.
# We need to prepare core binaries without envtest.
# $1: a path where binaries are installed
define INSTALL_KUBEBUILDER_TOOLS
$(shell mkdir -p $1 && cd $1 && \
curl -sLO https://dl.k8s.io/$(K8S_VERSION)/bin/linux/$(ARCH)/kube-apiserver && \
curl -sLO https://dl.k8s.io/$(K8S_VERSION)/bin/linux/$(ARCH)/kubectl && \
chmod +x kube-apiserver kubectl && \
curl -sLO https://github.com/coreos/etcd/releases/download/$(ETCD_VERSION)/$(ETCD_BASE_NAME).tar.gz && \
tar xzf $(ETCD_BASE_NAME).tar.gz && cp $(ETCD_BASE_NAME)/etcd . && rm -rf $(ETCD_BASE_NAME)*)
endef
endif

# Setting SHELL to bash allows bash commands to be executed by recipes.
# Options are set to exit when a recipe line exits non-zero or a piped command fails.
SHELL = /usr/bin/env bash -o pipefail
Expand Down Expand Up @@ -122,12 +104,7 @@ vet: ## Run go vet against code.

.PHONY: test
test: manifests generate fmt vet envtest ## Run tests.
ifeq ($(ARCH),s390x)
$(call INSTALL_KUBEBUILDER_TOOLS,$(KUBEBUILDER_PATH))
KUBEBUILDER_ASSETS="$(KUBEBUILDER_PATH)" go test ./... -coverprofile cover.out
else
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test ./... -coverprofile cover.out
endif

##@ Build

Expand Down

0 comments on commit cff5d79

Please sign in to comment.