From 26a7ffbfe84ebfb016aa3b15fabd1fa91985199b Mon Sep 17 00:00:00 2001 From: Alexandre Perrin Date: Fri, 28 Apr 2023 13:12:25 +0200 Subject: [PATCH] Makefile: use a specific template for mktemp files [ upstream commit db3e0152c6583e0cbec1013e514526adf7229faf ] Before this patch, we would hit a controller-gen[1] bug when the temporary file would be of the form tmp.0oXXXXXX. This patch uses a custom mktemp template that will not trigger the bug. [1]: https://github.com/kubernetes-sigs/controller-tools/issues/734 Signed-off-by: Alexandre Perrin Signed-off-by: Jussi Maki --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d767bdf59d7e..3c6fe1a4ddea 100644 --- a/Makefile +++ b/Makefile @@ -291,7 +291,7 @@ build-rpm: ## Build rpm package of cilium. ##@ API targets CRD_OPTIONS ?= "crd:crdVersions=v1" manifests: ## Generate K8s manifests e.g. CRD, RBAC etc. - $(eval TMPDIR := $(shell mktemp -d)) + $(eval TMPDIR := $(shell mktemp -d -t cilium.tmpXXXXXXXX)) cd "./vendor/sigs.k8s.io/controller-tools/cmd/controller-gen" && \ $(QUIET)$(GO) run ./... $(CRD_OPTIONS) paths="$(PWD)/pkg/k8s/apis/cilium.io/v2;$(PWD)/pkg/k8s/apis/cilium.io/v2alpha1" output:crd:artifacts:config="$(TMPDIR)"; $(QUIET)$(GO) run ./tools/crdcheck "$(TMPDIR)"