From 9bd4838ac10abbd4760da4fb905d7639a1c26f9f Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Fri, 15 Oct 2021 12:19:55 +0300 Subject: [PATCH] chore: stop using sonobuoy CLI We already have (better) way to run short conformance tests via `talosctl`. Signed-off-by: Andrey Smirnov --- .drone.jsonnet | 1 - Makefile | 10 +--------- hack/test/e2e.sh | 20 +------------------- 3 files changed, 2 insertions(+), 29 deletions(-) diff --git a/.drone.jsonnet b/.drone.jsonnet index 2ea2e9282..e0eb0d614 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -133,7 +133,6 @@ local setup_ci = { commands: [ 'setup-ci', - 'make ./_out/sonobuoy', 'make ./_out/kubectl', ], environment: { diff --git a/Makefile b/Makefile index 153e7add0..35ceab50c 100644 --- a/Makefile +++ b/Makefile @@ -28,8 +28,6 @@ INTEGRATION_TEST_PROVISION_DEFAULT_TARGET := integration-test-provision-$(OPERAT KUBECTL_URL ?= https://storage.googleapis.com/kubernetes-release/release/v1.22.2/bin/$(OPERATING_SYSTEM)/amd64/kubectl CLUSTERCTL_VERSION ?= 0.4.3 CLUSTERCTL_URL ?= https://github.com/kubernetes-sigs/cluster-api/releases/download/v$(CLUSTERCTL_VERSION)/clusterctl-$(OPERATING_SYSTEM)-amd64 -SONOBUOY_VERSION ?= 0.53.1 -SONOBUOY_URL ?= https://github.com/vmware-tanzu/sonobuoy/releases/download/v$(SONOBUOY_VERSION)/sonobuoy_$(SONOBUOY_VERSION)_$(OPERATING_SYSTEM)_amd64.tar.gz TESTPKGS ?= github.com/talos-systems/talos/... RELEASES ?= v0.11.5 v0.12.1 SHORT_INTEGRATION_TEST ?= @@ -292,11 +290,6 @@ $(ARTIFACTS)/$(INTEGRATION_TEST_DEFAULT_TARGET)-amd64: $(ARTIFACTS)/$(INTEGRATION_TEST_PROVISION_DEFAULT_TARGET)-amd64: @$(MAKE) local-$(INTEGRATION_TEST_PROVISION_DEFAULT_TARGET) DEST=$(ARTIFACTS) PLATFORM=linux/amd64 WITH_RACE=true NAME=Client -$(ARTIFACTS)/sonobuoy: - @mkdir -p $(ARTIFACTS) - @curl -L -o /tmp/sonobuoy.tar.gz ${SONOBUOY_URL} - @tar -xf /tmp/sonobuoy.tar.gz -C $(ARTIFACTS) - $(ARTIFACTS)/kubectl: @mkdir -p $(ARTIFACTS) @curl -L -o $(ARTIFACTS)/kubectl "$(KUBECTL_URL)" @@ -307,7 +300,7 @@ $(ARTIFACTS)/clusterctl: @curl -L -o $(ARTIFACTS)/clusterctl "$(CLUSTERCTL_URL)" @chmod +x $(ARTIFACTS)/clusterctl -e2e-%: $(ARTIFACTS)/$(INTEGRATION_TEST_DEFAULT_TARGET)-amd64 $(ARTIFACTS)/sonobuoy $(ARTIFACTS)/kubectl $(ARTIFACTS)/clusterctl ## Runs the E2E test for the specified platform (e.g. e2e-docker). +e2e-%: $(ARTIFACTS)/$(INTEGRATION_TEST_DEFAULT_TARGET)-amd64 $(ARTIFACTS)/kubectl $(ARTIFACTS)/clusterctl ## Runs the E2E test for the specified platform (e.g. e2e-docker). @$(MAKE) hack-test-$@ \ PLATFORM=$* \ TAG=$(TAG) \ @@ -321,7 +314,6 @@ e2e-%: $(ARTIFACTS)/$(INTEGRATION_TEST_DEFAULT_TARGET)-amd64 $(ARTIFACTS)/sonobu SHORT_INTEGRATION_TEST=$(SHORT_INTEGRATION_TEST) \ CUSTOM_CNI_URL=$(CUSTOM_CNI_URL) \ KUBECTL=$(PWD)/$(ARTIFACTS)/kubectl \ - SONOBUOY=$(PWD)/$(ARTIFACTS)/sonobuoy \ CLUSTERCTL=$(PWD)/$(ARTIFACTS)/clusterctl provision-tests-prepare: release-artifacts $(ARTIFACTS)/$(INTEGRATION_TEST_PROVISION_DEFAULT_TARGET)-amd64 diff --git a/hack/test/e2e.sh b/hack/test/e2e.sh index 5b4021d9f..442d400af 100755 --- a/hack/test/e2e.sh +++ b/hack/test/e2e.sh @@ -8,7 +8,6 @@ # - TALOSCTL # - INTEGRATION_TEST # - KUBECTL -# - SONOBUOY # - SHORT_INTEGRATION_TEST # - CUSTOM_CNI_URL # - IMAGE @@ -33,10 +32,6 @@ export TALOS_VERSION=v0.11 export KUBECONFIG="${TMP}/kubeconfig" export K8S_VERSION=${K8S_VERSION:-1.22.2} -# Sonobuoy - -export SONOBUOY_MODE=${SONOBUOY_MODE:-quick} - export NAME_PREFIX="talos-e2e-${SHA}-${PLATFORM}" export TIMEOUT=1200 export NUM_NODES=6 @@ -174,20 +169,7 @@ function run_kubernetes_conformance_test { } function run_kubernetes_integration_test { - timeout=$(($(date +%s) + ${TIMEOUT})) - until ${SONOBUOY} run \ - --kubeconfig ${KUBECONFIG} \ - --wait \ - --skip-preflight \ - --plugin e2e \ - --mode ${SONOBUOY_MODE}; do - [[ $(date +%s) -gt $timeout ]] && exit 1 - echo "re-attempting to run sonobuoy" - ${SONOBUOY} delete --all --wait --kubeconfig ${KUBECONFIG} - sleep 10 - done - ${SONOBUOY} status --kubeconfig ${KUBECONFIG} --json | jq . | tee ${TMP}/sonobuoy-status.json - if [ $(cat ${TMP}/sonobuoy-status.json | jq -r '.plugins[] | select(.plugin == "e2e") | ."result-status"') != 'passed' ]; then exit 1; fi + "${TALOSCTL}" health --run-e2e } function run_control_plane_cis_benchmark {