From f04541b02dfc0dfc37040b05c4981f10f7ca4c60 Mon Sep 17 00:00:00 2001 From: Michael Burman Date: Thu, 5 Sep 2024 13:37:43 +0300 Subject: [PATCH] Fix unit test --- pkg/images/images_test.go | 2 +- tests/util/ginkgo/lib.go | 15 +++------------ 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/pkg/images/images_test.go b/pkg/images/images_test.go index 13582e19..07eb9a69 100644 --- a/pkg/images/images_test.go +++ b/pkg/images/images_test.go @@ -94,7 +94,7 @@ func TestDefaultImageConfigParsing(t *testing.T) { path, err = GetCassandraImage("cassandra", "4.1.4") assert.NoError(err) - assert.Equal("k8ssandra/cass-management-api:4.1.4-ubi8", path) + assert.Equal("k8ssandra/cass-management-api:4.1.4-ubi", path) } func TestImageConfigParsing(t *testing.T) { diff --git a/tests/util/ginkgo/lib.go b/tests/util/ginkgo/lib.go index a05e5d86..aed205d9 100644 --- a/tests/util/ginkgo/lib.go +++ b/tests/util/ginkgo/lib.go @@ -6,7 +6,6 @@ package ginkgo_util import ( "encoding/base64" "fmt" - "github.com/pkg/errors" "os" "path/filepath" "regexp" @@ -15,6 +14,8 @@ import ( "strings" "time" + "github.com/pkg/errors" + ginkgo "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "gopkg.in/yaml.v2" @@ -424,16 +425,6 @@ func (ns *NsWrapper) Log(step string) { ginkgo.By(step) } -func (ns *NsWrapper) getDcNameWithOverride(dcName string) string { - json := "jsonpath={.spec.datacenterName}" - k := kubectl.Get("CassandraDatacenter", dcName).FormatOutput(json) - dcNameOverride := ns.OutputPanic(k) - if dcNameOverride == "" { - return dcName - } - return dcNameOverride -} - func (ns *NsWrapper) WaitForDatacenterReadyWithTimeouts(dcName string, podCountTimeout int, dcReadyTimeout int) { json := "jsonpath={.spec.size}" k := kubectl.Get("CassandraDatacenter", dcName).FormatOutput(json) @@ -441,7 +432,7 @@ func (ns *NsWrapper) WaitForDatacenterReadyWithTimeouts(dcName string, podCountT size, err := strconv.Atoi(sizeString) Expect(err).ToNot(HaveOccurred()) - ns.WaitForDatacenterReadyPodCountWithTimeout(ns.getDcNameWithOverride(dcName), size, podCountTimeout) + ns.WaitForDatacenterReadyPodCountWithTimeout(dcName, size, podCountTimeout) ns.WaitForDatacenterOperatorProgress(dcName, "Ready", dcReadyTimeout) }