summaryrefslogtreecommitdiff
path: root/pkg/domain
diff options
context:
space:
mode:
authorSujil02 <sushah@redhat.com>2020-05-05 22:29:54 -0400
committerSujil02 <sushah@redhat.com>2020-05-11 17:03:32 -0400
commit1c6ae73a898222a14b98526339d9985c51f88d35 (patch)
tree0abf9eebf0625817cf92b77e03348543402d96b3 /pkg/domain
parentdc7d6f4818f4b986cfd15208d53f6765d8fad986 (diff)
downloadpodman-1c6ae73a898222a14b98526339d9985c51f88d35.tar.gz
podman-1c6ae73a898222a14b98526339d9985c51f88d35.tar.bz2
podman-1c6ae73a898222a14b98526339d9985c51f88d35.zip
Adds tunnel routes for system reset.
Adds tunnel routes for system reset. Makes forces flag local as options are not propogated down the stack. Adds relevant test cases and swagger docs. Signed-off-by: Sujil02 <sushah@redhat.com>
Diffstat (limited to 'pkg/domain')
-rw-r--r--pkg/domain/entities/engine_system.go2
-rw-r--r--pkg/domain/infra/abi/system.go2
-rw-r--r--pkg/domain/infra/tunnel/runtime.go5
-rw-r--r--pkg/domain/infra/tunnel/system.go5
4 files changed, 12 insertions, 2 deletions
diff --git a/pkg/domain/entities/engine_system.go b/pkg/domain/entities/engine_system.go
index e2000f5cb..a0ecfe9ea 100644
--- a/pkg/domain/entities/engine_system.go
+++ b/pkg/domain/entities/engine_system.go
@@ -9,6 +9,6 @@ import (
type SystemEngine interface {
Renumber(ctx context.Context, flags *pflag.FlagSet, config *PodmanConfig) error
Migrate(ctx context.Context, flags *pflag.FlagSet, config *PodmanConfig, options SystemMigrateOptions) error
- Reset(ctx context.Context, options SystemResetOptions) error
+ Reset(ctx context.Context) error
Shutdown(ctx context.Context)
}
diff --git a/pkg/domain/infra/abi/system.go b/pkg/domain/infra/abi/system.go
index d701d65de..af2ec5f7b 100644
--- a/pkg/domain/infra/abi/system.go
+++ b/pkg/domain/infra/abi/system.go
@@ -375,7 +375,7 @@ func sizeOfPath(path string) (int64, error) {
return size, err
}
-func (se *SystemEngine) Reset(ctx context.Context, options entities.SystemResetOptions) error {
+func (se *SystemEngine) Reset(ctx context.Context) error {
return se.Libpod.Reset(ctx)
}
diff --git a/pkg/domain/infra/tunnel/runtime.go b/pkg/domain/infra/tunnel/runtime.go
index c111f99e9..357e2c390 100644
--- a/pkg/domain/infra/tunnel/runtime.go
+++ b/pkg/domain/infra/tunnel/runtime.go
@@ -13,3 +13,8 @@ type ImageEngine struct {
type ContainerEngine struct {
ClientCxt context.Context
}
+
+// Container-related runtime using an ssh-tunnel to utilize Podman service
+type SystemEngine struct {
+ ClientCxt context.Context
+}
diff --git a/pkg/domain/infra/tunnel/system.go b/pkg/domain/infra/tunnel/system.go
index dafada805..b1be28e04 100644
--- a/pkg/domain/infra/tunnel/system.go
+++ b/pkg/domain/infra/tunnel/system.go
@@ -27,6 +27,11 @@ func (ic *ContainerEngine) SystemPrune(ctx context.Context, options entities.Sys
return system.Prune(ic.ClientCxt, &options.All, &options.Volume)
}
+// Reset removes all storage
+func (ic *SystemEngine) Reset(ctx context.Context) error {
+ return system.Reset(ic.ClientCxt)
+}
+
func (ic *ContainerEngine) SystemDf(ctx context.Context, options entities.SystemDfOptions) (*entities.SystemDfReport, error) {
panic(errors.New("system df is not supported on remote clients"))
}