Skip to content

Commit f85655a

Browse files
authored
Merge pull request kubernetes-sigs#10201 from chrischdi/pr-test-wait-for-certmanager-clusterctl-upgrade
🐛 test: retry GetOwnerGraph in owner references test on certificate errors
2 parents 4061a47 + dea02f4 commit f85655a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/framework/ownerreference_helpers.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"fmt"
2222
"reflect"
2323
"sort"
24+
"strings"
2425
"time"
2526

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

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

0 commit comments

Comments
 (0)