Skip to content

Commit

Permalink
Makefile: use a specific template for mktemp files
Browse files Browse the repository at this point in the history
[ upstream commit db3e015 ]

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]: kubernetes-sigs/controller-tools#734

Signed-off-by: Alexandre Perrin <alex@isovalent.com>
Signed-off-by: Jussi Maki <jussi@isovalent.com>
Signed-off-by: Yutaro Hayakawa <yutaro.hayakawa@isovalent.com>
  • Loading branch information
kaworu authored and youngnick committed May 11, 2023
1 parent 6b920c6 commit 9edbc6e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -301,7 +301,7 @@ k8s-tests:
##@ 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)"
Expand Down

0 comments on commit 9edbc6e

Please sign in to comment.