15741 Commits

Author SHA1 Message Date
53edd9b654 Podman pull --all-tags shorthand option
I added the shorthand option for `podman pull --all-tags`. Like Docker,
Podman can now do `podman pull -a`.

Signed-off-by: Jake Correnti <jcorrenti13@gmail.com>
2022-07-26 13:27:55 -04:00
f07d2bac4b Cirrus: Trigger podman-machine task by label
Instead of requiring developers to search for a magic button, make the
task trigger at the time a special PR label is added.  Update comments
accordingly.

Signed-off-by: Chris Evich <cevich@redhat.com>
2022-07-26 13:27:06 -04:00
3bd248ae7c GHA: Fix dumb error check
Previously the reply JSON was examined for the literal presence of the
string 'error'.  This was intended to catch server or query errors and
the like.  However it's not a sound design as valid/legitimate contents
could potentially contain the string.  Fix this by using the `-e` option
to `jq`, with a filter that should always result in a non-empty/null
match.  If this fails or returns null for some reason, then it's safe to
throw a real error code & message.

Signed-off-by: Chris Evich <cevich@redhat.com>
2022-07-26 13:26:12 -04:00
6d84a9952f Podman stop --filter flag
Filter flag is added for podman stop and podman --remote stop. Filtering logic is implemented in
getContainersAndInputByContext(). Start filtering can be manipulated to use this logic as well to limit redundancy.

Signed-off-by: Karthik Elango <kelango@redhat.com>
2022-07-26 13:25:36 -04:00
a78be890ee Switch to github.com/blang/semver/v4
Switch to the latest version of the now go module compatible release.

[NO NEW TESTS NEEDED]

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2022-07-26 13:22:46 -04:00
52850ce704 man page checker: enforce stricter options format
Followup to #14906, in which a nonexistent option was found
in a man page. The xref script was designed to catch that,
but I was too lax in my parsing: the option was documented
using wrong syntax, and the script didn't catch it.

Solution: do not allow *any* unrecognized cruft in the
option description lines. And fix all improperly-written
entries to conform to the rule:

    **--option**=*value(s)*

Two asterisks around option, which must have two dashes. One
asterisk around value(s).

This is going to cause headaches for some people adding new
options, but I don't think I can fix that: there are many
factors that make an unparseable line. Adding 'hint' code
would make the script even more complex than it is. I have
to assume that our contributors are smart enough to look
at surrounding context and figure out the right way to
specify options.

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

<MH: Fixed cherry-pick conflicts>

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2022-07-26 13:22:28 -04:00
a5827e13cd Fixes #14698 Use prepared image for WSL2 machine init
This commit introduces a prepared image for setting up the WSL2
environment. This means that the deployment will take considerable
less time to finish (as it does not need to run an update and package
install), but also allows to rely on a cached image to re-init the
environment without the need for an internet connection.

[NO NEW TESTS NEEDED]

Signed-off-by: Gerard Braad <me@gbraad.nl>
2022-07-26 13:19:48 -04:00
a4bae330a5 Add podman events -f to be alias for --filter
Needed for Docker compatibility.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-07-26 13:15:45 -04:00
d560c78976 [CI:DOCS] man pages: replace -c with --cpu-shares
Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
2022-07-26 13:09:08 -04:00
5f5379deb5 [CI:DOCS] podman-create.md: replace -c with --cpu-shares
Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
2022-07-26 13:09:02 -04:00
f7707c81a0 Fix last machine test
The list --format json test case had a typo like error.

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2022-07-26 13:08:37 -04:00
35dc17bfe6 abi: create new cgroup when running in a container
if podman is running in the root cgroup, it will create a new
subcgroup and move itself there.

[NO NEW TESTS NEEDED] it needs nested podman

Closes: https://github.com/containers/podman/issues/14884

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-07-26 13:08:19 -04:00
7b4ebfa657 podman: always call into SetupRootless
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-07-26 13:08:11 -04:00
3b37095b2b utils: call MaybeMoveToSubCgroup once
memoize its result and use it for subsequent calls.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-07-26 13:08:06 -04:00
edfe800271 podman: move MaybeMoveToSubCgroup to utils/
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-07-26 13:08:00 -04:00
b29a52a48a Docker uses "-c" to mean "--cpu-shares" in create and run
Add support for -c as an alias for --cpu-shares to be compatible with
Docker.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-07-26 13:05:59 -04:00
ffd2e6df9d test,manifest-run: declare TARGETPLATFORM before using it
As part of fix for https://github.com/openshift/imagebuilder/issues/231
`FROM` does not expands `ARGS` which are not declared so
`TARGETPLATFORM`

Note: I think a patch should be added at imagebuilder to allow using
inbuilt ARGS  in FROM without declaring it as well but it is something
to be discussed so lets declare it manually in our tests

[NO NEW TESTS NEEDED]
[NO TESTS NEEDED]

Signed-off-by: Aditya R <arajan@redhat.com>
2022-07-26 13:04:47 -04:00
ca4630ede6 CI: sanity check for desired runtime
We're still not testing runc in CI (#14833), and it may be weeks
or months before we can, due to criu/glibc nightmare, but one day
we'll be back on track, then later on we'll update VMs again,
and screw it up, and lose runc, and not notice, and RHEL will
break, and oh noes headless chicken again, repeat repeat.

We can do better. Use .cirrus.yml to explicitly define which
VMs should use which runtimes, and enforce it early in the
CI build step. This should never fail (uh huh) in a PR,
only in one of the update-VM PRs.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-07-26 13:04:19 -04:00
bf269e634c podman machine: do not commit proxies into config file
qemu fails when the same `fw_cfg` options is used more than once.
Since the current logic always adds a new option on each machine load
this will fail on the second start.

We can fix this by checking if the option is already set and replace but
I think it is easier to just not commit the option in the config and add
it dynamically on start. User that hit this bug have to recreate the
machine.

[NO NEW TESTS NEEDED]

Fixes #14636
Fixes #14837

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-07-26 13:02:39 -04:00
b2f3b28c6a logformatter: link by *task ID*, not build ID
Reason: task IDs are unique and permanent; linking by
build ID and task name is non-unique, because Re-run.

Fixes: #14863

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-07-26 13:01:40 -04:00
cfb768a36d fix wrong log message on Trace level
[NO NEW TESTS NEEDED]

Empty path to runtime binary was printed instead of a real path.

Before fix:
TRAC[0000] found runtime ""
TRAC[0000] found runtime ""

After:
TRAC[0000] found runtime "/usr/bin/crun"
TRAC[0000] found runtime "/usr/bin/runc"

Signed-off-by: Mikhail Khachayants <khachayants@arrival.com>
2022-07-26 13:01:21 -04:00
557b65e092 [CI:DOCS] Improve language. Fix spelling and typos.
* Correct spelling and typos.

* Improve language.

Co-authored-by: Ed Santiago <santiago@redhat.com>
Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
2022-07-26 13:01:03 -04:00
a363b3a65c Initial release notes for v4.2.0-RC1
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2022-07-26 12:59:58 -04:00
c57b5c9b83 Merge pull request #14894 from mheon/bump_420_rc1
[CI:DOCS] Bump to v4.2.0-RC1
2022-07-11 19:33:03 +00:00
f22af2bf83 Bump to v4.2.0-dev
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2022-07-11 13:18:11 -04:00
74aa681e59 Bump to v4.2.0-rc1
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
v4.2.0-rc1
2022-07-11 13:17:57 -04:00
aa29bd6de8 Update CI base branch
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2022-07-11 13:17:35 -04:00
810cbf1fb9 Merge pull request #14181 from umohnani8/kube-hostname
Add ports and hostname correctly in kube yaml
2022-07-11 15:13:49 +00:00
ea2c31c988 Merge pull request #14874 from vrothberg/fix-14859
exit code improvements
2022-07-11 13:31:39 +00:00
0af75a74d2 Merge pull request #14889 from eriksjolund/rewrite_gidmap_option_docs
[CI:DOCS] Rewrite the --gidmap option docs
2022-07-11 12:56:29 +00:00
0df8c6e157 Merge pull request #14826 from sstosh/net-prune
Refactored networkPrune function
2022-07-11 12:53:59 +00:00
87793b6339 [CI:DOCS] Rewrite the --gidmap option docs
* Reference --uidmap in --gidmap docs for additional information

* Remove --gidmap example "groupname -> 100000 / 30000 -> 0"

Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
2022-07-11 13:19:51 +02:00
3bb4cf8ee2 libpod: read exit code when cleaning up the runtime
While for some call paths we may be doing this redundantly we need to
make sure the exit code is always read at this point.

[NO NEW TESTS NEEDED] as I do not manage to reproduce the issue which
is very likely caused by a code path not writing the exit code when
running concurrently.

Fixes: #14859
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-07-11 13:06:42 +02:00
62cdc387de podman wait: return 0 if container never ran
Make sure to return/exit with 0 when waiting for a container that never
ran.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-07-11 13:06:40 +02:00
3691c9b1ba Merge pull request #14887 from eriksjolund/podman_info_command_completion_doc
[CI:DOCS] podman-info.1.md: update examples (now also shell completion and jq)
2022-07-11 10:10:02 +00:00
25d74db455 [CI:DOCS] podman-info.1.md: Update examples
* Add example "Extracting the list of container registries with a Go template".
  (The example was already present but in a much shorter form)

* Add example "Extracting the list of container registries from JSON with jq".

* Add shell completion instructions

Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
2022-07-11 10:42:48 +02:00
b41e42f42b test/system/130-kill.bats: use $IMAGE
A copy-paste error led to use `alpine` instead.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-07-11 10:31:52 +02:00
76422ecdbb Merge pull request #14818 from rhatdan/wait
podman wait can take multiple conditions
2022-07-11 08:06:58 +00:00
87feb82b07 Merge pull request #14219 from mheon/bump_version
Bump Compat API maximum version to v1.41
2022-07-08 18:49:54 +00:00
e2557c787c Merge pull request #14870 from vrothberg/fix-14846
improve pull-policy documentation
2022-07-08 12:58:37 -04:00
80f0ead64a Merge pull request #14853 from baude/machinetestsfix
Fix machine tests
2022-07-08 15:33:29 +00:00
81a19a568f Add ports and hostname correctly in kube yaml
If a pod is created without net sharing, allow adding
separate ports for each container to the kube yaml
and also set the pod level hostname correctly if the
uts namespace is not being shared.

Add a warning if the default namespace sharing options
have been modified by the user.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2022-07-08 11:21:48 -04:00
6b9abe69db improve pull-policy documentation
Make sure that the docs for pull policies is consistent with Buildah and
reflects the implementation.

Further improve the help messages and auto completions.

[NO NEW TESTS NEEDED]

Fixes: #14846
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-07-08 17:11:08 +02:00
cc6aac5be7 Merge pull request #14872 from edsantiago/deferred_defer
Manifest test cleanup: use defer()
2022-07-08 14:33:10 +00:00
76d887c770 Fix machine tests
Catch up with regressions that have occurred since the tests were
originally written.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2022-07-08 08:22:49 -05:00
1e7686df6e Manifest test cleanup: use defer()
Followup to #14845: use defer(), not fragile global context,
to stop registry and clean up temporary envariable. Thanks
to mitr for the suggestion.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-07-08 06:19:30 -06:00
96dd57ca50 podman wait can take multiple conditions
Podman wait should not be defaulting to just stopped.  By default
wait API waits for stopped and exited.  We should not override this on
the client side.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-07-08 05:26:56 -04:00
6087fb2116 Merge pull request #14839 from saschagrunert/errors-pkg
pkg: switch to golang native error wrapping
2022-07-08 09:24:25 +00:00
a2bcf833c9 Merge pull request #14845 from edsantiago/registry_sanitize
manifest_test: safer registry setup and teardown
2022-07-08 08:32:16 +00:00
720b3217fd Merge pull request #14850 from Luap99/e2e-machine
pkg/machine/e2e: do not import from cmd/podman
2022-07-08 07:32:29 +00:00