Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions test/e2e/e2e_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ var (
kubeconfig string

workloadName string
workloadProxy framework.ClusterProxy
workloadResult *clusterctl.ApplyClusterTemplateAndWaitResult
)

Expand Down Expand Up @@ -284,7 +285,7 @@ var _ = SynchronizedBeforeSuite(func() []byte {
})

By("Watching vsphere-cpi daemonset logs", func() {
workloadProxy := proxy.GetWorkloadCluster(ctx, workloadKubeconfigNamespace, workloadName)
workloadProxy = proxy.GetWorkloadCluster(ctx, workloadKubeconfigNamespace, workloadName)

framework.WatchDaemonSetLogsByLabelSelector(ctx, framework.WatchDaemonSetLogsByLabelSelectorInput{
GetLister: workloadProxy.GetClient(),
Expand All @@ -310,7 +311,7 @@ var _ = SynchronizedBeforeSuite(func() []byte {
var _ = SynchronizedAfterSuite(func() {}, func() {
// after all parallel test cases finish
if !skipCleanup {
By("Dump all resources to artifacts", func() {
By("Dump bootstrap resources to artifacts", func() {
framework.DumpAllResources(ctx, framework.DumpAllResourcesInput{
Lister: proxy.GetClient(),
KubeConfigPath: proxy.GetKubeconfigPath(),
Expand All @@ -319,6 +320,15 @@ var _ = SynchronizedAfterSuite(func() {}, func() {
LogPath: filepath.Join(artifactFolder, "clusters", proxy.GetName(), "resources"),
})
})
By("Dump workload resources to artifacts", func() {
framework.DumpAllResources(ctx, framework.DumpAllResourcesInput{
Lister: workloadProxy.GetClient(),
KubeConfigPath: workloadProxy.GetKubeconfigPath(),
ClusterctlConfigPath: workloadKubeconfig,
Namespace: "kube-system",
LogPath: filepath.Join(artifactFolder, "clusters", workloadProxy.GetName(), "resources"),
})
})
Comment on lines +323 to +331
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DumpAllResources tries to dump CAPI resources from a workload cluster (which does not have the CRD's installed or any information of them).

It also does not dump any logs afaik. (it uses the logpath to dump clusterctl describe, but that also only makes sense in a management cluster).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @chrischdi. Wanted to reuse that for a quick debug for e2e failure yesterday. As you pointed, this won't help for workload cluster. Let me fix it and reopen this PR later.

By("Tear down the workload cluster", func() {
Expect(workloadResult).NotTo(BeNil())
framework.DeleteAllClustersAndWait(ctx, framework.DeleteAllClustersAndWaitInput{
Expand Down