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 <[email protected]>
Signed-off-by: Jussi Maki <[email protected]>
  • Loading branch information
kaworu authored and joamaki committed May 2, 2023
1 parent 5e8bd58 commit 069c70a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 069c70a

Please sign in to comment.