Skip to content

Commit 3d24f73

Browse files
committed
add volume mount label option to cluster-autoscaler makefile
This change adds an option to the `build-in-docker` and `test-in-docker` make targets which allows usage on linux systems with selinux enabled. Currently these make targets use a volume mount to the local directory for creating the binary output. On systems which have selinux enforcing, the container runtime will disallow the mount to occur. This change enables these make targets for selinux systems by adding the `:Z` option to the volume flags. On systems which do not have selinux enforcing this change will not have any effect.
1 parent e017121 commit 3d24f73

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cluster-autoscaler/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ docker-builder:
6161
docker build -t autoscaling-builder ../builder
6262

6363
build-in-docker: clean docker-builder
64-
docker run -v `pwd`:/gopath/src/k8s.io/autoscaler/cluster-autoscaler/ autoscaling-builder:latest bash -c 'cd /gopath/src/k8s.io/autoscaler/cluster-autoscaler && BUILD_TAGS=${BUILD_TAGS} LDFLAGS="${LDFLAGS}" make build-binary'
64+
docker run -v `pwd`:/gopath/src/k8s.io/autoscaler/cluster-autoscaler/:Z autoscaling-builder:latest bash -c 'cd /gopath/src/k8s.io/autoscaler/cluster-autoscaler && BUILD_TAGS=${BUILD_TAGS} LDFLAGS="${LDFLAGS}" make build-binary'
6565

6666
release: build-in-docker execute-release
6767
@echo "Full in-docker release ${TAG}${FOR_PROVIDER} completed"
@@ -70,7 +70,7 @@ container: build-in-docker make-image
7070
@echo "Created in-docker image ${TAG}${FOR_PROVIDER}"
7171

7272
test-in-docker: clean docker-builder
73-
docker run -v `pwd`:/gopath/src/k8s.io/autoscaler/cluster-autoscaler/ autoscaling-builder:latest bash -c 'cd /gopath/src/k8s.io/autoscaler/cluster-autoscaler && GO111MODULE=off go test -race ./... ${TAGS_FLAG}'
73+
docker run -v `pwd`:/gopath/src/k8s.io/autoscaler/cluster-autoscaler/:Z autoscaling-builder:latest bash -c 'cd /gopath/src/k8s.io/autoscaler/cluster-autoscaler && GO111MODULE=off go test -race ./... ${TAGS_FLAG}'
7474

7575
.PHONY: all deps build test-unit clean format execute-release dev-release docker-builder build-in-docker release generate
7676

0 commit comments

Comments
 (0)