Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFE] podman volume mount|unmount command #12768

Closed
mskarbek opened this issue Jan 7, 2022 · 14 comments · Fixed by #13318
Closed

[RFE] podman volume mount|unmount command #12768

mskarbek opened this issue Jan 7, 2022 · 14 comments · Fixed by #13318
Labels
Good First Issue This issue would be a good issue for a first time contributor to undertake. kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@mskarbek
Copy link

mskarbek commented Jan 7, 2022

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind feature

Description

I would like to be able to mount a volume independently of the container.
Use case: creation of a volume that is then mounted and populated with autogenerated config files before it is attached to the newly created container.
Yes, I know that I can just create directory, put config files there and just use -v or tar content of that directory and volume import it.
The above is a convenience request that will simplify a little dealing with volumes (skipping tar steps) and allow keeping everything as a programmatically declared volume without tracking separately random directories populated outside the podman volume functionality.

@openshift-ci openshift-ci bot added the kind/feature Categorizes issue or PR as related to a new feature. label Jan 7, 2022
@flouthoc
Copy link
Collaborator

flouthoc commented Jan 7, 2022

@mskarbek Thanks for creating the issues.

If i got the issue correctly.

Could we use volume with type=bind ? #12687
It should allow bind mount of arbitrary location from host as a podman volume

@rhatdan
Copy link
Member

rhatdan commented Jan 7, 2022

Do you want podman volume mount NAME destination?

@rhatdan
Copy link
Member

rhatdan commented Jan 7, 2022

Or would
$mntpnt=$(podman volume mount NAME)
$podman volume umount NAME

Be enough?

@mskarbek
Copy link
Author

mskarbek commented Jan 7, 2022

@rhatdan this can behave the same way as podman mount/buildah mount so $mntpnt=$(podman volume mount NAME) will be ok.

@rhatdan
Copy link
Member

rhatdan commented Jan 7, 2022

I am fine with adding it. Interested in opening a PR?

@flouthoc
Copy link
Collaborator

flouthoc commented Jan 7, 2022

@mskarbek @rhatdan
I might be missing something but all the volumes should be already accessible by host. Especially if driver is local and for any other driver src of mountpoint must be accessible from host first.

So if you do podman volume inspect $myvol we should able to see the mountpoint.

If only mountpoint is needed this should be pretty enough right ?

$ podman volume inspect myvol | jq '.[0].Mountpoint'

Again i might be interpreting the issue wrongly. But this is what I remember while discussing something with @mheon in past over an older PR.

@mskarbek
Copy link
Author

mskarbek commented Jan 7, 2022

@flouthoc your logic is sound when it comes to the plain local volumes, I don't need to mount them, they are just directories, but:

podman volume inspect eb712af1-acfa-4eb7-9c99-3ab3e5777d9c
[
    {
        "Name": "eb712af1-acfa-4eb7-9c99-3ab3e5777d9c",
        "Driver": "local",
        "Mountpoint": "/var/lib/volumes/storage/eb712af1-acfa-4eb7-9c99-3ab3e5777d9c/_data",
        "CreatedAt": "2021-12-20T22:11:38.745502358+01:00",
        "Labels": {},
        "Scope": "local",
        "Options": {
            "device": "dfe93b5a-632d-44c4-98b9-7cff969b3a1d/datafs/var/lib/volumes/storage/eb712af1-acfa-4eb7-9c99-3ab3e5777d9c",
            "type": "zfs"
        }
    }
]

This is a ZFS dataset with mountpoint=legacy declared as a volume in podman. Such dataset will be mounted during container start, the content of that file system is not always available under "Mountpoint": "/var/lib/volumes/storage/eb712af1-acfa-4eb7-9c99-3ab3e5777d9c/_data".
Yes, I can automate everything, but the issue is about keeping user experience as podman-focused as possible.
Besides of test/prod envs we use VMs for our developers with RHEL 8 prebuild image with ZFS - ZFS is an important part providing snapshots and send/receive functionality for datasets that are used on developers VMs, it's a convenient way of shipping test database content for example.
Those VMs are partially automated with Ansible, but developers need normal access to them, and they interact with podman daily. It would be much easier for them to not think about looking for datasets, mounting them, unmounting, but to keep everything nice and tidy under one coherent podman experience. They are familiar with podman mount functionality, so replicating that experience under podman volume mount essentially masking the underlying storage backend would be appreciated.
As I previously stated it is a convenience request not a dealbreaker. ;)

@flouthoc
Copy link
Collaborator

flouthoc commented Jan 7, 2022

@mskarbek Ah fair got it. You want mounting experience to be more podman oriented. That's a fair request.

@rhatdan
Copy link
Member

rhatdan commented Jan 7, 2022

@flouthoc Yes,certain non local file systems are mounted (tmpfs, bind, nfs, and fancy docker-volume-plugins) could be mounted.

Currently when you run a container for the first time with a volume podman mounts the volume in container/storage then setup a bind mount into the container. @mskarbek is looking to only do step 1, where we do the mount. All of the code is there to do this, but someone needs to implement the CLI and then call into the functions to make it happen.

CLI should only be local, not remote API.

@rhatdan rhatdan added the Good First Issue This issue would be a good issue for a first time contributor to undertake. label Jan 7, 2022
@boaz0
Copy link
Collaborator

boaz0 commented Jan 11, 2022

@rhatdan can I work on this?

@rhatdan
Copy link
Member

rhatdan commented Jan 11, 2022

Yup

@github-actions
Copy link

A friendly reminder that this issue had no activity for 30 days.

@rhatdan
Copy link
Member

rhatdan commented Feb 11, 2022

@boaz0 any progress?

@boaz0
Copy link
Collaborator

boaz0 commented Feb 15, 2022

@rhatdan - sorry but I won't be able to work on it. Feel free to reassign this to someone else.
Thanks.

rhatdan added a commit to rhatdan/podman that referenced this issue Feb 17, 2022
Fixes: containers#12768

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
rhatdan added a commit to rhatdan/podman that referenced this issue Feb 22, 2022
Fixes: containers#12768

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
rhatdan added a commit to rhatdan/podman that referenced this issue Feb 22, 2022
Fixes: containers#12768

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
rhatdan added a commit to rhatdan/podman that referenced this issue Feb 23, 2022
Fixes: containers#12768

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
rhatdan added a commit to rhatdan/podman that referenced this issue Feb 23, 2022
Fixes: containers#12768

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
rhatdan added a commit to rhatdan/podman that referenced this issue Feb 23, 2022
Fixes: containers#12768

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
rhatdan added a commit to rhatdan/podman that referenced this issue Feb 24, 2022
Fixes: containers#12768

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
rhatdan added a commit to rhatdan/podman that referenced this issue Feb 28, 2022
Fixes: containers#12768

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
keonchennl pushed a commit to gcalin/podman that referenced this issue Mar 18, 2022
Fixes: containers#12768

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
keonchennl pushed a commit to gcalin/podman that referenced this issue Mar 18, 2022
Signed-off-by: Krzysztof Baran <krysbaran@gmail.com>
Signed-off-by: Calin Georgescu <caling@protonmail.com>

Improve the error message for usused configMaps

If you run `podman play kube` on a yaml file that only contains
configMaps, podman will fail with the error:

	Error: YAML document does not contain any supported kube kind

This is not strictly true; configMaps are a supported kube kind. The
problem is that configMaps aren't a standalone entity. They have to be
used in a container somewhere, otherwise they don't do anything.

This change adds a new message in the case when there only configMaps
resources. It would be helpful if podman reported which configMaps are
unused on every invocation of kube play. However, even if that feedback
were added, this new error messages still helpfully explains the reason
that podman is not creating any resources.

[NO NEW TESTS NEEDED]

Signed-off-by: Jordan Christiansen <xordspar0@gmail.com>

Bump github.com/containernetworking/plugins from 1.0.1 to 1.1.0

Bumps [github.com/containernetworking/plugins](https://github.com/containernetworking/plugins) from 1.0.1 to 1.1.0.
- [Release notes](https://github.com/containernetworking/plugins/releases)
- [Commits](containernetworking/plugins@v1.0.1...v1.1.0)

---
updated-dependencies:
- dependency-name: github.com/containernetworking/plugins
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Show version of the deb package in info output

Previously just showing name of the package, followed by
the path repeated again (already stated on the line above)

[NO NEW TESTS NEEDED]

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>

copr packaging: use generic macros for tmpfiles and modules load dirs

[NO NEW TESTS NEEDED]

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>

Vendor in containers/common@main

Signed-off-by: Ashley Cui <acui@redhat.com>

Allow setting binarypath from Makefile

Packagers for other distributions and package managers may put their helper binaries in other location prefixes.
Add HELPER_BINARIES_DIR to the makefile so packagers can set the prefix when building Podman.
HELPER_BINARIES_DIR will be set at link-time.

Example usage: make podman-remote HELPER_BINARIES_DIR=/my/location/prefix

Signed-off-by: Ashley Cui <acui@redhat.com>

Clarify v2 API testing for podman vs docker clients

Fixes: containers#13273

Signed-off-by: Chris Evich <cevich@redhat.com>

Add podman volume mount support

Fixes: containers#12768

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Add the names flag for pod logs

Fixes containers#13261

Signed-off-by: Xueyuan Chen <X.Chen-47@student.tudelft.nl>

Refactor docker-py compatibility tests

* Add which python client is being used to run tests, see "python
  client" below.
* Remove redundate code from test classes
* Update/Add comments to modules and classes

======================================================= test session starts ========================================================
platform linux -- Python 3.10.0, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
python client -- DockerClient
rootdir: /home/jhonce/Projects/go/src/github.com/containers/podman
plugins: requests-mock-1.8.0
collected 33 items

test/python/docker/compat/test_containers.py ...s..............  [ 54%]
test/python/docker/compat/test_images.py ............  [ 90%]
test/python/docker/compat/test_system.py ...  [100%]

Note: Follow-up PRs will verify the test results and expand the tests.

Signed-off-by: Jhon Honce <jhonce@redhat.com>

Revert "use GetRuntimeDir() from c/common"

This reverts commit fc5cf81.

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>

Use storage that better supports rootless overlayfs

overlayfs -- the kernel's version, not fuse-overlayfs -- recently learned
(as of linux 5.16.0, I believe) how to support rootless users. Previously,
rootless users had to use these storage.conf(5) settings:

* storage.driver=vfs          (aka STORAGE_DRIVER=vfs), or
* storage.driver=overlay      (aka STORAGE_DRIVER=overlay),
  storage.options.overlay.mount_program=/usr/bin/fuse-overlayfs
                              (aka STORAGE_OPTS=/usr/bin/fuse-overlayfs)

Now that a third backend is available, setting only:

* storage.driver=overlay      (aka STORAGE_DRIVER=overlay)

containers#13123 reported EXDEV errors
during the normal operation of their container. Tracing it out, the
problem turned out to be that their container was being mounted without
'userxattr'; I don't fully understand why, but mount(8) mentions this is
needed for rootless users:

> userxattr
>
>   Use the "user.overlay." xattr namespace instead of "trusted.overlay.".
>   This is useful for unprivileged mounting of overlayfs.

containers/storage#1156 found and fixed the issue
in podman, and this just pulls in that via

    go get github.com/containers/storage@ebc90ab
    go mod vendor
    make vendor

Closes containers#13123

Signed-off-by: Nick Guenther <nick.guenther@polymtl.ca>

container: workdir resolution must consider symlink if explicitly configured

While resolving `workdir` we mostly create a `workdir` when `stat`
fails with `ENOENT` or `ErrNotExist` however following cases are not
true when user explicitly specifies a `workdir` while `running` using
`--workdir` which tells `podman` to only use workdir if its exists on
the container. Following configuration is implicity set with other
`run` mechanism like `podman play kube`

Problem with explicit `--workdir` or similar implicit config in `podman play
kube` is that currently podman ignores the fact that workdir can also be
a `symlink` and actual `link` could be valid.

Hence following commit ensures that in such scenarios when a `workdir`
is not found and we cannot create a `workdir` podman must perform a
check to ensure that if `workdir` is a `symlink` and `link` is resolved
successfully and resolved link is present on the container then we
return as it is.

Docker performs a similar behviour.

Signed-off-by: Aditya R <arajan@redhat.com>

vendor: bump c/storage to main/d06b0f

Bump c/storage to main/d06b0f so we podman could use new `race-free`
`AddNames` and `RemoveNames` api

Signed-off-by: Aditya R <arajan@redhat.com>

vendor: bump c/image to main/9a9cd9

Bump c/image to upstream main/9a9cd9 so podman could use new race-free
code.

Signed-off-by: Aditya R <arajan@redhat.com>

test: add a test to verify race free concurrent/parallel builds

Invoking parallel/concurrent builds from podman race against each other
following behviour was fixed in
containers/storage#1153 and containers/image#1480

Test verifies if following bug is fixed in new race-free API or not.
Read more about this issue, see bz 2055487 for more details.

More details here: containers/buildah#3794 and containers#13339

Co-authored-by: Ed Santiago <santiago@redhat.com>
Signed-off-by: Aditya R <arajan@redhat.com>

RELEASE_PROCESS.md: build artifacts locally

The current PR process for release bump has the HEAD commit which bumps
version/version.go to the form `release+1-dev`. This makes Cirrus
publish release artifacts with `release+1-dev` and not `release`.

For example, the msi generated at https://cirrus-ci.com/task/5403901196238848
says podman-v4.0.3-dev.msi .

Building locally by checking out the released tag would generate the
correct artifacts and would also be faster and more convenient.

[NO NEW TESTS NEEDED]

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>

libpod: pods do not use cgroups if --cgroups=disabled

do not attempt to use cgroups with pods if the cgroups are disabled.
A similar check is already in place for containers.

Closes: containers#13411

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Throw an error if kube yaml has duplicate ctr names

Error out if the kube yaml passed to play kube has more
than one container or init container with the same name.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>

Move all python tests to pytest

* Add configuration to add report header for python client used in tests
* Move report headers into the individual test runners vs runner.sh

Signed-off-by: Jhon Honce <jhonce@redhat.com>

Fixes: containers#13301 ("machine rm removes the mounted socket file on macos")

[NO NEW TESTS NEEDED]
Signed-off-by: Thibault Gagnaux <tgagnaux@gmail.com>

[CI:DOCS] RELEASE_PROCESS.md: cosmetic fix

Follow up to pr#13416

Insert line breaks to get rid of the horizontal scroll bar.

Resolves: containers#13416 (comment)

Co-authored-by: Ashley Cui <acui@redhat.com>
Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>

[CI:DOCS] DISTRO_PACKAGE.md: List the packaging changes for v4

[NO NEW TESTS NEEDED]

Co-authored-by: Ashley Cui <ashleycui16@gmail.com>
Co-authored-by: Valentin Rothberg <vrothberg@redhat.com>
Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>

[CI:DOCS] troubleshooting.md: Improve language and fix typos

Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>

Add ExitCommandDelay configuration use in API exec handler

[NO NEW TESTS NEEDED]

Signed-off-by: Rover van der Noort <s.r.vandernoort@student.tudelft.nl>

MacOS improvements

* Enable support of virtfs in Podman and darwin.  At the time of this writing, it requires a special patch not yet included in upstream qemu.
* Prefer to use a specially built qemu to support virtfs.  The qemu is installed under libexec/podman.

[NO NEW TESTS NEEDED]
Signed-off-by: Brent Baude <bbaude@redhat.com>

Inspect network info of a joined network namespace

Closes: containers#13150
Signed-off-by: 😎 Mostafa Emami <mustafaemami@gmail.com>

Move secret-verify-leak containerfile into its own Directory

Secret-verify-leak is causing flakes, when running in parallel tests.
This is because remote secrets are copied into the context directory to
send to the API server, and secret-verify-leak is doing a COPY * and
then checking if the temporary secret file ends up in the container or
not. Since all the temporary files are prefixed with
"podman-build-secret", this test checks if podman-build-secret is in the
image. However, when run in parallel with other tests, other temporary
podman-build-secrets might be in the context dir. Moving
secret-verify-leak into its own directory makes sure that the context
dir is used only by this one test.

Also renamed Dockerfile -> Containerfile and cleaned up unused
Containerfiles.

Signed-off-by: Ashley Cui <acui@redhat.com>

Skip flaky pprof tests

pprof tests are way too flaky, and are causing problems for
community contributors who don't have privs to press Re-run.

There has been no activity or interest in fixing the bug,
and it's not something I can fix. So, just disable the test.

Signed-off-by: Ed Santiago <santiago@redhat.com>

[CI:DOCS] troubleshooting.md: mention "podman unshare chown 0:0 path"

* Mention the command "podman unshare chown 0:0 dir1/a"
  that changes file ownership to the regular user's UID and GID on
  the host.

Co-authored-by: Tom Sweeney <tsweeney@redhat.com>
Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>

machine rm -f stops and removes machine

If you want to remove a running machine, you can now pass the --force/-f
to podman machine rm and the machine will be stopped and removed without
confirmations.

Fixes: containers#13448

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>

Improve agent install message to add restart instructions

Signed-off-by: Jason T. Greene <jason.greene@redhat.com>

Bump github.com/docker/distribution

Bumps [github.com/docker/distribution](https://github.com/docker/distribution) from 2.8.0+incompatible to 2.8.1+incompatible.
- [Release notes](https://github.com/docker/distribution/releases)
- [Commits](distribution/distribution@v2.8.0...v2.8.1)

---
updated-dependencies:
- dependency-name: github.com/docker/distribution
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Set default rule at the head of device configuration

The default rule should be set at the head of device configuration.
Otherwise, rules for user devices are overridden by the default rule so
that any access to the user devices are denied.

Signed-off-by: Hironori Shiina <shiina.hironori@jp.fujitsu.com>

use gopkg.in/yaml.v2 instead of v3

Many dependencies already import gopkg.in/yaml.v2, podman is the only
user of the v3 version except  github.com/stretchr/testify but this is
only a testing dependency so it will not end up in the binary.

This change reduces the podman binary size from 54740 to 54260 KB on my
system.

[NO NEW TESTS NEEDED]

Signed-off-by: Paul Holzinger <pholzing@redhat.com>

Use github.com/vbauerster/mpb/v7 in pkg/machine

We already use v7 in c/image so podman should use the same version to
prevent duplication.

This saves 170 KB binary size.

[NO NEW TESTS NEEDED]

Signed-off-by: Paul Holzinger <pholzing@redhat.com>

Fix handling of tmpfs-mode for tmpfs creation in compat mode

The permissions on disk were wrong since we were not converting to
octal.

Fixes: containers#13108

[NO NEW TESTS NEEDED] Since we don't currently test using the docker
client

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Add --context-dir option to podman play kube

This option was requested so that users could specify alternate
locations to find context directories for each image build. It
requites the --build option to be set.

Partion Fix: containers#12485

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Bump github.com/vbauerster/mpb/v7 from 7.3.2 to 7.4.1

Bumps [github.com/vbauerster/mpb/v7](https://github.com/vbauerster/mpb) from 7.3.2 to 7.4.1.
- [Release notes](https://github.com/vbauerster/mpb/releases)
- [Commits](vbauerster/mpb@v7.3.2...v7.4.1)

---
updated-dependencies:
- dependency-name: github.com/vbauerster/mpb/v7
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Bump github.com/containernetworking/plugins from 1.1.0 to 1.1.1

Bumps [github.com/containernetworking/plugins](https://github.com/containernetworking/plugins) from 1.1.0 to 1.1.1.
- [Release notes](https://github.com/containernetworking/plugins/releases)
- [Commits](containernetworking/plugins@v1.1.0...v1.1.1)

---
updated-dependencies:
- dependency-name: github.com/containernetworking/plugins
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

CI: fix golangci-lint installation

avoid this warn:
```
golangci/golangci-lint info installed ./bin/golangci-lint
golangci/golangci-lint err this script is deprecated, please do not use it anymore. check goreleaser/godownloader#207
```

Signed-off-by: Pascal Bourdier <pascal.bourdier@gmail.com>

[CI:DOCS] Remove "(1)" from web tab text

* Remove the ending text "(1)" to avoid it from being
  displayed in the web tab title for a command man page
  on the web. Often such a text indicates that a web
  page got an update. For instance GitHub issues shows
  the number of new comments that have been written
  after the user's last visit.
  Fixes containers#13438

Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>

Add podman play kube --annotation

Allow users to add annotions in the podman play kube command.
This PR Also fixes the fact that annotations in the pod spec were
not being passed down to containers.

Fixes: containers#12968

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Bump github.com/docker/docker

Bumps [github.com/docker/docker](https://github.com/docker/docker) from 20.10.12+incompatible to 20.10.13+incompatible.
- [Release notes](https://github.com/docker/docker/releases)
- [Changelog](https://github.com/moby/moby/blob/master/CHANGELOG.md)
- [Commits](moby/moby@v20.10.12...v20.10.13)

---
updated-dependencies:
- dependency-name: github.com/docker/docker
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Bump github.com/spf13/cobra from 1.3.0 to 1.4.0

Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.3.0 to 1.4.0.
- [Release notes](https://github.com/spf13/cobra/releases)
- [Changelog](https://github.com/spf13/cobra/blob/master/CHANGELOG.md)
- [Commits](spf13/cobra@v1.3.0...v1.4.0)

---
updated-dependencies:
- dependency-name: github.com/spf13/cobra
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

podman.spec.rpkg: enable rhel8 builds on copr

fix conditionals and buildtags to enable rhel8 builds

[NO NEW TESTS NEEDED]

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>

Fixes TTY & resizing on Mac and Windows

Signed-off-by: Jason T. Greene <jason.greene@redhat.com>

Bump golang to 1.17 in `vendor-in-container`

Go 1.17 compiler got faster

Signed-off-by: Pascal Bourdier <pascal.bourdier@gmail.com>

Add support for --chrootdirs

Signed-off-by: LStandman <65296484+LStandman@users.noreply.github.com>

Fix typo

[NO NEW TESTS NEEDED]

Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>

slirp: fix setup on ipv6 disabled systems

When enable_ipv6=true is set for slirp4netns (default since podman v4),
we will try to set the accept sysctl. This sysctl will not exist on
systems that have ipv6 disabled. In this case we should not error and
just ignore the extra ipv6 setup.

Also the current logic to wait for the slirp4 setup was kinda broken, it
did not actually wait until the sysctl was set before starting slirp.
This should now be fixed by using two `sync.WaitGroup`s.

[NO NEW TESTS NEEDED]

Fixes containers#13388

Signed-off-by: Paul Holzinger <pholzing@redhat.com>

vendor: bump buildah, c/image and c/storage

Bumps

c/buildah to -> `v1.24.3-0.20220310160415-5ec70bf01ea5`
c/storage to -> `v1.38.3-0.20220308085612-93ce26691863`
c/image to -> `v5.20.1-0.20220310094651-0d8056ee346f`

Signed-off-by: Aditya R <arajan@redhat.com>

docs: podman-build add --no-hosts

Add newly added `--no-hosts` to build docs and document its conflicting
nature with `--add-host`

Signed-off-by: Aditya R <arajan@redhat.com>

apply-podman-deltas: skip modified test case for --add-host which adds anomaly

All podman tests in CI expects exit code 125, which might not be true since exit code from runtime
is relayed as it is without any modification both in `buildah` and `podman`. Following behviour is seen when PR containers/buildah#3809
added a test here https://github.com/containers/buildah/blob/main/tests/bud.bats#L3183 which relays exit code from runtime as it
is, in case of both `podman` and `buildah`. However apart from this test case no other test case was able to trigger this behviour hence
marking this test as an anomaly. Since its debatable if we should override this returned error number or not hence adding a note here.

Signed-off-by: Aditya R <arajan@redhat.com>

test/e2e: add aardvark specific tests

Co-authored-by: Brent Baude <bbaude@redhat.com>
Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>

Bump github.com/spf13/cobra from 1.3.0 to 1.4.0

Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.3.0 to 1.4.0.
- [Release notes](https://github.com/spf13/cobra/releases)
- [Changelog](https://github.com/spf13/cobra/blob/master/CHANGELOG.md)
- [Commits](spf13/cobra@v1.3.0...v1.4.0)

---
updated-dependencies:
- dependency-name: github.com/spf13/cobra
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Bump github.com/docker/docker

Bumps [github.com/docker/docker](https://github.com/docker/docker) from 20.10.12+incompatible to 20.10.13+incompatible.
- [Release notes](https://github.com/docker/docker/releases)
- [Changelog](https://github.com/moby/moby/blob/master/CHANGELOG.md)
- [Commits](moby/moby@v20.10.12...v20.10.13)

---
updated-dependencies:
- dependency-name: github.com/docker/docker
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

fix breaking change in pkg/bindings

pkg/bindings is considered stable. We cannot make changes that would
break any users. If someone uses this field their code would fail to
compile. Since the fix is obviously correct we will keep it but also
add the old field back in to keep compatibility with old code.

When both fields are set ImportArchive is preferred over ImportAchive.

Fixes changes from commit 2171973

[NO NEW TESTS NEEDED]

Signed-off-by: Paul Holzinger <pholzing@redhat.com>

Fix windows win-sshproxy build

Github no longer supports the unauthenticated git protocol, so switch
to using https instead.

https://github.blog/2021-09-01-improving-git-protocol-security-github/

Signed-off-by: Paul Holzinger <pholzing@redhat.com>

fix empty newline in version output

When podman is build without git commit information it will print a
empty newline instead. This is undesirable and a regression introduced
in commit 7d22cc8.

To test build podman with `go build -mod=vendor -o bin/podman ./cmd/podman`
and check the output of bin/podman version with and without this commit.

[NO NEW TESTS NEEDED]

Signed-off-by: Paul Holzinger <pholzing@redhat.com>

move k8s deps into podman

We only need a small part of the k8s dependencies but they are the
biggest dependencies in podman by far. Moving them into podman allows us
to remove the unnecessary parts.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>

remove unneeded k8s code

There is a lot of unneeded code, k8s is the by far the biggest
dependency in podman. We should remove as much as possible so that we
only have the stuff left that we use.

This is just a quick skim over the code which removes a lot of the
generated code and many packages that are now unused.
I know that this will be impossible to properly review. I will try to
make smaller changes in follow up work.

Right now this reduces about 8 MB in binary size!!!

[NO NEW TESTS NEEDED] Hopefully existing tests will catch any problems.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>

pkg/k8s.io/...: fix lint errors

Fix linting errors. We use different/stricter linters, instead of
skipping these packages we should fix it.

Most errors are about naming conventions, since I do not want to change
the names I added the nolint comment there. I also removed some unused
fields where the linter complained.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>

pkg/k8s.io/...: remove protobuf field tags

Since we do not use protobuf we can remove these field tags. This will
save some KB in the final binary size.

This change was automated with the following commands:
find pkg/k8s.io/ -type f -name "*.go" -exec sed -i -e 's/\sprotobuf\:\".*\"//g' {} +
find pkg/k8s.io/ -type f -name "*.go" -exec sed -i -e 's/\s`protobuf\:\".*\"`//g' {} +

Signed-off-by: Paul Holzinger <pholzing@redhat.com>

pkg/k8s.io/...: remove more unneeded files

We do not use the types defined in these fields.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>

pkg/k8s.io/api/core/v1: remove unneeded types

Remove types that are not applicable for podman. This are types I do not
think we need, there is definitely more that could be removed but this
should be handled by someone who knows the k8s code better than me.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>

pkg/k8s.io: add small readme with copyright notice

Signed-off-by: Paul Holzinger <pholzing@redhat.com>

[CI:DOCS]: Mention netavark limitations for macvlan/ipvlan drivers

The example is also improved to add the --subnet option, this option is required with netavark, else you get:
    Error: macvlan driver needs at least one subnet specified, DHCP is not supported with netavark

Signed-off-by: Clayton Craft <clayton@craftyguy.net>

Exit with 0 when receiving SIGTERM

* systemctl stop podman.service will now return exit code 0
* Update test framework to support JSON boolean and numeric values

Signed-off-by: Jhon Honce <jhonce@redhat.com>

Add test for BZ #2052697

Signed-off-by: Jhon Honce <jhonce@redhat.com>

Separator is no longer prepended when prefix is empty on podman generate systemd

When podman generate systemd is invoked, it previously did not check if
container-prefix or pod-prefix are empty. When these are empty, the file name
starts with the separator, which is hyphen by default. This results in files
like '-containername.service'.

The code now checks if these prefixes are empty. If they are, the filename no
longer adds a separator. Instead, it uses name or ID of the container or pod.

Closes containers#13272

Signed-off-by: Nirmal Patel <npate012@gmail.com>

Set rawimage for containers created via play kube

This commit set the containers RawImageName to default image name
specified in Pod YAML, so the containers could be used via autoupdate
feature, which needs the RawImageName to be set.

Currently RawImageName is set only for the create/run/clone podman
commands.

[NO NEW TESTS NEEDED]

Signed-off-by: Ondra Machacek <omachace@redhat.com>

podman create: building local pause image: do not read ignore files

Make sure to ignore local {container,docker}ignore files when building a
local pause image.  Otherwise, we may mistakenly not be able to copy
catatonit into the build container.

Fixes: containers#13529
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>

podman machine: remove hostip from port

Inside the podman machine vm we always remove the hostip from the port
mapping because this should only be used on the actual host. Otherwise
you run into issues when we would bind 127.0.0.1 or try to bind a
host address that is not available in the VM.

This was already done for cni/netavark ports and slirp4netns but not for
the port bindings inside libpod which are only used as root.

[NO NEW TESTS NEEDED] We still do not have machine tests!

Fixes containers#13543

Signed-off-by: Paul Holzinger <pholzing@redhat.com>

go fmt: use go 1.18 conditional-build syntax

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>

Handle incompatible machines

Start in a reduced mode for recovery, warn, and provide instructions to recreate them

Signed-off-by: Jason T. Greene <jason.greene@redhat.com>

logformatter: link to bats sources on error

We already link to ginkgo sources, now add links to bats.
Ugly, because we need to hardcode containers/podman (git
repo) and test/system (test file path): those can't be
determined from the log results like they can in ginkgo.

Also, great suggestion from @Luap99: in addition to the
'Annotated results' link which we append to the basic log,
include a short summary of failures. This should help a
viewer see exactly which test(s) failed, which in turn
can be helpful for diagnosing known-flake or real-problem.

Signed-off-by: Ed Santiago <santiago@redhat.com>

build(deps): bump github.com/stretchr/testify from 1.7.0 to 1.7.1

Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.7.0 to 1.7.1.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](stretchr/testify@v1.7.0...v1.7.1)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Deduplicate between Volumes and Mounts in compat API

Docker Compose v2.0 passes mount specifications in two different
places: Volumes (just the destination) and Mounts (full info
provided - source, destination, etc). This was causing Podman to
refuse to create containers, as the destination was used twice.
Deduplicate between Mounts and Volumes, preferring volumes, to
resolve this.

Fixes containers#11822

Signed-off-by: Matthew Heon <mheon@redhat.com>

Add tests with Docker Compose v2

Add a pair of new Cirrus test suites using Compose v2 instead of
Compose v1 (as is currently packaged in Fedora). They work
identically, and run the same tests, as the Compose v1 tests, but
with the new v2 binary instead.

[NO NEW TESTS NEEDED] This adds an entire Cirrus suite...

Signed-off-by: Matthew Heon <mheon@redhat.com>

Set names in compose tests based on version

Compose v2 uses dashes as separators instead of hyphens. This
broke some tests that relied upon container names. Set the name
conditionally to make it safe for both.

Signed-off-by: Matthew Heon <mheon@redhat.com>
keonchennl pushed a commit to gcalin/podman that referenced this issue Mar 18, 2022
Fixes: containers#12768

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
keonchennl pushed a commit to gcalin/podman that referenced this issue Mar 18, 2022
Fixes: containers#12768

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
kbaran1998 pushed a commit to gcalin/podman that referenced this issue Mar 23, 2022
Fixes: containers#12768

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Signed-off-by: Krzysztof Baran <krysbaran@gmail.com>
kbaran1998 pushed a commit to gcalin/podman that referenced this issue Mar 24, 2022
Fixes: containers#12768

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Signed-off-by: Krzysztof Baran <krysbaran@gmail.com>
kbaran1998 pushed a commit to gcalin/podman that referenced this issue Mar 24, 2022
Fixes: containers#12768

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Signed-off-by: Krzysztof Baran <krysbaran@gmail.com>
keonchennl pushed a commit to gcalin/podman that referenced this issue Mar 24, 2022
Fixes: containers#12768

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
keonchennl pushed a commit to gcalin/podman that referenced this issue Mar 29, 2022
Fixes: containers#12768

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
gbraad pushed a commit to gbraad-redhat/podman that referenced this issue Jul 13, 2022
Fixes: containers#12768

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 20, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Good First Issue This issue would be a good issue for a first time contributor to undertake. kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants