From f7e28c42fefaa6fbb06c80d38b08419ef70e77eb Mon Sep 17 00:00:00 2001 From: Pranshu Srivastava Date: Wed, 18 Sep 2024 05:25:55 +0530 Subject: [PATCH 1/3] chore: support `tools` target for arm64 Signed-off-by: Pranshu Srivastava --- .github/tools | 4 ++-- Makefile.tools | 26 ++++++++++++-------------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/.github/tools b/.github/tools index 57d4e6c3..0f103ab6 100644 --- a/.github/tools +++ b/.github/tools @@ -3,7 +3,7 @@ golangci-lint v1.61.0 controller-gen v0.16.2 kustomize v4.5.2 -oc v4.8.11 +oc v4.16.10 operator-sdk v1.36.1 opm v1.47.0 promq v0.0.1 @@ -13,4 +13,4 @@ jsonnetfmt v0.20.0 jsonnet-lint v0.20.0 jb v0.5.1 gojsontoyaml v0.1.0 -shellcheck 0.10.0 +shellcheck v0.10.0 diff --git a/Makefile.tools b/Makefile.tools index 6a52d056..0b08d2fc 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -29,7 +29,7 @@ PROMQ_VERSION = v0.0.1 # NOTE: oc is NOT downloadable using the OC_VERSION in its URL, so this has to be manually updated OC = $(TOOLS_DIR)/oc -OC_VERSION = v4.8.11 +OC_VERSION = 4.16.10 CRDOC = $(TOOLS_DIR)/crdoc CRDOC_VERSION = v0.5.2 @@ -125,12 +125,11 @@ $(OC) oc: $(TOOLS_DIR) set -ex ;\ [[ -f $(OC) ]] && exit 0 ;\ OS=$(shell go env GOOS) && ARCH=$(shell go env GOARCH) && \ - curl -sSLo $(OC) https://mirror.openshift.com/pub/openshift-v4/$${ARCH}/clients/oc/latest/$${OS}/oc.tar.gz ;\ - tar -xf $(TOOLS_DIR)/oc -C $(TOOLS_DIR) ;\ - rm -f $(TOOLS_DIR)/README.md ;\ - $(OC) version ;\ - version=$(OC_VERSION) ;\ - $(OC) version | grep -q $${version##v} ;\ + if [[ $${OS} == "darwin" ]]; then OS="mac"; fi ;\ + curl -sSLo $(OC).tar.gz https://mirror.openshift.com/pub/openshift-v4/$${ARCH}/clients/ocp/stable-4.16/openshift-client-$${OS}-$(OC_VERSION).tar.gz ;\ + tar -xf $(OC).tar.gz -C $(TOOLS_DIR) ;\ + rm -f $(OC).tar.gz ;\ + rm -f $(TOOLS_DIR)/-.md ;\ } .PHONY: crdoc @@ -189,11 +188,10 @@ $(SHELLCHECK) shellcheck: $(TOOLS_DIR) [[ -f $(SHELLCHECK) ]] && exit 0 ;\ cd $$(mktemp -d) ;\ OS=$(shell go env GOOS) && ARCH=$(shell uname -m) && \ - curl -sSLo shellcheck-stable.tar.xz https://github.com/koalaman/shellcheck/releases/download/stable/shellcheck-stable.$${OS}.$${ARCH}.tar.xz ;\ - tar -xJf shellcheck-stable.tar.xz ;\ - cp shellcheck-stable/shellcheck $(SHELLCHECK) ;\ - version=$(SHELLCHECK_VERSION) ;\ - $(SHELLCHECK) -V | grep -q $${version##v} ;\ + if [[ "$$OS" == "darwin" && "$$ARCH" == "arm64" ]]; then ARCH="aarch64"; fi ;\ + curl -sSLo shellcheck.tar.xz https://github.com/koalaman/shellcheck/releases/download/v$(SHELLCHECK_VERSION)/shellcheck-v$(SHELLCHECK_VERSION).$${OS}.$${ARCH}.tar.xz ;\ + tar -xJf shellcheck.tar.xz ;\ + cp shellcheck-v$(SHELLCHECK_VERSION)/shellcheck $(SHELLCHECK) ;\ } .PHONY: jsonnet-tools @@ -219,7 +217,7 @@ tools: $(CONTROLLER_GEN) \ echo $$(basename $(GOLANGCI_LINT)) $(GOLANGCI_LINT_VERSION) >> $$tools_file ;\ echo $$(basename $(CONTROLLER_GEN)) $(CONTROLLER_GEN_VERSION) >> $$tools_file ;\ echo $$(basename $(KUSTOMIZE)) $(KUSTOMIZE_VERSION) >> $$tools_file ;\ - echo $$(basename $(OC)) $(OC_VERSION) >> $$tools_file ;\ + echo $$(basename $(OC)) v$(OC_VERSION) >> $$tools_file ;\ echo $$(basename $(OPERATOR_SDK)) $(OPERATOR_SDK_VERSION) >> $$tools_file ;\ echo $$(basename $(OPM)) $(OPM_VERSION) >> $$tools_file ;\ echo $$(basename $(PROMQ)) $(PROMQ_VERSION) >> $$tools_file ;\ @@ -229,7 +227,7 @@ tools: $(CONTROLLER_GEN) \ echo $$(basename $(JSONNET_LINT)) $(JSONNET_VERSION) >> $$tools_file ;\ echo $$(basename $(JB)) $(JB_VERSION) >> $$tools_file ;\ echo $$(basename $(GOJSONTOYAML)) $(GOJSONTOYAML_VERSION) >> $$tools_file ;\ - echo $$(basename $(SHELLCHECK)) $(SHELLCHECK_VERSION) >> $$tools_file ;\ + echo $$(basename $(SHELLCHECK)) v$(SHELLCHECK_VERSION) >> $$tools_file ;\ } .PHONY: clean-tools From 93907352b2d80f4615c0c0a9fed2fb98de4c6c9d Mon Sep 17 00:00:00 2001 From: Pranshu Srivastava Date: Mon, 7 Oct 2024 12:06:47 +0530 Subject: [PATCH 2/3] fixup! chore: support `tools` target for arm64 * https://github.com/containerd/containerd/blob/main/docs/cri/config.md#cgroup-driver * https://github.com/kubernetes-sigs/kind/issues/3528#issuecomment-2263844398 Signed-off-by: Pranshu Srivastava --- Makefile.tools | 2 +- hack/kind/config.yaml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile.tools b/Makefile.tools index 0b08d2fc..2b1a3748 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -126,7 +126,7 @@ $(OC) oc: $(TOOLS_DIR) [[ -f $(OC) ]] && exit 0 ;\ OS=$(shell go env GOOS) && ARCH=$(shell go env GOARCH) && \ if [[ $${OS} == "darwin" ]]; then OS="mac"; fi ;\ - curl -sSLo $(OC).tar.gz https://mirror.openshift.com/pub/openshift-v4/$${ARCH}/clients/ocp/stable-4.16/openshift-client-$${OS}-$(OC_VERSION).tar.gz ;\ + curl -sSLo $(OC).tar.gz https://mirror.openshift.com/pub/openshift-v4/$${ARCH}/clients/ocp/stable-4.16/openshift-client-$${OS}.tar.gz ;\ tar -xf $(OC).tar.gz -C $(TOOLS_DIR) ;\ rm -f $(OC).tar.gz ;\ rm -f $(TOOLS_DIR)/-.md ;\ diff --git a/hack/kind/config.yaml b/hack/kind/config.yaml index 056615bf..a3d12ac2 100644 --- a/hack/kind/config.yaml +++ b/hack/kind/config.yaml @@ -5,6 +5,8 @@ containerdConfigPatches: - |- [plugins."io.containerd.grpc.v1.cri".registry.mirrors."local-registry:30000"] endpoint = ["http://10.96.223.192:30000"] + [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options] + SystemdCgroup = true nodes: - role: control-plane image: kindest/node:v1.24.0 From ff51758998c0a238589557e8cbd2464136a61431 Mon Sep 17 00:00:00 2001 From: Pranshu Srivastava Date: Mon, 7 Oct 2024 20:25:12 +0530 Subject: [PATCH 3/3] fixup! fixup! chore: support `tools` target for arm64 --- Makefile.tools | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.tools b/Makefile.tools index 2b1a3748..7da4c6ea 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -126,7 +126,7 @@ $(OC) oc: $(TOOLS_DIR) [[ -f $(OC) ]] && exit 0 ;\ OS=$(shell go env GOOS) && ARCH=$(shell go env GOARCH) && \ if [[ $${OS} == "darwin" ]]; then OS="mac"; fi ;\ - curl -sSLo $(OC).tar.gz https://mirror.openshift.com/pub/openshift-v4/$${ARCH}/clients/ocp/stable-4.16/openshift-client-$${OS}.tar.gz ;\ + curl -sSLo $(OC).tar.gz https://mirror.openshift.com/pub/openshift-v4/$${ARCH}/clients/ocp/stable-$$(echo $(OC_VERSION) | cut -d. -f1,2)/openshift-client-$${OS}.tar.gz ;\ tar -xf $(OC).tar.gz -C $(TOOLS_DIR) ;\ rm -f $(OC).tar.gz ;\ rm -f $(TOOLS_DIR)/-.md ;\