Skip to content

Commit

Permalink
fix link and other minor issues
Browse files Browse the repository at this point in the history
  • Loading branch information
adityabhatia committed Sep 20, 2023
1 parent 886cdbd commit 219eb8f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/framework/finalizers_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ package framework
import (
"context"
"fmt"
"sigs.k8s.io/cluster-api/util/patch"
"time"

. "github.com/onsi/gomega"

"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
clusterctlcluster "sigs.k8s.io/cluster-api/cmd/clusterctl/client/cluster"
"sigs.k8s.io/controller-runtime/pkg/client"

clusterctlcluster "sigs.k8s.io/cluster-api/cmd/clusterctl/client/cluster"
"sigs.k8s.io/cluster-api/util/patch"
)

// ValidateFinalizersResilience checks that expected finalizers are in place, deletes them, and verifies that expected finalizers are properly added again.
Expand Down Expand Up @@ -59,13 +59,13 @@ func ValidateFinalizersResilience(ctx context.Context, proxy ClusterProxy, names
func getFinalizersFromAllObjs(ctx context.Context, proxy ClusterProxy, namespace string) map[string][]string {
finalizers := map[string][]string{}
graph, err := clusterctlcluster.GetOwnerGraph(ctx, proxy.GetKubeconfigPath(), namespace)
Expect(err).To(BeNil())
Expect(err).ToNot(HaveOccurred())
for _, v := range graph {
obj := &unstructured.Unstructured{}
obj.SetAPIVersion(v.Object.APIVersion)
obj.SetKind(v.Object.Kind)
err := proxy.GetClient().Get(ctx, client.ObjectKey{Namespace: v.Object.Namespace, Name: v.Object.Name}, obj)
Expect(err).To(BeNil())
Expect(err).ToNot(HaveOccurred())
if obj.GetFinalizers() != nil {
finalizers[fmt.Sprintf("%s/%s", v.Object.Kind, client.ObjectKey{Name: v.Object.Name, Namespace: v.Object.Namespace}.String())] = obj.GetFinalizers()
}
Expand Down Expand Up @@ -105,6 +105,6 @@ func assertFinalizersExist(ctx context.Context, proxy ClusterProxy, namespace st
for k, v := range missing {
missingString = fmt.Sprintf("%s\n%s %s", missingString, k, v)
}
Expect(len(missing)).To(Equal(0), missingString)
Expect(missing).To(BeEmpty(), missingString)
}).WithTimeout(5 * time.Minute).WithPolling(2 * time.Second).Should(Succeed())
}

0 comments on commit 219eb8f

Please sign in to comment.