Andrey Smirnov d5d3035c8c test: enable upgrade tests 0.4.x -> latest
With the fix #1904, it's now possible to upgrade 0.4.x with
`machine.File` extra files (caused by registry mirror for
registry.ci.svc).

Bump resources for upgrade tests in attempt to speed it up.

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2020-02-26 00:09:32 +03:00

43 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"
"github.com/talos-systems/talos/internal/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 _, container := range containers {
name := container.Names[0][:1]
fmt.Fprintf(out, "%s\n%s\n\n", name, strings.Repeat("=", len(name)))
logs, err := p.client.ContainerLogs(ctx, container.ID, types.ContainerLogsOptions{
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
}
}