From 069c70a421cf72cea01ef81fe50e9f5ed222fd5c 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 ce3f26220403b..2e59ab5f2d22a 100644 --- a/Makefile +++ b/Makefile @@ -254,7 +254,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)) $(QUIET)$(GO) run sigs.k8s.io/controller-tools/cmd/controller-gen $(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)" mv ${TMPDIR}/cilium.io_ciliumnetworkpolicies.yaml ./pkg/k8s/apis/cilium.io/client/crds/v2/ciliumnetworkpolicies.yaml