Skip to content

Commit

Permalink
fix log path
Browse files Browse the repository at this point in the history
  • Loading branch information
Cecile Robert-Michon committed May 6, 2021
1 parent d5f1689 commit 4dfa272
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion test/e2e/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func dumpSpecResourcesAndCleanup(ctx context.Context, specName string, clusterPr
Byf("Dumping logs from the %q workload cluster", cluster.Name)

// Dump all the logs from the workload cluster before deleting them.
clusterProxy.CollectWorkloadClusterLogs(ctx, cluster.Namespace, cluster.Name, filepath.Join(artifactFolder, "clusters", cluster.Name, "machines"))
clusterProxy.CollectWorkloadClusterLogs(ctx, cluster.Namespace, cluster.Name, filepath.Join(artifactFolder, "clusters", cluster.Name))

Byf("Dumping all the Cluster API resources in the %q namespace", namespace.Name)

Expand Down
4 changes: 2 additions & 2 deletions test/framework/cluster_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ func (p *clusterProxy) CollectWorkloadClusterLogs(ctx context.Context, namespace

for i := range machines.Items {
m := &machines.Items[i]
err := p.logCollector.CollectMachineLog(ctx, p.GetClient(), m, path.Join(outputPath, m.GetName()))
err := p.logCollector.CollectMachineLog(ctx, p.GetClient(), m, path.Join(outputPath, "machines", m.GetName()))
if err != nil {
// NB. we are treating failures in collecting logs as a non blocking operation (best effort)
fmt.Printf("Failed to get logs for machine %s, cluster %s/%s: %v\n", m.GetName(), namespace, name, err)
Expand All @@ -240,7 +240,7 @@ func (p *clusterProxy) CollectWorkloadClusterLogs(ctx context.Context, namespace

for i := range machinePools.Items {
mp := &machinePools.Items[i]
err := p.logCollector.CollectMachinePoolLog(ctx, p.GetClient(), mp, path.Join(outputPath, mp.GetName()))
err := p.logCollector.CollectMachinePoolLog(ctx, p.GetClient(), mp, path.Join(outputPath, "machine-pools", mp.GetName()))
if err != nil {
// NB. we are treating failures in collecting logs as a non blocking operation (best effort)
fmt.Printf("Failed to get logs for machine pool %s, cluster %s/%s: %v\n", mp.GetName(), namespace, name, err)
Expand Down
2 changes: 1 addition & 1 deletion test/framework/docker_logcollector.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func (k DockerLogCollector) CollectMachineLog(ctx context.Context, managementClu
func (k DockerLogCollector) CollectMachinePoolLog(ctx context.Context, managementClusterClient client.Client, m *expv1.MachinePool, outputPath string) error {
for _, instance := range m.Status.NodeRefs {
containerName := generateContainerName(m.Spec.ClusterName, instance.Name)
err := k.collectLogsFromNode(outputPath, containerName)
err := k.collectLogsFromNode(filepath.Join(outputPath, instance.Name), containerName)
if err != nil {
return err
}
Expand Down

0 comments on commit 4dfa272

Please sign in to comment.