-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(build): move kind variables into dedicated make file (#271)
Signed-off-by: Artur Troian <[email protected]>
- Loading branch information
Showing
3 changed files
with
32 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# KIND_NAME NOTE: 'kind' string literal is default for the GH actions | ||
# KinD, it's fine to use other names locally, however in GH container name | ||
# is configured by engineerd/setup-kind. `kind-control-plane` is the docker | ||
# image's name in GH Actions. | ||
KIND_NAME ?= $(shell basename $$PWD) | ||
|
||
export KIND_NAME | ||
|
||
ifeq (, $(KINDEST_VERSION)) | ||
$(error "KINDEST_VERSION is not set") | ||
endif | ||
|
||
KIND_HTTP_PORT = $(shell docker inspect \ | ||
--type container "$(KIND_NAME)-control-plane" \ | ||
--format '{{index .NetworkSettings.Ports "80/tcp" 0 "HostPort"}}') | ||
|
||
KIND_HTTP_IP = $(shell docker inspect \ | ||
--type container "$(KIND_NAME)-control-plane" \ | ||
--format '{{index .NetworkSettings.Ports "80/tcp" 0 "HostIp"}}') | ||
|
||
KIND_K8S_IP = $(shell docker inspect \ | ||
--type container "$(KIND_NAME)-control-plane" \ | ||
--format '{{index .NetworkSettings.Ports "6443/tcp" 0 "HostIp"}}') | ||
|
||
# KIND_PORT_BINDINGS deliberately redirects stderr to /dev/null | ||
# in order to suppress message Error: No such object: kube-control-plane | ||
# during cluster setup | ||
# it is a bit doggy way but seems to do the job | ||
KIND_PORT_BINDINGS = $(shell docker inspect "$(KIND_NAME)-control-plane" \ | ||
--format '{{index .NetworkSettings.Ports "80/tcp" 0 "HostPort"}}' 2> /dev/null) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters