summaryrefslogtreecommitdiff
path: root/pkg/domain
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/domain')
-rw-r--r--pkg/domain/entities/container_ps.go5
-rw-r--r--pkg/domain/entities/engine_container.go1
-rw-r--r--pkg/domain/infra/abi/system_novalink.go14
-rw-r--r--pkg/domain/infra/abi/system_varlink.go49
-rw-r--r--pkg/domain/infra/tunnel/system.go4
5 files changed, 3 insertions, 70 deletions
diff --git a/pkg/domain/entities/container_ps.go b/pkg/domain/entities/container_ps.go
index ed40a37ab..b4e8446cb 100644
--- a/pkg/domain/entities/container_ps.go
+++ b/pkg/domain/entities/container_ps.go
@@ -3,6 +3,7 @@ package entities
import (
"sort"
"strings"
+ "time"
"github.com/containers/podman/v2/pkg/ps/define"
"github.com/cri-o/ocicni/pkg/ocicni"
@@ -14,7 +15,7 @@ type ListContainer struct {
// Container command
Command []string
// Container creation time
- Created int64
+ Created time.Time
// Human readable container creation time.
CreatedAt string
// If container has exited/stopped
@@ -137,7 +138,7 @@ func (a psSortedSize) Less(i, j int) bool {
type PsSortedCreateTime struct{ SortListContainers }
func (a PsSortedCreateTime) Less(i, j int) bool {
- return a.SortListContainers[i].Created < a.SortListContainers[j].Created
+ return a.SortListContainers[i].Created.Before(a.SortListContainers[j].Created)
}
func SortPsOutput(sortBy string, psOutput SortListContainers) (SortListContainers, error) {
diff --git a/pkg/domain/entities/engine_container.go b/pkg/domain/entities/engine_container.go
index b051d3eec..df7da616a 100644
--- a/pkg/domain/entities/engine_container.go
+++ b/pkg/domain/entities/engine_container.go
@@ -75,7 +75,6 @@ type ContainerEngine interface {
Shutdown(ctx context.Context)
SystemDf(ctx context.Context, options SystemDfOptions) (*SystemDfReport, error)
Unshare(ctx context.Context, args []string) error
- VarlinkService(ctx context.Context, opts ServiceOptions) error
Version(ctx context.Context) (*SystemVersionReport, error)
VolumeCreate(ctx context.Context, opts VolumeCreateOptions) (*IDOrNameResponse, error)
VolumeInspect(ctx context.Context, namesOrIds []string, opts InspectOptions) ([]*VolumeInspectReport, []error, error)
diff --git a/pkg/domain/infra/abi/system_novalink.go b/pkg/domain/infra/abi/system_novalink.go
deleted file mode 100644
index 3518e9db6..000000000
--- a/pkg/domain/infra/abi/system_novalink.go
+++ /dev/null
@@ -1,14 +0,0 @@
-// +build !varlink
-
-package abi
-
-import (
- "context"
-
- "github.com/containers/podman/v2/pkg/domain/entities"
- "github.com/pkg/errors"
-)
-
-func (ic *ContainerEngine) VarlinkService(_ context.Context, opts entities.ServiceOptions) error {
- return errors.Errorf("varlink is not supported")
-}
diff --git a/pkg/domain/infra/abi/system_varlink.go b/pkg/domain/infra/abi/system_varlink.go
deleted file mode 100644
index ead84fc84..000000000
--- a/pkg/domain/infra/abi/system_varlink.go
+++ /dev/null
@@ -1,49 +0,0 @@
-// +build varlink
-
-package abi
-
-import (
- "context"
-
- "github.com/containers/podman/v2/pkg/domain/entities"
- iopodman "github.com/containers/podman/v2/pkg/varlink"
- iopodmanAPI "github.com/containers/podman/v2/pkg/varlinkapi"
- "github.com/containers/podman/v2/version"
- "github.com/pkg/errors"
- "github.com/sirupsen/logrus"
- "github.com/varlink/go/varlink"
-)
-
-func (ic *ContainerEngine) VarlinkService(_ context.Context, opts entities.ServiceOptions) error {
- var varlinkInterfaces = []*iopodman.VarlinkInterface{
- iopodmanAPI.New(opts.Command, ic.Libpod),
- }
-
- service, err := varlink.NewService(
- "Atomic",
- "podman",
- version.Version.String(),
- "https://github.com/containers/podman",
- )
- if err != nil {
- return errors.Wrapf(err, "unable to create new varlink service")
- }
-
- for _, i := range varlinkInterfaces {
- if err := service.RegisterInterface(i); err != nil {
- return errors.Errorf("unable to register varlink interface %v", i)
- }
- }
-
- // Run the varlink server at the given address
- if err = service.Listen(opts.URI, opts.Timeout); err != nil {
- switch err.(type) {
- case varlink.ServiceTimeoutError:
- logrus.Infof("varlink service expired (use --time to increase session time beyond %s ms, 0 means never timeout)", opts.Timeout.String())
- return nil
- default:
- return errors.Wrapf(err, "unable to start varlink service")
- }
- }
- return nil
-}
diff --git a/pkg/domain/infra/tunnel/system.go b/pkg/domain/infra/tunnel/system.go
index c276e15c5..f3e8fbcb1 100644
--- a/pkg/domain/infra/tunnel/system.go
+++ b/pkg/domain/infra/tunnel/system.go
@@ -14,10 +14,6 @@ func (ic *ContainerEngine) Info(ctx context.Context) (*define.Info, error) {
return system.Info(ic.ClientCxt)
}
-func (ic *ContainerEngine) VarlinkService(_ context.Context, _ entities.ServiceOptions) error {
- panic(errors.New("varlink service is not supported when tunneling"))
-}
-
func (ic *ContainerEngine) SetupRootless(_ context.Context, cmd *cobra.Command) error {
panic(errors.New("rootless engine mode is not supported when tunneling"))
}