diff options
-rw-r--r-- | docs/source/markdown/podman.1.md | 2 | ||||
-rw-r--r-- | pkg/api/handlers/swagger/swagger.go | 18 | ||||
-rw-r--r-- | pkg/api/handlers/types.go | 9 | ||||
-rw-r--r-- | pkg/api/server/register_images.go | 2 | ||||
-rw-r--r-- | pkg/domain/infra/abi/containers.go | 2 | ||||
-rw-r--r-- | pkg/domain/infra/runtime_libpod.go | 1 | ||||
-rw-r--r-- | pkg/domain/infra/tunnel/containers.go | 13 | ||||
-rw-r--r-- | test/apiv2/python/rest_api/test_v2_0_0_image.py | 6 | ||||
-rwxr-xr-x | test/compose/test-compose | 6 | ||||
-rw-r--r-- | test/system/005-info.bats | 8 | ||||
-rw-r--r-- | test/system/010-images.bats | 2 | ||||
-rw-r--r-- | test/system/150-login.bats | 6 | ||||
-rw-r--r-- | test/system/330-corrupt-images.bats | 2 |
13 files changed, 45 insertions, 32 deletions
diff --git a/docs/source/markdown/podman.1.md b/docs/source/markdown/podman.1.md index ab4be1307..734d00971 100644 --- a/docs/source/markdown/podman.1.md +++ b/docs/source/markdown/podman.1.md @@ -120,6 +120,8 @@ Remote connections use local containers.conf for default. Storage root dir in which data, including images, is stored (default: "/var/lib/containers/storage" for UID 0, "$HOME/.local/share/containers/storage" for other users). Default root dir configured in `/etc/containers/storage.conf`. +Overriding this option will cause the *storage-opt* settings in /etc/containers/storage.conf to be ignored. The user must specify additional options via the `--storage-opt` flag. + #### **--runroot**=*value* Storage state directory where all state information is stored (default: "/run/containers/storage" for UID 0, "/run/user/$UID/run" for other users). diff --git a/pkg/api/handlers/swagger/swagger.go b/pkg/api/handlers/swagger/swagger.go index ef3d12df8..83ff5914e 100644 --- a/pkg/api/handlers/swagger/swagger.go +++ b/pkg/api/handlers/swagger/swagger.go @@ -8,6 +8,15 @@ import ( "github.com/docker/docker/api/types" ) +// Tree response +// swagger:response TreeResponse +type swagTree struct { + // in:body + Body struct { + entities.ImageTreeReport + } +} + // History response // swagger:response DocsHistory type swagHistory struct { @@ -183,12 +192,3 @@ type swagInspectVolumeResponse struct { define.InspectVolumeData } } - -// Image tree response -// swagger:response LibpodImageTreeResponse -type swagImageTreeResponse struct { - // in:body - Body struct { - handlers.ImageTreeResponse - } -} diff --git a/pkg/api/handlers/types.go b/pkg/api/handlers/types.go index 2ffd9b0cb..f94c9a1f5 100644 --- a/pkg/api/handlers/types.go +++ b/pkg/api/handlers/types.go @@ -148,15 +148,6 @@ type HistoryResponse struct { Comment string } -type ImageLayer struct{} - -type ImageTreeResponse struct { - ID string `json:"id"` - Tags []string `json:"tags"` - Size string `json:"size"` - Layers []ImageLayer `json:"layers"` -} - type ExecCreateConfig struct { docker.ExecConfig } diff --git a/pkg/api/server/register_images.go b/pkg/api/server/register_images.go index b32c0df20..9634bd83b 100644 --- a/pkg/api/server/register_images.go +++ b/pkg/api/server/register_images.go @@ -747,7 +747,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error { // - application/json // responses: // 200: - // $ref: '#/responses/LibpodImageTreeResponse' + // $ref: "#/responses/TreeResponse" // 404: // $ref: '#/responses/NoSuchImage' // 500: diff --git a/pkg/domain/infra/abi/containers.go b/pkg/domain/infra/abi/containers.go index d0a2b1bae..237a43441 100644 --- a/pkg/domain/infra/abi/containers.go +++ b/pkg/domain/infra/abi/containers.go @@ -275,7 +275,7 @@ func (ic *ContainerEngine) ContainerRm(ctx context.Context, namesOrIds []string, case nil: // remove container names that we successfully deleted reports = append(reports, &report) - case define.ErrNoSuchCtr: + case define.ErrNoSuchCtr, define.ErrCtrExists: // There is still a potential this is a libpod container tmpNames = append(tmpNames, ctr) default: diff --git a/pkg/domain/infra/runtime_libpod.go b/pkg/domain/infra/runtime_libpod.go index a98c9168a..5cbee2e76 100644 --- a/pkg/domain/infra/runtime_libpod.go +++ b/pkg/domain/infra/runtime_libpod.go @@ -129,6 +129,7 @@ func getRuntime(ctx context.Context, fs *flag.FlagSet, opts *engineOpts) (*libpo if fs.Changed("root") { storageSet = true storageOpts.GraphRoot = cfg.Engine.StaticDir + storageOpts.GraphDriverOptions = []string{} } if fs.Changed("runroot") { storageSet = true diff --git a/pkg/domain/infra/tunnel/containers.go b/pkg/domain/infra/tunnel/containers.go index 3830835cc..74ced300a 100644 --- a/pkg/domain/infra/tunnel/containers.go +++ b/pkg/domain/infra/tunnel/containers.go @@ -21,6 +21,7 @@ import ( "github.com/containers/podman/v3/pkg/errorhandling" "github.com/containers/podman/v3/pkg/specgen" "github.com/containers/podman/v3/pkg/util" + "github.com/containers/storage/types" "github.com/pkg/errors" "github.com/sirupsen/logrus" ) @@ -580,7 +581,7 @@ func (ic *ContainerEngine) ContainerStart(ctx context.Context, namesOrIds []stri if err := containers.Remove(ic.ClientCtx, ctr.ID, removeOptions); err != nil { if errorhandling.Contains(err, define.ErrNoSuchCtr) || errorhandling.Contains(err, define.ErrCtrRemoved) { - logrus.Warnf("Container %s does not exist: %v", ctr.ID, err) + logrus.Debugf("Container %s does not exist: %v", ctr.ID, err) } else { logrus.Errorf("Error removing container %s: %v", ctr.ID, err) } @@ -613,8 +614,9 @@ func (ic *ContainerEngine) ContainerStart(ctx context.Context, namesOrIds []stri rmOptions := new(containers.RemoveOptions).WithForce(false).WithVolumes(true) if err := containers.Remove(ic.ClientCtx, ctr.ID, rmOptions); err != nil { if errorhandling.Contains(err, define.ErrNoSuchCtr) || - errorhandling.Contains(err, define.ErrCtrRemoved) { - logrus.Warnf("Container %s does not exist: %v", ctr.ID, err) + errorhandling.Contains(err, define.ErrCtrRemoved) || + errorhandling.Contains(err, types.ErrLayerUnknown) { + logrus.Debugf("Container %s does not exist: %v", ctr.ID, err) } else { logrus.Errorf("Error removing container %s: %v", ctr.ID, err) } @@ -691,8 +693,9 @@ func (ic *ContainerEngine) ContainerRun(ctx context.Context, opts entities.Conta if !shouldRestart { if err := containers.Remove(ic.ClientCtx, con.ID, new(containers.RemoveOptions).WithForce(false).WithVolumes(true)); err != nil { if errorhandling.Contains(err, define.ErrNoSuchCtr) || - errorhandling.Contains(err, define.ErrCtrRemoved) { - logrus.Warnf("Container %s does not exist: %v", con.ID, err) + errorhandling.Contains(err, define.ErrCtrRemoved) || + errorhandling.Contains(err, types.ErrLayerUnknown) { + logrus.Debugf("Container %s does not exist: %v", con.ID, err) } else { logrus.Errorf("Error removing container %s: %v", con.ID, err) } diff --git a/test/apiv2/python/rest_api/test_v2_0_0_image.py b/test/apiv2/python/rest_api/test_v2_0_0_image.py index 99f513608..243b1d5f5 100644 --- a/test/apiv2/python/rest_api/test_v2_0_0_image.py +++ b/test/apiv2/python/rest_api/test_v2_0_0_image.py @@ -160,6 +160,12 @@ class ImageTestCase(APITestCase): for k in required_keys: self.assertIn(k, change) + def test_tree(self): + r = requests.get(self.uri("/images/alpine/tree")) + self.assertEqual(r.status_code, 200, r.text) + tree = r.json() + self.assertTrue(tree["Tree"].startswith("Image ID:"), r.text) + if __name__ == "__main__": unittest.main() diff --git a/test/compose/test-compose b/test/compose/test-compose index 46ca80321..981f78a79 100755 --- a/test/compose/test-compose +++ b/test/compose/test-compose @@ -174,12 +174,12 @@ function test_port() { if [ $curl_rc -ne 0 ]; then _show_ok 0 "$testname - curl (port $port) failed with status $curl_rc" echo "# podman ps -a:" - $PODMAN_BIN --root $WORKDIR/root --runroot $WORKDIR/runroot ps -a + $PODMAN_BIN --storage-driver=vfs --root $WORKDIR/root --runroot $WORKDIR/runroot ps -a if type -p ss; then echo "# ss -tulpn:" ss -tulpn echo "# podman unshare --rootless-cni ss -tulpn:" - $PODMAN_BIN --root $WORKDIR/root --runroot $WORKDIR/runroot unshare --rootless-cni ss -tulpn + $PODMAN_BIN --storage-driver=vfs --root $WORKDIR/root --runroot $WORKDIR/runroot unshare --rootless-cni ss -tulpn fi echo "# cat $WORKDIR/server.log:" cat $WORKDIR/server.log @@ -214,6 +214,7 @@ function start_service() { $PODMAN_BIN \ --log-level debug \ + --storage-driver=vfs \ --root $WORKDIR/root \ --runroot $WORKDIR/runroot \ --cgroup-manager=systemd \ @@ -241,6 +242,7 @@ function start_service() { function podman() { echo "\$ podman $*" >>$WORKDIR/output.log output=$($PODMAN_BIN \ + --storage-driver=vfs \ --root $WORKDIR/root \ --runroot $WORKDIR/runroot \ "$@") diff --git a/test/system/005-info.bats b/test/system/005-info.bats index 83d79221a..4b419841e 100644 --- a/test/system/005-info.bats +++ b/test/system/005-info.bats @@ -82,4 +82,12 @@ store.imageStore.number | 1 # mounts. is "$output" ".*graphOptions: {}" "output includes graphOptions: {}" } + +@test "podman --root PATH info - basic output" { + if ! is_remote; then + run_podman --storage-driver=vfs --root ${PODMAN_TMPDIR}/nothing-here-move-along info --format '{{ .Store.GraphOptions }}' + is "$output" "map\[\]" "'podman --root should reset Graphoptions to []" + fi +} + # vim: filetype=sh diff --git a/test/system/010-images.bats b/test/system/010-images.bats index bda331e6b..2d7ac1e0c 100644 --- a/test/system/010-images.bats +++ b/test/system/010-images.bats @@ -12,7 +12,7 @@ load helpers # 'podman images' should emit headings even if there are no images # (but --root only works locally) if ! is_remote; then - run_podman --root ${PODMAN_TMPDIR}/nothing-here-move-along images + run_podman --storage-driver=vfs --root ${PODMAN_TMPDIR}/nothing-here-move-along images is "$output" "$headings" "'podman images' emits headings even w/o images" fi } diff --git a/test/system/150-login.bats b/test/system/150-login.bats index c3af63348..b6c04db08 100644 --- a/test/system/150-login.bats +++ b/test/system/150-login.bats @@ -62,7 +62,7 @@ function setup() { # Pull registry image, but into a separate container storage mkdir -p ${PODMAN_LOGIN_WORKDIR}/root mkdir -p ${PODMAN_LOGIN_WORKDIR}/runroot - PODMAN_LOGIN_ARGS="--root ${PODMAN_LOGIN_WORKDIR}/root --runroot ${PODMAN_LOGIN_WORKDIR}/runroot" + PODMAN_LOGIN_ARGS="--storage-driver=vfs --root ${PODMAN_LOGIN_WORKDIR}/root --runroot ${PODMAN_LOGIN_WORKDIR}/runroot" # Give it three tries, to compensate for flakes run_podman ${PODMAN_LOGIN_ARGS} pull $REGISTRY_IMAGE || run_podman ${PODMAN_LOGIN_ARGS} pull $REGISTRY_IMAGE || @@ -306,10 +306,10 @@ function _test_skopeo_credential_sharing() { skip "[leaving registry running by request]" fi - run_podman --root ${PODMAN_LOGIN_WORKDIR}/root \ + run_podman --storage-driver=vfs --root ${PODMAN_LOGIN_WORKDIR}/root \ --runroot ${PODMAN_LOGIN_WORKDIR}/runroot \ rm -f registry - run_podman --root ${PODMAN_LOGIN_WORKDIR}/root \ + run_podman --storage-driver=vfs --root ${PODMAN_LOGIN_WORKDIR}/root \ --runroot ${PODMAN_LOGIN_WORKDIR}/runroot \ rmi -a diff --git a/test/system/330-corrupt-images.bats b/test/system/330-corrupt-images.bats index c51cc8d46..2ee5eee9c 100644 --- a/test/system/330-corrupt-images.bats +++ b/test/system/330-corrupt-images.bats @@ -19,7 +19,7 @@ PODMAN_CORRUPT_TEST_IMAGE_ID=961769676411f082461f9ef46626dd7a2d1e2b2a38e6a44364b # All tests in this file (and ONLY in this file) run with a custom rootdir function setup() { skip_if_remote "none of these tests run under podman-remote" - _PODMAN_TEST_OPTS="--root ${PODMAN_CORRUPT_TEST_WORKDIR}/root" + _PODMAN_TEST_OPTS="--storage-driver=vfs --root ${PODMAN_CORRUPT_TEST_WORKDIR}/root" } function teardown() { |