Skip to content

Commit

Permalink
Remove packageManifest name filter
Browse files Browse the repository at this point in the history
  • Loading branch information
sebrandon1 committed Dec 3, 2024
1 parent e5723f3 commit 3175a0f
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 47 deletions.
14 changes: 0 additions & 14 deletions tests/operator/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,3 @@ func SplitCsv(csv string) CsvResult {
}
return result
}

func GetCsvVersion(csvName string) CsvNameVersion {
// Split by comma to separate components
// example-operator.v1.0.0 -> example-operator, v1.0.0
parts := strings.Split(csvName, ".v")
var result CsvNameVersion

result.Name = parts[0]

if len(parts) > 1 {
result.Version = parts[1]
}
return result
}
26 changes: 0 additions & 26 deletions tests/operator/helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ package operator

import (
"testing"

"github.com/stretchr/testify/assert"
)

func TestSplitCsv(t *testing.T) {
Expand Down Expand Up @@ -71,27 +69,3 @@ func TestSplitCsv(t *testing.T) {
})
}
}

func TestGetCsvVersion(t *testing.T) {
testCases := []struct {
input string
expectedCsv CsvNameVersion
}{
{
input: "example-operator.v1.0.0",
expectedCsv: CsvNameVersion{Name: "example-operator", Version: "1.0.0"},
},
{
input: "another-operator.v2.3.1",
expectedCsv: CsvNameVersion{Name: "another-operator", Version: "2.3.1"},
},
{
input: "no-version",
expectedCsv: CsvNameVersion{Name: "no-version", Version: ""},
},
}

for _, testCase := range testCases {
assert.Equal(t, testCase.expectedCsv, GetCsvVersion(testCase.input))
}
}
7 changes: 0 additions & 7 deletions tests/operator/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -466,15 +466,8 @@ func testOperatorCatalogSourceBundleCount(check *checksdb.Check, env *provider.T
catalogSourceCheckComplete := false
check.LogInfo("Checking bundle count for operator %q", op.Csv.Name)

cvi := GetCsvVersion(op.Csv.Name)

// Search through packagemanifests to match the name of the CSV.
for _, pm := range env.AllPackageManifests {
// Skip all package manifests that do not match the name of the CSV.
if pm.Name != cvi.Name {
continue
}

// Skip package manifests based on channel entries.
if catalogsource.SkipPMBasedOnChannel(pm.Status.Channels, op.Csv.Name) {
log.Debug("Skipping package manifest %q based on channel", pm.Name)
Expand Down

0 comments on commit 3175a0f

Please sign in to comment.