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

🐛 test: retry GetOwnerGraph in owner references test on certificate errors #10201

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
7 changes: 7 additions & 0 deletions test/framework/ownerreference_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"fmt"
"reflect"
"sort"
"strings"
"time"

. "github.com/onsi/gomega"
Expand Down Expand Up @@ -112,6 +113,12 @@ func AssertOwnerReferences(namespace, kubeconfigPath string, assertFuncs ...map[
ctx := context.Background()

graph, err := clusterctlcluster.GetOwnerGraph(ctx, namespace, kubeconfigPath)
// Sometimes the conversion-webhooks are not ready yet / cert-managers ca-injector
// may not yet have injected the new ca bundle after the upgrade.
// If this is the case we return an error to retry.
if err != nil && strings.Contains(err.Error(), "x509: certificate signed by unknown authority") {
return err
}
Expect(err).ToNot(HaveOccurred())
for _, v := range graph {
if _, ok := allAssertFuncs[v.Object.Kind]; !ok {
Expand Down
Loading