Skip to content

Commit 84daf89

Browse files
committed
debug Objects with Changed Resource Versions
1 parent ffa63d2 commit 84daf89

File tree

2 files changed

+30
-3
lines changed

2 files changed

+30
-3
lines changed

test/e2e/quick_start.go

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,11 @@ import (
2727
. "github.com/onsi/ginkgo/v2"
2828
. "github.com/onsi/gomega"
2929
corev1 "k8s.io/api/core/v1"
30+
"k8s.io/apimachinery/pkg/api/errors"
31+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
3032
"k8s.io/utils/ptr"
3133

34+
"sigs.k8s.io/cluster-api/test/e2e/internal/log"
3235
"sigs.k8s.io/cluster-api/test/framework"
3336
"sigs.k8s.io/cluster-api/test/framework/clusterctl"
3437
"sigs.k8s.io/cluster-api/util"
@@ -244,6 +247,7 @@ func QuickStartSpec(ctx context.Context, inputGetter func() QuickStartSpecInput)
244247
})
245248

246249
By("PASSED!")
250+
247251
})
248252

249253
AfterEach(func() {
@@ -256,11 +260,34 @@ func QuickStartSpec(ctx context.Context, inputGetter func() QuickStartSpecInput)
256260
}, 10*time.Second, 1*time.Second).Should(Succeed(), "Deleting ExtensionConfig failed")
257261
}
258262
if input.DeployClusterClassInSeparateNamespace {
259-
framework.DeleteNamespace(ctx, framework.DeleteNamespaceInput{
263+
DeleteNamespace11(ctx, framework.DeleteNamespaceInput{
260264
Deleter: input.BootstrapClusterProxy.GetClient(),
261265
Name: clusterClassNamespace.Name,
262266
})
263267
}
264268
}
265269
})
270+
271+
}
272+
273+
// DeleteNamespace is used to delete namespace object.
274+
func DeleteNamespace11(ctx context.Context, input framework.DeleteNamespaceInput, intervals ...interface{}) {
275+
Expect(ctx).NotTo(BeNil(), "ctx is required for DeleteNamespace")
276+
Expect(input.Deleter).NotTo(BeNil(), "input.Deleter is required for DeleteNamespace")
277+
Expect(input.Name).NotTo(BeEmpty(), "input.Name is required for DeleteNamespace")
278+
ns := &corev1.Namespace{
279+
ObjectMeta: metav1.ObjectMeta{
280+
Name: input.Name,
281+
},
282+
}
283+
log.Logf("Deleting namespace %s", input.Name)
284+
Eventually(func() error {
285+
err := input.Deleter.Delete(ctx, ns)
286+
if err != nil && !errors.IsNotFound(err) {
287+
288+
return err
289+
290+
}
291+
return nil
292+
}, intervals...).Should(Succeed(), "Failed to delete namespace %s", input.Name)
266293
}

test/e2e/quick_start_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import (
2929
"sigs.k8s.io/cluster-api/test/framework/kubetest"
3030
)
3131

32-
var _ = Describe("When following the Cluster API quick-start", func() {
32+
var _ = Describe("When following the Cluster API quick-start11 [PR-Blocking] [ClusterClass]", Label("PR-Blocking", "ClusterClass"), func() {
3333
QuickStartSpec(ctx, func() QuickStartSpecInput {
3434
return QuickStartSpecInput{
3535
E2EConfig: e2eConfig,
@@ -75,7 +75,7 @@ var _ = Describe("When following the Cluster API quick-start", func() {
7575
})
7676
})
7777

78-
var _ = Describe("When following the Cluster API quick-start with ClusterClass [PR-Blocking] [ClusterClass]", Label("PR-Blocking", "ClusterClass"), func() {
78+
var _ = Describe("When following the Cluster API quick-start with ClusterClass ", func() {
7979
QuickStartSpec(ctx, func() QuickStartSpecInput {
8080
return QuickStartSpecInput{
8181
E2EConfig: e2eConfig,

0 commit comments

Comments
 (0)