From 383b6d353c2fa5cfaf0d722ab2c20f1f43cbfabe Mon Sep 17 00:00:00 2001 From: Richard Kovacs Date: Thu, 30 Nov 2023 09:38:48 +0100 Subject: [PATCH 1/2] Load localstack image to Kind --- .husky/hooks/pre-push | 2 +- Makefile | 4 ++++ internal/controller/bucket/create.go | 6 ++++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.husky/hooks/pre-push b/.husky/hooks/pre-push index f3a1f72a..02e4d746 100755 --- a/.husky/hooks/pre-push +++ b/.husky/hooks/pre-push @@ -13,7 +13,7 @@ if git status --short | grep -qv "??"; then trap unstash EXIT fi -make generate +make generate generate-pkg git diff --exit-code --quiet || (git status && exit 1) make lint go.test.unit diff --git a/Makefile b/Makefile index 7ddbc288..d38782ea 100644 --- a/Makefile +++ b/Makefile @@ -118,8 +118,10 @@ run: go.build # Create k8s service to allows pods to communicate with # localstack. cluster: $(KIND) $(KUBECTL) cluster-clean + docker pull localstack/localstack:2.2 @$(INFO) Creating kind cluster @$(KIND) create cluster --name=$(KIND_CLUSTER_NAME) --config e2e/kind/kind-config-$(LATEST_KUBE_VERSION).yaml + @$(KIND) load docker-image --name=$(KIND_CLUSTER_NAME) localstack/localstack:2.2 @$(OK) Creating kind cluster # Spin up a Kind cluster and localstack and install Crossplane via Helm. @@ -171,8 +173,10 @@ kuttl: $(KUTTL) crossplane-cluster load-package @$(MAKE) cluster-clean ceph-kuttl: $(KIND) $(KUTTL) $(HELM3) cluster-clean + docker pull localstack/localstack:2.2 @$(INFO) Creating kind cluster @$(KIND) create cluster --name=$(KIND_CLUSTER_NAME) + @$(KIND) load docker-image --name=$(KIND_CLUSTER_NAME) localstack/localstack:2.2 @$(OK) Creating kind cluster @$(KUTTL) test --config e2e/kuttl/ceph/provider-ceph-$(LATEST_KUBE_VERSION).yaml diff --git a/internal/controller/bucket/create.go b/internal/controller/bucket/create.go index bb643c64..826aa9ec 100644 --- a/internal/controller/bucket/create.go +++ b/internal/controller/bucket/create.go @@ -69,6 +69,8 @@ func (c *external) Create(ctx context.Context, mg resource.Managed) (managed.Ext pc := &apisv1alpha1.ProviderConfig{} if err := c.kubeClient.Get(ctx, types.NamespacedName{Name: beName}, pc); err != nil { + c.log.Info("Failed to fetch provider config", "backend name", beName, "bucket_name", originalBucket.Name, "err", err.Error()) + return managed.ExternalCreation{}, errors.Wrap(err, errGetPC) } @@ -94,7 +96,7 @@ func (c *external) Create(ctx context.Context, mg resource.Managed) (managed.Ext } if err != nil { - c.log.Info("Failed to create bucket on backend", "backend name", beName, "bucket_name", originalBucket.Name) + c.log.Info("Failed to create bucket on backend", "backend name", beName, "bucket_name", originalBucket.Name, "err", err.Error()) errChan <- err @@ -160,7 +162,7 @@ WAIT: errorsLeft-- if err != nil { - c.log.Info("Failed to create on backend", "bucket_name", bucket.Name) + c.log.Info("Failed to create on backend", "bucket_name", bucket.Name, "err", err.Error()) if errorsLeft > 0 { continue From 761d2462062f5860f3128b25efc4aa36fcc198a3 Mon Sep 17 00:00:00 2001 From: Richard Kovacs Date: Thu, 30 Nov 2023 19:01:29 +0100 Subject: [PATCH 2/2] Don't upload localstack image for ceph test --- .github/workflows/kuttl-e2e-test-1.28.yaml | 2 +- .husky/hooks/pre-push | 2 +- Makefile | 2 -- e2e/kuttl/ceph/provider-ceph-1.25.yaml | 2 -- e2e/kuttl/ceph/provider-ceph-1.26.yaml | 2 -- e2e/kuttl/ceph/provider-ceph-1.27.yaml | 2 -- e2e/kuttl/ceph/provider-ceph-1.28.yaml | 2 -- hack/generate-tests.sh | 2 -- 8 files changed, 2 insertions(+), 14 deletions(-) diff --git a/.github/workflows/kuttl-e2e-test-1.28.yaml b/.github/workflows/kuttl-e2e-test-1.28.yaml index 7790d51b..bea251b8 100644 --- a/.github/workflows/kuttl-e2e-test-1.28.yaml +++ b/.github/workflows/kuttl-e2e-test-1.28.yaml @@ -15,7 +15,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-go@v2 with: - go-version: '1.20' + go-version: '1.21' - name: Install dependencies run: | sudo curl -Lo $KUTTL https://github.com/kudobuilder/kuttl/releases/download/v0.13.0/kubectl-kuttl_0.13.0_linux_x86_64 diff --git a/.husky/hooks/pre-push b/.husky/hooks/pre-push index 02e4d746..2c8a53c1 100755 --- a/.husky/hooks/pre-push +++ b/.husky/hooks/pre-push @@ -13,7 +13,7 @@ if git status --short | grep -qv "??"; then trap unstash EXIT fi -make generate generate-pkg +make generate generate-pkg generate-tests git diff --exit-code --quiet || (git status && exit 1) make lint go.test.unit diff --git a/Makefile b/Makefile index d38782ea..2f84f2d9 100644 --- a/Makefile +++ b/Makefile @@ -173,10 +173,8 @@ kuttl: $(KUTTL) crossplane-cluster load-package @$(MAKE) cluster-clean ceph-kuttl: $(KIND) $(KUTTL) $(HELM3) cluster-clean - docker pull localstack/localstack:2.2 @$(INFO) Creating kind cluster @$(KIND) create cluster --name=$(KIND_CLUSTER_NAME) - @$(KIND) load docker-image --name=$(KIND_CLUSTER_NAME) localstack/localstack:2.2 @$(OK) Creating kind cluster @$(KUTTL) test --config e2e/kuttl/ceph/provider-ceph-$(LATEST_KUBE_VERSION).yaml diff --git a/e2e/kuttl/ceph/provider-ceph-1.25.yaml b/e2e/kuttl/ceph/provider-ceph-1.25.yaml index adfba276..849d9488 100644 --- a/e2e/kuttl/ceph/provider-ceph-1.25.yaml +++ b/e2e/kuttl/ceph/provider-ceph-1.25.yaml @@ -6,6 +6,4 @@ testDirs: kindConfig: e2e/kind/kind-config-1.25.yaml startKIND: false kindNodeCache: true -kindContainers: -- localstack/localstack:2.2 timeout: 120 diff --git a/e2e/kuttl/ceph/provider-ceph-1.26.yaml b/e2e/kuttl/ceph/provider-ceph-1.26.yaml index de414a99..a3a5cfbf 100644 --- a/e2e/kuttl/ceph/provider-ceph-1.26.yaml +++ b/e2e/kuttl/ceph/provider-ceph-1.26.yaml @@ -6,6 +6,4 @@ testDirs: kindConfig: e2e/kind/kind-config-1.26.yaml startKIND: false kindNodeCache: true -kindContainers: -- localstack/localstack:2.2 timeout: 120 diff --git a/e2e/kuttl/ceph/provider-ceph-1.27.yaml b/e2e/kuttl/ceph/provider-ceph-1.27.yaml index 3dd638b5..4c1d9d2c 100644 --- a/e2e/kuttl/ceph/provider-ceph-1.27.yaml +++ b/e2e/kuttl/ceph/provider-ceph-1.27.yaml @@ -6,6 +6,4 @@ testDirs: kindConfig: e2e/kind/kind-config-1.27.yaml startKIND: false kindNodeCache: true -kindContainers: -- localstack/localstack:2.2 timeout: 120 diff --git a/e2e/kuttl/ceph/provider-ceph-1.28.yaml b/e2e/kuttl/ceph/provider-ceph-1.28.yaml index 0270ca77..da20128d 100644 --- a/e2e/kuttl/ceph/provider-ceph-1.28.yaml +++ b/e2e/kuttl/ceph/provider-ceph-1.28.yaml @@ -6,6 +6,4 @@ testDirs: kindConfig: e2e/kind/kind-config-1.28.yaml startKIND: false kindNodeCache: true -kindContainers: -- localstack/localstack:2.2 timeout: 120 diff --git a/hack/generate-tests.sh b/hack/generate-tests.sh index 5abca9d6..2328b2be 100755 --- a/hack/generate-tests.sh +++ b/hack/generate-tests.sh @@ -82,8 +82,6 @@ testDirs: kindConfig: e2e/kind/kind-config-${major}.yaml startKIND: false kindNodeCache: true -kindContainers: -- localstack/localstack:2.2 timeout: 120 EOF