Skip to content

Commit 143f280

Browse files
Add clusterctl describe to E2E artifacts
1 parent e3da33b commit 143f280

23 files changed

+219
-76
lines changed

test/e2e/autoscaler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,6 @@ func AutoscalerSpec(ctx context.Context, inputGetter func() AutoscalerSpecInput)
372372

373373
AfterEach(func() {
374374
// Dumps all the resources in the spec namespace, then cleanups the cluster object and the spec namespace itself.
375-
framework.DumpSpecResourcesAndCleanup(ctx, specName, input.BootstrapClusterProxy, input.ArtifactFolder, namespace, cancelWatches, clusterResources.Cluster, input.E2EConfig.GetIntervals, input.SkipCleanup)
375+
framework.DumpSpecResourcesAndCleanup(ctx, specName, input.BootstrapClusterProxy, input.ClusterctlConfigPath, input.ArtifactFolder, namespace, cancelWatches, clusterResources.Cluster, input.E2EConfig.GetIntervals, input.SkipCleanup)
376376
})
377377
}

test/e2e/cluster_deletion.go

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -254,17 +254,18 @@ func ClusterDeletionSpec(ctx context.Context, inputGetter func() ClusterDeletion
254254

255255
log.Logf("Waiting for the Cluster %s to be deleted", klog.KObj(clusterResources.Cluster))
256256
framework.WaitForClusterDeleted(ctx, framework.WaitForClusterDeletedInput{
257-
Client: input.BootstrapClusterProxy.GetClient(),
258-
Cluster: clusterResources.Cluster,
259-
ArtifactFolder: input.ArtifactFolder,
257+
ClusterProxy: input.BootstrapClusterProxy,
258+
ClusterctlConfigPath: input.ClusterctlConfigPath,
259+
Cluster: clusterResources.Cluster,
260+
ArtifactFolder: input.ArtifactFolder,
260261
}, input.E2EConfig.GetIntervals(specName, "wait-delete-cluster")...)
261262

262263
By("PASSED!")
263264
})
264265

265266
AfterEach(func() {
266267
// Dump all the resources in the spec namespace and the workload cluster.
267-
framework.DumpAllResourcesAndLogs(ctx, input.BootstrapClusterProxy, input.ArtifactFolder, namespace, clusterResources.Cluster)
268+
framework.DumpAllResourcesAndLogs(ctx, input.BootstrapClusterProxy, input.ClusterctlConfigPath, input.ArtifactFolder, namespace, clusterResources.Cluster)
268269

269270
if !input.SkipCleanup {
270271
// Remove finalizers we added to block normal deletion.
@@ -275,9 +276,10 @@ func ClusterDeletionSpec(ctx context.Context, inputGetter func() ClusterDeletion
275276
// that cluster variable is not set even if the cluster exists, so we are calling DeleteAllClustersAndWait
276277
// instead of DeleteClusterAndWait
277278
framework.DeleteAllClustersAndWait(ctx, framework.DeleteAllClustersAndWaitInput{
278-
Client: input.BootstrapClusterProxy.GetClient(),
279-
Namespace: namespace.Name,
280-
ArtifactFolder: input.ArtifactFolder,
279+
ClusterProxy: input.BootstrapClusterProxy,
280+
ClusterctlConfigPath: input.ClusterctlConfigPath,
281+
Namespace: namespace.Name,
282+
ArtifactFolder: input.ArtifactFolder,
281283
}, input.E2EConfig.GetIntervals(specName, "wait-delete-cluster")...)
282284

283285
By(fmt.Sprintf("Deleting namespace used for hosting the %q test spec", specName))

test/e2e/cluster_upgrade.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,6 @@ func ClusterUpgradeConformanceSpec(ctx context.Context, inputGetter func() Clust
281281

282282
AfterEach(func() {
283283
// Dumps all the resources in the spec Namespace, then cleanups the cluster object and the spec Namespace itself.
284-
framework.DumpSpecResourcesAndCleanup(ctx, specName, input.BootstrapClusterProxy, input.ArtifactFolder, namespace, cancelWatches, clusterResources.Cluster, input.E2EConfig.GetIntervals, input.SkipCleanup)
284+
framework.DumpSpecResourcesAndCleanup(ctx, specName, input.BootstrapClusterProxy, input.ClusterctlConfigPath, input.ArtifactFolder, namespace, cancelWatches, clusterResources.Cluster, input.E2EConfig.GetIntervals, input.SkipCleanup)
285285
})
286286
}

test/e2e/cluster_upgrade_runtimesdk.go

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ func ClusterUpgradeWithRuntimeSDKSpec(ctx context.Context, inputGetter func() Cl
327327
}
328328

329329
By("Dumping resources and deleting the workload cluster; deletion waits for BeforeClusterDeleteHook to gate the operation")
330-
dumpAndDeleteCluster(ctx, input.BootstrapClusterProxy, namespace.Name, clusterName, input.ArtifactFolder)
330+
dumpAndDeleteCluster(ctx, input.BootstrapClusterProxy, input.ClusterctlConfigPath, namespace.Name, clusterName, input.ArtifactFolder)
331331

332332
beforeClusterDeleteHandler(ctx, input.BootstrapClusterProxy.GetClient(), clusterRef, input.E2EConfig.GetIntervals(specName, "wait-delete-cluster"))
333333

@@ -347,7 +347,7 @@ func ClusterUpgradeWithRuntimeSDKSpec(ctx context.Context, inputGetter func() Cl
347347

348348
AfterEach(func() {
349349
// Dump all the resources in the spec namespace and the workload cluster.
350-
framework.DumpAllResourcesAndLogs(ctx, input.BootstrapClusterProxy, input.ArtifactFolder, namespace, clusterResources.Cluster)
350+
framework.DumpAllResourcesAndLogs(ctx, input.BootstrapClusterProxy, input.ClusterctlConfigPath, input.ArtifactFolder, namespace, clusterResources.Cluster)
351351

352352
if !input.SkipCleanup {
353353
// Delete the extensionConfig first to ensure the BeforeDeleteCluster hook doesn't block deletion.
@@ -360,9 +360,10 @@ func ClusterUpgradeWithRuntimeSDKSpec(ctx context.Context, inputGetter func() Cl
360360
// that cluster variable is not set even if the cluster exists, so we are calling DeleteAllClustersAndWait
361361
// instead of DeleteClusterAndWait
362362
framework.DeleteAllClustersAndWait(ctx, framework.DeleteAllClustersAndWaitInput{
363-
Client: input.BootstrapClusterProxy.GetClient(),
364-
Namespace: namespace.Name,
365-
ArtifactFolder: input.ArtifactFolder,
363+
ClusterProxy: input.BootstrapClusterProxy,
364+
ClusterctlConfigPath: input.ClusterctlConfigPath,
365+
Namespace: namespace.Name,
366+
ArtifactFolder: input.ArtifactFolder,
366367
}, input.E2EConfig.GetIntervals(specName, "wait-delete-cluster")...)
367368

368369
Byf("Deleting namespace used for hosting the %q test spec", specName)
@@ -749,7 +750,7 @@ func clusterConditionShowsHookBlocking(cluster *clusterv1.Cluster, hookName stri
749750
strings.Contains(conditions.GetMessage(cluster, clusterv1.TopologyReconciledCondition), hookName)
750751
}
751752

752-
func dumpAndDeleteCluster(ctx context.Context, proxy framework.ClusterProxy, namespace, clusterName, artifactFolder string) {
753+
func dumpAndDeleteCluster(ctx context.Context, proxy framework.ClusterProxy, clusterctlConfigPath, namespace, clusterName, artifactFolder string) {
753754
By("Deleting the workload cluster")
754755

755756
cluster := framework.GetClusterByName(ctx, framework.GetClusterByNameInput{
@@ -763,9 +764,11 @@ func dumpAndDeleteCluster(ctx context.Context, proxy framework.ClusterProxy, nam
763764

764765
// Dump all Cluster API related resources to artifacts before deleting them.
765766
framework.DumpAllResources(ctx, framework.DumpAllResourcesInput{
766-
Lister: proxy.GetClient(),
767-
Namespace: namespace,
768-
LogPath: filepath.Join(artifactFolder, "clusters-beforeClusterDelete", proxy.GetName(), "resources")})
767+
Lister: proxy.GetClient(),
768+
KubeConfigPath: proxy.GetKubeconfigPath(),
769+
ClusterctlConfigPath: clusterctlConfigPath,
770+
Namespace: namespace,
771+
LogPath: filepath.Join(artifactFolder, "clusters-beforeClusterDelete", proxy.GetName(), "resources")})
769772

770773
By("Deleting the workload cluster")
771774
framework.DeleteCluster(ctx, framework.DeleteClusterInput{

test/e2e/clusterclass_changes.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ func ClusterClassChangesSpec(ctx context.Context, inputGetter func() ClusterClas
281281

282282
AfterEach(func() {
283283
// Dumps all the resources in the spec namespace, then cleanups the cluster object and the spec namespace itself.
284-
framework.DumpSpecResourcesAndCleanup(ctx, specName, input.BootstrapClusterProxy, input.ArtifactFolder, namespace, cancelWatches, clusterResources.Cluster, input.E2EConfig.GetIntervals, input.SkipCleanup)
284+
framework.DumpSpecResourcesAndCleanup(ctx, specName, input.BootstrapClusterProxy, input.ClusterctlConfigPath, input.ArtifactFolder, namespace, cancelWatches, clusterResources.Cluster, input.E2EConfig.GetIntervals, input.SkipCleanup)
285285

286286
if !input.SkipCleanup {
287287
Byf("Deleting namespace used for hosting the %q test spec ClusterClass", specName)

test/e2e/clusterclass_rollout.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ func ClusterClassRolloutSpec(ctx context.Context, inputGetter func() ClusterClas
308308

309309
AfterEach(func() {
310310
// Dumps all the resources in the spec namespace, then cleanups the cluster object and the spec namespace itself.
311-
framework.DumpSpecResourcesAndCleanup(ctx, specName, input.BootstrapClusterProxy, input.ArtifactFolder, namespace, cancelWatches, clusterResources.Cluster, input.E2EConfig.GetIntervals, input.SkipCleanup)
311+
framework.DumpSpecResourcesAndCleanup(ctx, specName, input.BootstrapClusterProxy, input.ClusterctlConfigPath, input.ArtifactFolder, namespace, cancelWatches, clusterResources.Cluster, input.E2EConfig.GetIntervals, input.SkipCleanup)
312312
})
313313
}
314314

test/e2e/clusterctl_upgrade.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ func ClusterctlUpgradeSpec(ctx context.Context, inputGetter func() ClusterctlUpg
730730
AfterEach(func() {
731731
if testNamespace != nil {
732732
// Dump all the logs from the workload cluster before deleting them.
733-
framework.DumpAllResourcesAndLogs(ctx, managementClusterProxy, input.ArtifactFolder, testNamespace, managementClusterResources.Cluster)
733+
framework.DumpAllResourcesAndLogs(ctx, managementClusterProxy, input.ClusterctlConfigPath, input.ArtifactFolder, testNamespace, managementClusterResources.Cluster)
734734

735735
if !input.SkipCleanup {
736736
Byf("Deleting all clusters in namespace %s in management cluster %s", testNamespace.Name, managementClusterName)
@@ -767,7 +767,7 @@ func ClusterctlUpgradeSpec(ctx context.Context, inputGetter func() ClusterctlUpg
767767
managementClusterProvider.Dispose(ctx)
768768
}
769769
} else {
770-
framework.DumpSpecResourcesAndCleanup(ctx, specName, input.BootstrapClusterProxy, input.ArtifactFolder, managementClusterNamespace, managementClusterCancelWatches, managementClusterResources.Cluster, input.E2EConfig.GetIntervals, input.SkipCleanup)
770+
framework.DumpSpecResourcesAndCleanup(ctx, specName, input.BootstrapClusterProxy, input.ClusterctlConfigPath, input.ArtifactFolder, managementClusterNamespace, managementClusterCancelWatches, managementClusterResources.Cluster, input.E2EConfig.GetIntervals, input.SkipCleanup)
771771
}
772772
})
773773
}

test/e2e/k8s_conformance.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,6 @@ func K8SConformanceSpec(ctx context.Context, inputGetter func() K8SConformanceSp
158158

159159
AfterEach(func() {
160160
// Dumps all the resources in the spec namespace, then cleanups the cluster object and the spec namespace itself.
161-
framework.DumpSpecResourcesAndCleanup(ctx, specName, input.BootstrapClusterProxy, input.ArtifactFolder, namespace, cancelWatches, clusterResources.Cluster, input.E2EConfig.GetIntervals, input.SkipCleanup)
161+
framework.DumpSpecResourcesAndCleanup(ctx, specName, input.BootstrapClusterProxy, input.ClusterctlConfigPath, input.ArtifactFolder, namespace, cancelWatches, clusterResources.Cluster, input.E2EConfig.GetIntervals, input.SkipCleanup)
162162
})
163163
}

test/e2e/kcp_adoption.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,6 @@ func KCPAdoptionSpec(ctx context.Context, inputGetter func() KCPAdoptionSpecInpu
252252

253253
AfterEach(func() {
254254
// Dumps all the resources in the spec namespace, then cleanups the cluster object and the spec namespace itself.
255-
framework.DumpSpecResourcesAndCleanup(ctx, specName, input.BootstrapClusterProxy, input.ArtifactFolder, namespace, cancelWatches, cluster, input.E2EConfig.GetIntervals, input.SkipCleanup)
255+
framework.DumpSpecResourcesAndCleanup(ctx, specName, input.BootstrapClusterProxy, input.ClusterctlConfigPath, input.ArtifactFolder, namespace, cancelWatches, cluster, input.E2EConfig.GetIntervals, input.SkipCleanup)
256256
})
257257
}

test/e2e/kcp_remediations.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ func KCPRemediationSpec(ctx context.Context, inputGetter func() KCPRemediationSp
418418

419419
AfterEach(func() {
420420
// Dumps all the resources in the spec namespace, then cleanups the cluster object and the spec namespace itself.
421-
framework.DumpSpecResourcesAndCleanup(ctx, specName, input.BootstrapClusterProxy, input.ArtifactFolder, namespace, cancelWatches, clusterResources.Cluster, input.E2EConfig.GetIntervals, input.SkipCleanup)
421+
framework.DumpSpecResourcesAndCleanup(ctx, specName, input.BootstrapClusterProxy, input.ClusterctlConfigPath, input.ArtifactFolder, namespace, cancelWatches, clusterResources.Cluster, input.E2EConfig.GetIntervals, input.SkipCleanup)
422422
})
423423
}
424424

0 commit comments

Comments
 (0)