summaryrefslogtreecommitdiff
path: root/pkg/domain/infra/abi/containers_stat.go
blob: 98a23c70b6d3be1b971e3831dd089e9a7f62f483 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package abi

import (
	"context"

	"github.com/containers/podman/v3/pkg/domain/entities"
)

func (ic *ContainerEngine) ContainerStat(ctx context.Context, nameOrID string, containerPath string) (*entities.ContainerStatReport, error) {
	container, err := ic.Libpod.LookupContainer(nameOrID)
	if err != nil {
		return nil, err
	}

	info, err := container.Stat(ctx, containerPath)

	if info != nil {
		return &entities.ContainerStatReport{FileInfo: *info}, err
	}
	return nil, err
}