Commit graph

10566 commits

Author SHA1 Message Date
Valentin Rothberg caaaa2c5e1 hack/install_golangci.sh: smarter install
Detect if the installed version of golangci-lint is outdated and update
it if needed.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-01-17 17:15:23 +01:00
Valentin Rothberg f38b7f48cc golangci-lint: install to ./bin
Install golangci-lint to `./bin` instead of `$GOBIN`.  The latter may be
shared with other projects who require a different version.  Having a
shared version of golangci-lint is a reoccurring source of red herrings
on my work station, so I think it's time to split them.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-01-17 17:07:04 +01:00
OpenShift Merge Robot 341c4b1fd9
Merge pull request #8942 from rhatdan/push
Allow podman push to push manifest lists
2021-01-17 06:52:35 -05:00
OpenShift Merge Robot 73b036db56
Merge pull request #8988 from Luap99/rename-port-completion-func
[CI:DOCS] Rename AutocompletePortCommand func
2021-01-16 18:17:38 -05:00
Paul Holzinger 47eeb02c7a Rename AutocompletePortCommand func
This function is now used for the port and rename command.
Rename it to AutocompleteContainerOneArg.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-01-16 18:54:59 +01:00
OpenShift Merge Robot 83ed464d29
Merge pull request #8986 from baude/bindingreadme
[CI:DOCS]Add README.md for golang bindings
2021-01-15 13:58:27 -05:00
OpenShift Merge Robot f43f209ca4
Merge pull request #8456 from kazimsarikaya/fix-send-tar
podman remote send tar
2021-01-15 13:49:27 -05:00
OpenShift Merge Robot 53ecda2981
Merge pull request #8949 from giuseppe/sysfs-for-rootless
specgen: improve heuristic for /sys bind mount
2021-01-15 13:38:30 -05:00
Daniel J Walsh cf51c7ed9f
Allow podman push to push manifest lists
When doing a podman images, manifests lists look just like images, so
it is logical that users would assume that they can just podman push them
to a registry.  The problem is we throw out weird errors when this happens
and users need to somehow figure out this is a manifest list rather then
an image, and frankly the user will not understand the difference.

This PR will make podman push just do the right thing, by failing over and
attempting to push the manifest if it fails to push the image.

Fix up handling of manifest push

Protocol should bring back a digest string, which can either be
printed or stored in a file.

We should not reimplement the manifest push setup code in the tunnel
code but take advantage of the api path, to make sure remote and local
work the same way.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-01-15 13:24:34 -05:00
baude f59c29a6d7 [CI:DOCS]Add README.md for golang bindings
Add a brief description of the golang bindings and provide examples on
how to use them

Signed-off-by: baude <bbaude@redhat.com>
2021-01-15 10:49:40 -06:00
OpenShift Merge Robot 0400dc0a00
Merge pull request #8983 from rhatdan/test
Turn on podman pod stats test for rootless cgroup v2
2021-01-15 11:47:48 -05:00
OpenShift Merge Robot 7d3a628c6b
Merge pull request #8982 from Luap99/container-rename-bindings
Container rename bindings
2021-01-15 10:48:27 -05:00
Daniel J Walsh 7a30e82220
Turn on podman pod stats test for rootless cgroup v2
These tests should only be blocked for cgroups V1

Fixes: https://github.com/containers/podman/issues/8734
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-01-15 09:24:28 -05:00
OpenShift Merge Robot 5a166b2973
Merge pull request #8978 from rhatdan/buildah
Bump to containers/buildah 1.9.2
2021-01-15 09:23:57 -05:00
OpenShift Merge Robot 3ceef004e3
Merge pull request #8981 from containers/dependabot/go_modules/github.com/google/uuid-1.1.5
Bump github.com/google/uuid from 1.1.4 to 1.1.5
2021-01-15 08:43:27 -05:00
OpenShift Merge Robot 82462aca7f
Merge pull request #8977 from cevich/get_ci_hook_docs
[CI:DOCS] Add hook-script example to get_ci_vm.sh
2021-01-15 08:34:45 -05:00
Paul Holzinger 0688f080b8 Fix missing podman-container-rename man page link
Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-01-15 12:57:33 +01:00
Paul Holzinger c9bd292b32 Container rename bindings
Add bindings and podman-remote support for container rename.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-01-15 12:57:22 +01:00
Daniel J Walsh c88022589a
Bump to containers/buildah 1.9.2
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-01-15 06:23:19 -05:00
dependabot-preview[bot] 3ac930f002 Bump github.com/google/uuid from 1.1.4 to 1.1.5
Bumps [github.com/google/uuid](https://github.com/google/uuid) from 1.1.4 to 1.1.5.
- [Release notes](https://github.com/google/uuid/releases)
- [Commits](https://github.com/google/uuid/compare/v1.1.4...v1.1.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-01-15 12:18:46 +01:00
Giuseppe Scrivano 2c328a4ac1
specgen: improve heuristic for /sys bind mount
partially revert 95c45773d7

restrict the cases where /sys is bind mounted from the host.

The heuristic doesn't detect all the cases where the bind mount is not
necessary, but it is an improvement on the previous version where /sys
was always bind mounted for rootless containers unless --net none was
specified.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-01-15 09:10:55 +01:00
OpenShift Merge Robot 3fcf346890
Merge pull request #8955 from mheon/rename
Container Rename
2021-01-14 22:03:01 -05:00
OpenShift Merge Robot 8ce9995951
Merge pull request #8604 from mheon/volume_plugin_impl
Initial implementation of volume plugins
2021-01-14 21:56:37 -05:00
Matthew Heon 997de2f8e9 Initial implementation of renaming containers
Basic theory: We remove the container, but *only from the DB*.
We leave it in c/storage, we leave the lock allocated, we leave
it running (if it is). Then we create an identical container with
an altered name, and add that back to the database. Theoretically
we now have a renamed container.

The advantage of this approach is that it doesn't just apply to
rename - we can use this to make *any* configuration change to a
container that does not alter its container ID.

Potential problems are numerous. This process is *THOROUGHLY*
non-atomic at present - if you `kill -9` Podman mid-rename things
will be in a bad place, for example. Also, we can't rename
containers that can't be removed normally - IE, containers with
dependencies (pod infra containers, for example).

The largest potential improvement will be to move the majority of
the work into the DB, with a `RecreateContainer()` method - that
will add atomicity, and let us remove the container without
worrying about depencies and similar issues.

Potential problems: long-running processes that edit the DB and
may have an older version of the configuration around. Most
notable example is `podman run --rm` - the removal command needed
to be manually edited to avoid this one. This begins to get at
the heart of me not wanting to do this in the first place...

This provides CLI and API implementations for frontend, but no
tunnel implementation. It will be added in a future release (just
held back for time now - we need this in 3.0 and are running low
on time).

This is honestly kind of horrifying, but I think it will work.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-01-14 18:29:28 -05:00
Matthew Heon f781efd2dc Add tests for volume plugins
This involves a new test binary (a basic implementation of the
volume plugin protocol) and a new image on quay.io (Containerfile
to produce it and all sources located in this commit). The image
is used to run a containerized plugin we can test against.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-01-14 16:43:23 -05:00
Matthew Heon b53cb57680 Initial implementation of volume plugins
This implements support for mounting and unmounting volumes
backed by volume plugins. Support for actually retrieving
plugins requires a pull request to land in containers.conf and
then that to be vendored, and as such is not yet ready. Given
this, this code is only compile tested. However, the code for
everything past retrieving the plugin has been written - there is
support for creating, removing, mounting, and unmounting volumes,
which should allow full functionality once the c/common PR is
merged.

A major change is the signature of the MountPoint function for
volumes, which now, by necessity, returns an error. Named volumes
managed by a plugin do not have a mountpoint we control; instead,
it is managed entirely by the plugin. As such, we need to cache
the path in the DB, and calls to retrieve it now need to access
the DB (and may fail as such).

Notably absent is support for SELinux relabelling and chowning
these volumes. Given that we don't manage the mountpoint for
these volumes, I am extremely reluctant to try and modify it - we
could easily break the plugin trying to chown or relabel it.

Also, we had no less than *5* separate implementations of
inspecting a volume floating around in pkg/infra/abi and
pkg/api/handlers/libpod. And none of them used volume.Inspect(),
the only correct way of inspecting volumes. Remove them all and
consolidate to using the correct way. Compat API is likely still
doing things the wrong way, but that is an issue for another day.

Fixes #4304

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2021-01-14 15:35:33 -05:00
Chris Evich ec309504c4
[CI:DOCS] Add hook-script example to get_ci_vm.sh
Signed-off-by: Chris Evich <cevich@redhat.com>
2021-01-14 14:26:36 -05:00
OpenShift Merge Robot 2b7793b612
Merge pull request #8956 from rhatdan/Makefile
Makefile: add target to generate bindings
2021-01-14 14:00:04 -05:00
OpenShift Merge Robot a1b49749af
Merge pull request #8906 from vrothberg/fix-8501
container stop: release lock before calling the runtime
2021-01-14 13:37:16 -05:00
OpenShift Merge Robot e0211a14fc
Merge pull request #8974 from Luap99/vendor-ocicni
Bump github.com/cri-o/ocicni to latest master
2021-01-14 13:13:52 -05:00
Valentin Rothberg d498ef53aa
Makefile: add target to generate bindings
Add a `.generate-bindings` make target that only runs in the absence of
the `.generate-bindings` file or when a `types.go` file below
`pkg/bindings` has changed.

This will regenerate the go bindings and make sure the code is up2date.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-01-14 11:54:57 -05:00
Valentin Rothberg d54478d8ea container stop: release lock before calling the runtime
Podman defers stopping the container to the runtime, which can take some
time.  Keeping the lock while waiting for the runtime to complete the
stop procedure, prevents other commands from acquiring the lock as shown
in #8501.

To improve the user experience, release the lock before invoking the
runtime, and re-acquire the lock when the runtime is finished.  Also
introduce an intermediate "stopping" to properly distinguish from
"stopped" containers etc.

Fixes: #8501
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-01-14 17:45:30 +01:00
Paul Holzinger ad9bb80a24 Bump github.com/cri-o/ocicni to latest master
The changes from https://github.com/cri-o/ocicni/pull/83 are needed
to improve the user experience when using the new network reload command.

see: https://github.com/containers/podman/pull/8571#discussion_r535167473

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-01-14 16:52:52 +01:00
Matthew Heon a944f906b8
Merge pull request #8973 from cevich/no_check_mirror
[CI:DOCS] Cirrus: Upd. ext. service check host list
2021-01-14 10:34:00 -05:00
Chris Evich 7490402fab
Cirrus: Upd. ext. service check host list
Since CI doesn't depend heavily on installing packages at runtime
(there is some minor use) there's no need to exhaustively check
repository mirror hosts.  Remove them from the list.

Signed-off-by: Chris Evich <cevich@redhat.com>
2021-01-14 09:40:01 -05:00
OpenShift Merge Robot 9f50d486f3
Merge pull request #8969 from containers/dependabot/go_modules/github.com/stretchr/testify-1.7.0
Bump github.com/stretchr/testify from 1.6.1 to 1.7.0
2021-01-14 06:38:41 -05:00
OpenShift Merge Robot 982b7c696e
Merge pull request #8968 from containers/dependabot/go_modules/k8s.io/apimachinery-0.20.2
Bump k8s.io/apimachinery from 0.20.1 to 0.20.2
2021-01-14 06:31:38 -05:00
OpenShift Merge Robot 4e4477cae6
Merge pull request #8967 from cevich/install_tools_for_alt_build
Ensure install.tools for alt build task
2021-01-14 04:35:32 -05:00
dependabot-preview[bot] 18c190003a
Bump k8s.io/apimachinery from 0.20.1 to 0.20.2
Bumps [k8s.io/apimachinery](https://github.com/kubernetes/apimachinery) from 0.20.1 to 0.20.2.
- [Release notes](https://github.com/kubernetes/apimachinery/releases)
- [Commits](https://github.com/kubernetes/apimachinery/compare/v0.20.1...v0.20.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-01-14 04:22:50 -05:00
dependabot-preview[bot] 905a9c3ff8
Bump github.com/stretchr/testify from 1.6.1 to 1.7.0
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.6.1 to 1.7.0.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.6.1...v1.7.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-01-14 04:22:05 -05:00
OpenShift Merge Robot b2ac2a3f10
Merge pull request #8962 from rhatdan/man
[CI:DOCS] Add more information and examples on podman and pipes
2021-01-13 16:22:45 -05:00
OpenShift Merge Robot e273ba34ef
Merge pull request #8966 from ashley-cui/common33
Vendor in common 0.33.1
2021-01-13 16:01:25 -05:00
Chris Evich 1231665e54
Cirrus: Utilize $GOPATH cache for alt_build task
Specifically, the result of 'make install.tools' is needed.  Part of
that target installs tooling into `$GOPATH/bin`.  A future commit
requires this tooling for the `Build Each Commit` item of the
alt_build matrix.  Re-use the cache of this directory for this
task to ensure the necessary tooling/libraries are available.

Signed-off-by: Chris Evich <cevich@redhat.com>
2021-01-13 15:34:58 -05:00
Daniel J Walsh a7c0c9125f
Add more information and examples on podman and pipes
Improve the documentation to help users to know proper way to
use podman within a pipe.

Helps Prevent: https://github.com/containers/podman/issues/8916

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-01-13 15:08:46 -05:00
OpenShift Merge Robot bbff9c8710
Merge pull request #8960 from giuseppe/bridge-no-post-config
network: disallow CNI networks with user namespaces
2021-01-13 14:28:20 -05:00
OpenShift Merge Robot b2b14235aa
Merge pull request #8951 from edsantiago/fix_dev_diagnostic
CI: fix broken diagnostic message for -dev check
2021-01-13 14:18:17 -05:00
OpenShift Merge Robot 2b0cf7728d
Merge pull request #8954 from baude/reducebindingsize
Reduce general binding binary size
2021-01-13 13:29:24 -05:00
Ashley Cui 566a923950 Vendor in common 0.33.1
As per title

Signed-off-by: Ashley Cui <acui@redhat.com>
2021-01-13 13:00:33 -05:00
Ed Santiago 34304df281 CI: fix broken diagnostic message for -dev check
There's a CI check for the presence of "-dev" in podman-info output
(it should not appear). This test is unlikely to fail, but if it
ever does, the diagnostic output is unhelpful. This makes it helpful.

Tested via:

    $ ln -s /bin/echo ~/bin/msg
    $ ln -s /bin/echo ~/bin/die
    $ TEST_FLAVOR=release ./contrib/cirrus/runner.sh
    ...
    Releases must never contain '-dev' in output of 'podman info' ( buildahVersion: 1.19.0-dev
      Version: 3.0.0-dev)

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-01-13 10:14:10 -07:00
OpenShift Merge Robot 9473dda87c
Merge pull request #8961 from rhatdan/kube
play kube: set entrypoint when interpreting Command
2021-01-13 11:50:43 -05:00