Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for operator-single-crd-owner test case. #2603

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion tests/operator/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,19 @@ func testOperatorSingleCrdOwner(check *checksdb.Check, env *provider.TestEnviron
for i := range env.Operators {
operator := env.Operators[i]
ownedCrds := operator.Csv.Spec.CustomResourceDefinitions.Owned

// Helper map to filter out different versions of the same CRD name.
uniqueOnwnedCrds := map[string]struct{}{}
for j := range ownedCrds {
crdOwners[ownedCrds[j].Name] = append(crdOwners[ownedCrds[j].Name], operator.Name)
uniqueOnwnedCrds[ownedCrds[j].Name] = struct{}{}
}

// Now we can append the operator as CRD owner
for crdName := range uniqueOnwnedCrds {
crdOwners[crdName] = append(crdOwners[crdName], operator.Name)
}

check.LogInfo("CRDs owned by operator %s: %+v", operator.Name, uniqueOnwnedCrds)
}

// Flag those that are owned by more than one operator
Expand Down
Loading