Skip to content
This repository was archived by the owner on May 16, 2023. It is now read-only.

Commit b3da68f

Browse files
authored
[meta] download goss outside of pods (#1460)
This commit update the way goss binary is retrieved in the tests/examples. The goss binary is now downloaded locally then copied inside the pod. This is needed because the Elasticsearch Ubuntu based Docker images is missing the ca-certificates package, and so the curl https command is failling with `curl: (77) error setting certificate verify locations` error. Follow-up of #1458 Relates to #1459 (comment)
1 parent 167278e commit b3da68f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

helpers/examples.mk

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,16 @@ help: ## Display this help
1313
goss: ## Run goss tests
1414
set -e; \
1515
for i in $$(seq 1 5); do \
16+
curl -s -L "https://github.com/aelsabbahy/goss/releases/download/v0.3.6/goss-linux-amd64" -o /tmp/goss; \
1617
if [ -z "$$GOSS_CONTAINER" ]; then \
1718
sleep 5; \
1819
echo "Retrieving pod ($$i/5)"; \
1920
GOSS_CONTAINER=$$(kubectl get --no-headers=true pods -l "$(GOSS_SELECTOR)" -o custom-columns=:metadata.name --field-selector=status.phase=Running --sort-by=.metadata.creationTimestamp | tail -1 ); \
2021
else \
2122
echo "Testing with pod: $$GOSS_CONTAINER" && \
2223
kubectl cp "test/$(GOSS_FILE)" "$$GOSS_CONTAINER:/tmp/$(GOSS_FILE)" && \
23-
kubectl exec "$$GOSS_CONTAINER" -- sh -c "cd /tmp/ && curl -s -L \"https://github.com/aelsabbahy/goss/releases/download/$(GOSS_VERSION)/goss-linux-amd64\" -o goss && chmod +rx ./goss && ./goss --gossfile \"$(GOSS_FILE)\" validate --retry-timeout 300s --sleep 5s --color --format documentation"; \
24+
kubectl cp "/tmp/goss" "$$GOSS_CONTAINER:/tmp/goss" && \
25+
kubectl exec "$$GOSS_CONTAINER" -- sh -c "chmod +rx /tmp/goss && /tmp/goss --gossfile \"/tmp/$(GOSS_FILE)\" validate --retry-timeout 300s --sleep 5s --color --format documentation"; \
2426
break; \
2527
fi; \
2628
done

0 commit comments

Comments
 (0)