feat: add bug-report flag (#1056)
* feat: add bug-report flag * fix: use docker host CPU count * feat: add config files to bug-report Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
@@ -201,10 +201,7 @@ type containerReference struct {
|
||||
input *NewContainerInput
|
||||
}
|
||||
|
||||
func GetDockerClient(ctx context.Context) (*client.Client, error) {
|
||||
var err error
|
||||
var cli *client.Client
|
||||
|
||||
func GetDockerClient(ctx context.Context) (cli *client.Client, err error) {
|
||||
// TODO: this should maybe need to be a global option, not hidden in here?
|
||||
// though i'm not sure how that works out when there's another Executor :D
|
||||
// I really would like something that works on OSX native for eg
|
||||
@@ -232,6 +229,22 @@ func GetDockerClient(ctx context.Context) (*client.Client, error) {
|
||||
return cli, err
|
||||
}
|
||||
|
||||
func GetHostInfo(ctx context.Context) (info types.Info, err error) {
|
||||
var cli *client.Client
|
||||
cli, err = GetDockerClient(ctx)
|
||||
if err != nil {
|
||||
return info, err
|
||||
}
|
||||
defer cli.Close()
|
||||
|
||||
info, err = cli.Info(ctx)
|
||||
if err != nil {
|
||||
return info, err
|
||||
}
|
||||
|
||||
return info, nil
|
||||
}
|
||||
|
||||
func (cr *containerReference) connect() common.Executor {
|
||||
return func(ctx context.Context) error {
|
||||
if cr.cli != nil {
|
||||
|
Reference in New Issue
Block a user