diff --git a/.bingo/Variables.mk b/.bingo/Variables.mk index 2e1391f05..4b5b0e3ae 100644 --- a/.bingo/Variables.mk +++ b/.bingo/Variables.mk @@ -41,12 +41,6 @@ $(CRD_REF_DOCS): $(BINGO_DIR)/crd-ref-docs.mod @echo "(re)installing $(GOBIN)/crd-ref-docs-v0.1.0" @cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=crd-ref-docs.mod -o=$(GOBIN)/crd-ref-docs-v0.1.0 "github.com/elastic/crd-ref-docs" -GINKGO := $(GOBIN)/ginkgo-v2.22.2 -$(GINKGO): $(BINGO_DIR)/ginkgo.mod - @# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies. - @echo "(re)installing $(GOBIN)/ginkgo-v2.22.2" - @cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=ginkgo.mod -o=$(GOBIN)/ginkgo-v2.22.2 "github.com/onsi/ginkgo/v2/ginkgo" - GOLANGCI_LINT := $(GOBIN)/golangci-lint-v1.63.4 $(GOLANGCI_LINT): $(BINGO_DIR)/golangci-lint.mod @# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies. diff --git a/.bingo/ginkgo.mod b/.bingo/ginkgo.mod deleted file mode 100644 index 024da10e0..000000000 --- a/.bingo/ginkgo.mod +++ /dev/null @@ -1,7 +0,0 @@ -module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT - -go 1.22.0 - -toolchain go1.23.0 - -require github.com/onsi/ginkgo/v2 v2.22.0 // ginkgo \ No newline at end of file diff --git a/.bingo/ginkgo.sum b/.bingo/ginkgo.sum deleted file mode 100644 index bf4e1c138..000000000 --- a/.bingo/ginkgo.sum +++ /dev/null @@ -1,8 +0,0 @@ -github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= -github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= -github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad h1:a6HEuzUHeKH6hwfN/ZoQgRgVIWFJljSWa/zetS2WTvg= -github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= -github.com/onsi/ginkgo/v2 v2.22.2 h1:/3X8Panh8/WwhU/3Ssa6rCKqPLuAkVY2I0RoyDLySlU= -github.com/onsi/ginkgo/v2 v2.22.2/go.mod h1:oeMosUL+8LtarXBHu/c0bx2D/K9zyQ6uX3cTyztHwsk= -golang.org/x/tools v0.28.0 h1:WuB6qZ4RPCQo5aP3WdKZS7i595EdWqWR8vqJTlwTVK8= -golang.org/x/tools v0.28.0/go.mod h1:dcIOrVd3mfQKTgrDVQHqCPMWy6lnhfhtX3hLXYVLfRw= diff --git a/.bingo/variables.env b/.bingo/variables.env index 63a3618d0..b97764b84 100644 --- a/.bingo/variables.env +++ b/.bingo/variables.env @@ -16,8 +16,6 @@ CRD_DIFF="${GOBIN}/crd-diff-v0.1.0" CRD_REF_DOCS="${GOBIN}/crd-ref-docs-v0.1.0" -GINKGO="${GOBIN}/ginkgo-v2.22.2" - GOLANGCI_LINT="${GOBIN}/golangci-lint-v1.63.4" GORELEASER="${GOBIN}/goreleaser-v1.26.2" diff --git a/catalogd/Makefile b/catalogd/Makefile index d58367f42..ce56ed52a 100644 --- a/catalogd/Makefile +++ b/catalogd/Makefile @@ -44,6 +44,8 @@ TESTDATA_DIR := testdata CATALOGD_NAMESPACE := olmv1-system KIND_CLUSTER_IMAGE := kindest/node:v1.30.0@sha256:047357ac0cfea04663786a612ba1eaba9702bef25227a794b52890dd8bcd692e +GINKGO := go run github.com/onsi/ginkgo/v2/ginkgo + ##@ General # The help target prints out all targets with their descriptions organized @@ -76,7 +78,7 @@ FOCUS := $(if $(TEST),-v -focus "$(TEST)") ifeq ($(origin E2E_FLAGS), undefined) E2E_FLAGS := endif -test-e2e: $(GINKGO) ## Run the e2e tests on existing cluster +test-e2e: ## Run the e2e tests on existing cluster $(GINKGO) $(E2E_FLAGS) -trace -vv $(FOCUS) test/e2e e2e: KIND_CLUSTER_NAME := catalogd-e2e @@ -105,7 +107,7 @@ run-latest-release: cd ..; curl -L -s https://github.com/operator-framework/operator-controller/releases/latest/download/install.sh | bash -s .PHONY: post-upgrade-checks -post-upgrade-checks: $(GINKGO) +post-upgrade-checks: $(GINKGO) $(E2E_FLAGS) -trace -vv $(FOCUS) test/upgrade ##@ Build diff --git a/catalogd/test/upgrade/unpack_test.go b/catalogd/test/upgrade/unpack_test.go index e13354454..9c42f11f1 100644 --- a/catalogd/test/upgrade/unpack_test.go +++ b/catalogd/test/upgrade/unpack_test.go @@ -54,6 +54,17 @@ var _ = Describe("ClusterCatalog Unpacking", func() { managerPod = managerPods.Items[0] }).Should(Succeed()) + By("Waiting for acquired leader election") + // Average case is under 1 minute but in the worst case: (previous leader crashed) + // we could have LeaseDuration (137s) + RetryPeriod (26s) +/- 163s + leaderCtx, leaderCancel := context.WithTimeout(ctx, 3*time.Minute) + defer leaderCancel() + + leaderSubstrings := []string{"successfully acquired lease"} + leaderElected, err := watchPodLogsForSubstring(leaderCtx, &managerPod, "manager", leaderSubstrings...) + Expect(err).To(Succeed()) + Expect(leaderElected).To(BeTrue()) + By("Reading logs to make sure that ClusterCatalog was reconciled by catalogdv1") logCtx, cancel := context.WithTimeout(ctx, time.Minute) defer cancel() diff --git a/test/upgrade-e2e/post_upgrade_test.go b/test/upgrade-e2e/post_upgrade_test.go index 204c79330..0f60210c5 100644 --- a/test/upgrade-e2e/post_upgrade_test.go +++ b/test/upgrade-e2e/post_upgrade_test.go @@ -40,6 +40,17 @@ func TestClusterExtensionAfterOLMUpgrade(t *testing.T) { t.Log("Wait for operator-controller deployment to be ready") managerPod := waitForDeployment(t, ctx, "operator-controller-controller-manager") + t.Log("Wait for acquired leader election") + // Average case is under 1 minute but in the worst case: (previous leader crashed) + // we could have LeaseDuration (137s) + RetryPeriod (26s) +/- 163s + leaderCtx, leaderCancel := context.WithTimeout(ctx, 3*time.Minute) + defer leaderCancel() + + leaderSubstrings := []string{"successfully acquired lease"} + leaderElected, err := watchPodLogsForSubstring(leaderCtx, managerPod, "manager", leaderSubstrings...) + require.NoError(t, err) + require.True(t, leaderElected) + t.Log("Reading logs to make sure that ClusterExtension was reconciled by operator-controller before we update it") // Make sure that after we upgrade OLM itself we can still reconcile old objects without any changes logCtx, cancel := context.WithTimeout(ctx, time.Minute)