Skip to content

Commit

Permalink
Makefile: use a specific template for mktemp files
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
kaworu committed Apr 28, 2023
1 parent 36237c2 commit c337ec4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ CRDS_CILIUM_V2ALPHA1 := ciliumendpointslices \
ciliumnodeconfigs \
ciliumcidrgroups
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=$(CRD_PATHS) output:crd:artifacts:config="$(TMPDIR)"
$(QUIET)$(GO) run ./tools/crdcheck "$(TMPDIR)"

Expand Down Expand Up @@ -326,7 +326,7 @@ GEN_CRD_GROUPS := "cilium.io:v2\
generate-k8s-api: ## Generate Cilium k8s API client, deepcopy and deepequal Go sources.
$(ASSERT_CILIUM_MODULE)

$(eval TMPDIR := $(shell mktemp -d))
$(eval TMPDIR := $(shell mktemp -d -t cilium.tmpXXXXXXXX))

$(QUIET) $(call generate_k8s_protobuf,${K8S_PROTO_PACKAGES},"$(TMPDIR)")

Expand Down

0 comments on commit c337ec4

Please sign in to comment.