summaryrefslogtreecommitdiff
path: root/pkg/domain/entities
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-03-20 22:22:20 +0100
committerGitHub <noreply@github.com>2020-03-20 22:22:20 +0100
commit7a095af92a6a39845b1c362222b23632f3e17001 (patch)
tree52a8692894690a8f09e025f90d6d2b5045259e4f /pkg/domain/entities
parent6df1d2043bd3cd2252ea3d737cf542e332106074 (diff)
parentc81e065149da73ae904aa19ee46a23d1ab8ce55c (diff)
downloadpodman-7a095af92a6a39845b1c362222b23632f3e17001.tar.gz
podman-7a095af92a6a39845b1c362222b23632f3e17001.tar.bz2
podman-7a095af92a6a39845b1c362222b23632f3e17001.zip
Merge pull request #5571 from baude/v2exists
podmanv2 container exists|wait
Diffstat (limited to 'pkg/domain/entities')
-rw-r--r--pkg/domain/entities/containers.go22
-rw-r--r--pkg/domain/entities/engine.go9
-rw-r--r--pkg/domain/entities/engine_container.go14
3 files changed, 28 insertions, 17 deletions
diff --git a/pkg/domain/entities/containers.go b/pkg/domain/entities/containers.go
index 1899b98f7..0e1208b3b 100644
--- a/pkg/domain/entities/containers.go
+++ b/pkg/domain/entities/containers.go
@@ -1 +1,23 @@
package entities
+
+import (
+ "time"
+
+ "github.com/containers/libpod/libpod/define"
+)
+
+type WaitOptions struct {
+ Condition define.ContainerStatus
+ Interval time.Duration
+ Latest bool
+}
+
+type WaitReport struct {
+ Id string
+ Error error
+ ExitCode int32
+}
+
+type BoolReport struct {
+ Value bool
+}
diff --git a/pkg/domain/entities/engine.go b/pkg/domain/entities/engine.go
index a1096f1f1..08ef1df92 100644
--- a/pkg/domain/entities/engine.go
+++ b/pkg/domain/entities/engine.go
@@ -1,7 +1,6 @@
package entities
import (
- "net/url"
"os/user"
"path/filepath"
@@ -20,11 +19,13 @@ func (m EngineMode) String() string {
return string(m)
}
+// FIXME: merge EngineOptions and EngineFlags
type EngineOptions struct {
- Uri *url.URL
+ Uri string
Identities []string
- FlagSet pflag.FlagSet
+ FlagSet *pflag.FlagSet
Flags EngineFlags
+ EngineMode EngineMode
}
type EngineFlags struct {
@@ -58,8 +59,6 @@ type EngineFlags struct {
Port int
IdentityFile string
IgnoreHosts bool
-
- EngineMode EngineMode
}
func NewEngineOptions() (EngineFlags, error) {
diff --git a/pkg/domain/entities/engine_container.go b/pkg/domain/entities/engine_container.go
index d08f37d44..aa2ceb630 100644
--- a/pkg/domain/entities/engine_container.go
+++ b/pkg/domain/entities/engine_container.go
@@ -5,22 +5,12 @@ import (
)
type ContainerEngine interface {
- ContainerRuntime
- PodRuntime
- VolumeRuntime
-}
-
-type ContainerRuntime interface {
ContainerDelete(ctx context.Context, opts ContainerDeleteOptions) (*ContainerDeleteReport, error)
ContainerPrune(ctx context.Context) (*ContainerPruneReport, error)
-}
-
-type PodRuntime interface {
+ ContainerExists(ctx context.Context, nameOrId string) (*BoolReport, error)
+ ContainerWait(ctx context.Context, namesOrIds []string, options WaitOptions) ([]WaitReport, error)
PodDelete(ctx context.Context, opts PodPruneOptions) (*PodDeleteReport, error)
PodPrune(ctx context.Context) (*PodPruneReport, error)
-}
-
-type VolumeRuntime interface {
VolumeDelete(ctx context.Context, opts VolumeDeleteOptions) (*VolumeDeleteReport, error)
VolumePrune(ctx context.Context) (*VolumePruneReport, error)
}