From 22cdd22184223770d07707af90b02e634f3c3131 Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Thu, 9 Nov 2017 11:23:45 +0000 Subject: [PATCH] kubernetes: Only build the relevant image for the platform Building both BIOS and EFI variants is a waste of time in most cases, instead just build whichever one is relevant to the platform (which currently means EFI on Darwin and BIOS everywhere else). At the same time make it possible to pass "KUBE_FORMATS" (a space separated list of targets) to the build e.g. `make KUBE_FORMATS="iso-efi iso-bios"` will preserve the behaviour prior to this patch. Signed-off-by: Ian Campbell --- projects/kubernetes/Makefile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/projects/kubernetes/Makefile b/projects/kubernetes/Makefile index b0b5b4f29..f76c47b92 100644 --- a/projects/kubernetes/Makefile +++ b/projects/kubernetes/Makefile @@ -4,6 +4,13 @@ KUBE_NETWORK ?= weave-v2.0.5 INIT_YAML ?= INIT_YAML += network.yaml +ifeq ($(shell uname -s),"Darwin") +KUBE_FORMATS ?= iso-efi +endif +KUBE_FORMATS ?= iso-bios + +KUBE_FORMAT_ARGS := $(patsubst %,-format %,$(KUBE_FORMATS)) + all: build-container-images build-vm-images build-container-images: @@ -20,10 +27,10 @@ build-vm-images: kube-master.iso kube-node.iso # NB cannot use $^ because $(INIT_YAML) is not for consumption by "moby build" kube-master.iso: kube.yml $(KUBE_RUNTIME).yml $(KUBE_RUNTIME)-master.yml $(INIT_YAML) - moby build -name kube-master -format iso-efi -format iso-bios kube.yml $(KUBE_RUNTIME).yml $(KUBE_RUNTIME)-master.yml + moby build -name kube-master $(KUBE_FORMAT_ARGS) kube.yml $(KUBE_RUNTIME).yml $(KUBE_RUNTIME)-master.yml kube-node.iso: kube.yml $(KUBE_RUNTIME).yml - moby build -name kube-node -format iso-efi -format iso-bios $^ + moby build -name kube-node $(KUBE_FORMAT_ARGS) $^ network.yaml: $(KUBE_NETWORK).yaml ln -nf $< $@