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

Commit

Permalink
[meta] download goss outside of pods (#1460)
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
jmlrt authored Dec 9, 2021
1 parent 167278e commit b3da68f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion helpers/examples.mk
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@ help: ## Display this help
goss: ## Run goss tests
set -e; \
for i in $$(seq 1 5); do \
curl -s -L "https://github.com/aelsabbahy/goss/releases/download/v0.3.6/goss-linux-amd64" -o /tmp/goss; \
if [ -z "$$GOSS_CONTAINER" ]; then \
sleep 5; \
echo "Retrieving pod ($$i/5)"; \
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 ); \
else \
echo "Testing with pod: $$GOSS_CONTAINER" && \
kubectl cp "test/$(GOSS_FILE)" "$$GOSS_CONTAINER:/tmp/$(GOSS_FILE)" && \
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"; \
kubectl cp "/tmp/goss" "$$GOSS_CONTAINER:/tmp/goss" && \
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"; \
break; \
fi; \
done

0 comments on commit b3da68f

Please sign in to comment.