Andrey Smirnov 2ff81c06bc
feat: update runc 1.1.12, containerd 1.7.13
Also:

* Linux 6.6.14 + XDP enablement
* etcd 3.5.12

Various other bumps for the tools, utilities, and Go modules.

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
2024-02-01 17:01:04 +04:00

45 lines
1.1 KiB
Go

// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
package docker
import (
"context"
"fmt"
"io"
"strings"
"github.com/docker/docker/api/types/container"
"github.com/siderolabs/talos/pkg/provision"
)
// CrashDump produces debug information to help with debugging failures.
func (p *provisioner) CrashDump(ctx context.Context, cluster provision.Cluster, out io.Writer) {
containers, err := p.listNodes(ctx, cluster.Info().ClusterName)
if err != nil {
fmt.Fprintf(out, "error listing containers: %s\n", err)
return
}
for _, ctr := range containers {
name := ctr.Names[0][1:]
fmt.Fprintf(out, "%s\n%s\n\n", name, strings.Repeat("=", len(name)))
logs, err := p.client.ContainerLogs(ctx, ctr.ID, container.LogsOptions{
ShowStdout: true,
ShowStderr: true,
Tail: "1000",
})
if err != nil {
fmt.Fprintf(out, "error querying container logs: %s\n", err)
continue
}
_, _ = io.Copy(out, logs) //nolint:errcheck
}
}