Skip to content

Commit

Permalink
Merge pull request #10217 from k8s-infra-cherrypick-robot/cherry-pick…
Browse files Browse the repository at this point in the history
…-10201-to-release-1.6

[release-1.6] 🐛 test: retry GetOwnerGraph in owner references test on certificate errors
  • Loading branch information
k8s-ci-robot authored Feb 29, 2024
2 parents ffe097e + d699fb9 commit 5439fa6
Showing 1 changed file with 7 additions and 0 deletions.
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

0 comments on commit 5439fa6

Please sign in to comment.