Skip to content

Commit

Permalink
Merge pull request #10221 from chrischdi/pr-cp-10201-1-4
Browse files Browse the repository at this point in the history
[release-1.4] 🐛 test: retry GetOwnerGraph when having certificate issues
  • Loading branch information
k8s-ci-robot authored Mar 4, 2024
2 parents 64de1a1 + 78b8b40 commit 64d7ea5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion 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 @@ -85,7 +86,13 @@ func AssertOwnerReferences(namespace, kubeconfigPath string, assertFuncs ...map[
Eventually(func() error {
allErrs := []error{}
graph, err := clusterctlcluster.GetOwnerGraph(namespace, kubeconfigPath)
Expect(err).To(BeNil())
// 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 {
allErrs = append(allErrs, fmt.Errorf("kind %s does not have an associated ownerRef assertion function", v.Object.Kind))
Expand Down

0 comments on commit 64d7ea5

Please sign in to comment.