Skip to content

Commit 77fd947

Browse files
add telepresence configuration to increase timeout
Signed-off-by: Jintao Zhang <[email protected]>
1 parent 6e50e29 commit 77fd947

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

.config/telepresence/config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
client:
2+
timeouts:
3+
helm: 120s

Makefile

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,7 @@ test.api: gotestsum
639639
_test.integration: gotestsum download.telepresence
640640
KUBECONFIG=$(KUBECONFIG) \
641641
TELEPRESENCE_BIN=$(TELEPRESENCE) \
642+
XDG_CONFIG_HOME=$(PROJECT_DIR)/.config/telepresence \
642643
GOFLAGS=$(GOFLAGS) \
643644
GOTESTSUM_FORMAT=$(GOTESTSUM_FORMAT) \
644645
$(GOTESTSUM) -- $(GOTESTFLAGS) \
@@ -682,6 +683,7 @@ PARALLEL := $(if $(PARALLEL),$(PARALLEL),$(NCPU))
682683
_test.conformance: gotestsum download.telepresence
683684
KUBECONFIG=$(KUBECONFIG) \
684685
TELEPRESENCE_BIN=$(TELEPRESENCE) \
686+
XDG_CONFIG_HOME=$(PROJECT_DIR)/.config/telepresence \
685687
GOTESTSUM_FORMAT=$(GOTESTSUM_FORMAT) \
686688
$(GOTESTSUM) -- $(GOTESTFLAGS) \
687689
-timeout $(CONFORMANCE_TEST_TIMEOUT) \
@@ -851,9 +853,9 @@ KUBECONFIG ?= $(HOME)/.kube/config
851853
# etc didn't change in between the runs.
852854
.PHONY: _run
853855
_run:
854-
@$(TELEPRESENCE) helm install
855-
@$(TELEPRESENCE) connect
856-
bash -c "trap \
856+
@XDG_CONFIG_HOME=$(PROJECT_DIR)/.config/telepresence $(TELEPRESENCE) helm install
857+
@XDG_CONFIG_HOME=$(PROJECT_DIR)/.config/telepresence $(TELEPRESENCE) connect
858+
bash -c "export XDG_CONFIG_HOME=$(PROJECT_DIR)/.config/telepresence; trap \
857859
'$(TELEPRESENCE) quit -s; $(TELEPRESENCE) helm uninstall; rm -rf $(TMP_KUBECONFIG) || 1' EXIT; \
858860
KONG_OPERATOR_KUBECONFIG=$(or $(TMP_KUBECONFIG),$(KUBECONFIG)) \
859861
KONG_OPERATOR_ANONYMOUS_REPORTS=false \
@@ -870,7 +872,7 @@ _run:
870872
-zap-time-encoding iso8601 \
871873
-zap-log-level 2 \
872874
-zap-devel true \
873-
"
875+
"
874876

875877
# Run the operator locally with impersonation of controller-manager service account from kong-system namespace.
876878
# The operator will use a temporary kubeconfig file and impersonate the real RBACs.
@@ -992,15 +994,15 @@ undeploy:
992994
# as if it were running inside the cluster itself.
993995
.PHONY: install.telepresence
994996
install.telepresence: download.telepresence
995-
@$(PROJECT_DIR)/scripts/telepresence-manager.sh install "$(TELEPRESENCE)"
997+
@XDG_CONFIG_HOME=$(PROJECT_DIR)/.config/telepresence $(PROJECT_DIR)/scripts/telepresence-manager.sh install "$(TELEPRESENCE)"
996998

997999
# Disconnect and uninstall telepresence from the cluster.
9981000
# This target cleans up the telepresence resources created by the install.telepresence target.
9991001
# It should be used when you're done debugging the operator locally to ensure proper
10001002
# cleanup of network connections and cluster resources.
10011003
.PHONY: uninstall.telepresence
10021004
uninstall.telepresence: download.telepresence
1003-
@$(PROJECT_DIR)/scripts/telepresence-manager.sh uninstall "$(TELEPRESENCE)"
1005+
@XDG_CONFIG_HOME=$(PROJECT_DIR)/.config/telepresence $(PROJECT_DIR)/scripts/telepresence-manager.sh uninstall "$(TELEPRESENCE)"
10041006

10051007
# Currently kube-api-linter can only be run with golangci-lint as custom linter.
10061008
# There have been some discussions about making it possible to be run as a standalone tool

scripts/telepresence-manager.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
set -e
66
set -o pipefail
77

8+
# Default XDG_CONFIG_HOME to the project .config/telepresence directory so Telepresence reads config.yml inside it
9+
PROJECT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
10+
if [ -z "${XDG_CONFIG_HOME:-}" ]; then
11+
export XDG_CONFIG_HOME="$PROJECT_DIR/.config/telepresence"
12+
fi
13+
814
# Function to log messages with different levels.
915
log() {
1016
local level="$1"

0 commit comments

Comments
 (0)