github.com/hanks177/podman/v4@v4.1.3-0.20220613032544-16d90015bc83/pkg/domain/infra/tunnel/system.go (about)

     1  package tunnel
     2  
     3  import (
     4  	"context"
     5  	"errors"
     6  
     7  	"github.com/hanks177/podman/v4/libpod/define"
     8  	"github.com/hanks177/podman/v4/pkg/bindings/system"
     9  	"github.com/hanks177/podman/v4/pkg/domain/entities"
    10  )
    11  
    12  func (ic *ContainerEngine) Info(ctx context.Context) (*define.Info, error) {
    13  	return system.Info(ic.ClientCtx, nil)
    14  }
    15  
    16  func (ic *ContainerEngine) SetupRootless(_ context.Context, noMoveProcess bool) error {
    17  	panic(errors.New("rootless engine mode is not supported when tunneling"))
    18  }
    19  
    20  // SystemPrune prunes unused data from the system.
    21  func (ic *ContainerEngine) SystemPrune(ctx context.Context, opts entities.SystemPruneOptions) (*entities.SystemPruneReport, error) {
    22  	options := new(system.PruneOptions).WithAll(opts.All).WithVolumes(opts.Volume).WithFilters(opts.Filters)
    23  	return system.Prune(ic.ClientCtx, options)
    24  }
    25  
    26  func (ic *ContainerEngine) SystemDf(ctx context.Context, options entities.SystemDfOptions) (*entities.SystemDfReport, error) {
    27  	return system.DiskUsage(ic.ClientCtx, nil)
    28  }
    29  
    30  func (ic *ContainerEngine) Unshare(ctx context.Context, args []string, options entities.SystemUnshareOptions) error {
    31  	return errors.New("unshare is not supported on remote clients")
    32  }
    33  
    34  func (ic ContainerEngine) Version(ctx context.Context) (*entities.SystemVersionReport, error) {
    35  	return system.Version(ic.ClientCtx, nil)
    36  }