Skip to content

Commit

Permalink
Use empty string to disable Docker integration
Browse files Browse the repository at this point in the history
The previous sentinel value of "false" may have given the impression
that "true" is the correct value to enable Docker build integration.
Also, "false" is actually an executable provided by coreutils. An empty
string can never point to a potentially executable file, and won't give
the impression that DOCKER is some sort of boolean variable.

Signed-off-by: Tom Wieczorek <[email protected]>
  • Loading branch information
twz123 committed Dec 19, 2024
1 parent 25801ba commit c3ea11e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ K0S_GO_BUILD_CACHE ?= build/cache
GO_SRCS := $(shell find . -type f -name '*.go' -not -path './$(K0S_GO_BUILD_CACHE)/*' -not -path './inttest/*' -not -name '*_test.go' -not -name 'zz_generated*')
GO_CHECK_UNIT_DIRS := . ./cmd/... ./pkg/... ./internal/... ./static/... ./hack/...

DOCKER = docker
DOCKER ?= docker
# EMBEDDED_BINS_BUILDMODE can be either:
# docker builds the binaries in docker
# none does not embed any binaries

ifeq ($(DOCKER),false)
# Disable Docker build integration if DOCKER is set to the empty string.
ifeq ($(DOCKER),)
EMBEDDED_BINS_BUILDMODE ?= none
K0S_BUILD_IMAGE_FILE =
GO ?= go
Expand All @@ -35,6 +36,7 @@ else
K0S_BUILD_IMAGE_FILE = .k0sbuild.docker-image.k0s
GO ?= $(GO_ENV) go
endif

# k0s runs on linux even if it's built on mac or windows
TARGET_OS ?= linux
BUILD_UID ?= $(shell id -u)
Expand Down

0 comments on commit c3ea11e

Please sign in to comment.