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

[7.x] [meta] download goss outside of pods (#1460) #1461

Merged
merged 1 commit into from
Dec 13, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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