Commit graph

4092 commits

Author SHA1 Message Date
openshift-merge-bot[bot] 7aedb541d5
Merge pull request #24018 from ygalblum/allow-symlinks
Quadlet - add full support for Symlinks
2024-09-23 06:49:12 +00:00
Ygal Blum 133ea31ffb Quadlet - add full support for Symlinks
Use os.ReadDir recursively instead of filepath.WalkDir
Use map instead of list to easily find looped Symlinks
Update existing tests and add a more elaborate one
Update the man page

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2024-09-20 11:11:03 -04:00
openshift-merge-bot[bot] 62c101651f
Merge pull request #23857 from rhatdan/run
Remove containers/common/pkg/config from pkg/util
2024-09-17 20:31:28 +00:00
Nalin Dahyabhai 00c13afcb9 podman-manifest-remove: update docs and help output
* podman manifest remove doesn't accept references as descriptions of
  what to remove from a list or index; only use digests in the man page
* podman manifest remove only removes one thing at a time; correct the
  man page examples

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2024-09-17 11:36:12 -04:00
openshift-merge-bot[bot] 3f0483f880
Merge pull request #23802 from jerome59/main
Podman CLI --add-host with multiple host for a single IP
2024-09-17 12:54:46 +00:00
Jerome Degroote f4d0e124d6 Podman CLI --add-host with multiple host for a single IP
Signed-off-by: Jerome degroote <jeromedu59230@gmx.fr>
2024-09-17 09:35:38 +02:00
Ygal Blum a664708f35 Quadlet - Split getUnitDirs to small functions
Adjust the unittest

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2024-09-16 15:03:52 -04:00
Paul Holzinger 42a1f5e87c
quadlet: do not log ENOENT errors
There is no point in logging them, the directories not existing is fine
and expected and logging these by default when useing -dryrun just
causes confusion.

Fixes #23620

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-09-16 11:51:17 +02:00
Paul Wright ac4a31cc4a rewrite typo osascript
Signed-off-by: Paul Wright <pwright@redhat.com>
2024-09-12 14:57:55 +01:00
Paul Wright 089d2513d8 typo
Signed-off-by: Paul Wright <pwright@redhat.com>
2024-09-12 14:57:41 +01:00
Paul Holzinger 0abbcfa50a
podman images: sort repository with tags
When you sort by repository a user most likely also want the tags to be
sorted as well. At the very least to get a stable output as the order
could be changed pull podman tag/pull even if they keep using the same
tag name.

Fixes #23803

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-09-06 14:17:17 +02:00
Daniel J Walsh eb396705c6
Remove containers/common/pkg/config from pkg/util
Probably has to wait for V6

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-09-06 07:45:04 -04:00
openshift-merge-bot[bot] dde031076b
Merge pull request #23722 from umohnani8/jobs
Add support for Job to kube generate & play
2024-09-06 09:02:55 +00:00
openshift-merge-bot[bot] 094fed7dbe
Merge pull request #23846 from flouthoc/prune-cleancachemount
prune: add `--build-cache` to support clearing build cache using `CleanCacheMount`
2024-09-05 18:47:56 +00:00
flouthoc 901f621daa
prune: support clearing build cache using CleanCacheMount
`podman builder prune` and `podman image prune` should also support
cleaning build cache using buildah's public `CleanCacheMount` API.

Reference: https://docs.docker.com/reference/cli/docker/builder/prune/
Context: https://github.com/containers/podman/discussions/15612#discussioncomment-10532721
Context: https://github.com/containers/buildah/pull/4490

Signed-off-by: flouthoc <flouthoc.git@gmail.com>
2024-09-05 10:40:07 -07:00
Urvashi Mohnani bdf96e7df2 Add support for Job to kube generate & play
The kube generate command can now generate a yaml for
the Job kind and the kube play command can create a pod
and containers with podman when passed in a Job yaml.
Add relevant tests and docs for this.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2024-09-05 11:36:38 -04:00
Mikel Olasagasti Uranga e9a4534cb1 Update module github.com/shirou/gopsutil to v4
Signed-off-by: Mikel Olasagasti Uranga <mikel@olasagasti.info>
2024-09-03 18:20:12 +02:00
openshift-merge-bot[bot] ef905ef8d0
Merge pull request #23726 from ashley-cui/machlist
machine: Add -all-providers flag to machine list
2024-08-30 16:52:31 +00:00
openshift-merge-bot[bot] 10363e1e81
Merge pull request #23766 from Luap99/http-attach
fix races in the HTTP attach API
2024-08-28 18:11:50 +00:00
Ashley Cui 41f945fc24 machine: Add -all-providers flag to machine list
Podman machine list now supports a new option, --all-providers, which lists all machines from all providers.

Signed-off-by: Ashley Cui <acui@redhat.com>
2024-08-28 13:40:50 -04:00
Paul Holzinger a89fef6e2a
cleanup: add new --stopped-only option
The podman container cleanup process runs asynchronous and by the time
it gets the lock it is possible another podman process already did the
cleanup and then did a new init() to start it again. If the cleanup
process gets the lock there it will cause very weird things.

This can be observed in the remote start API as CI flakes.

Fixes #23754

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-08-27 15:01:23 +02:00
Paul Holzinger dc724e5e80
run: fix detach passthrough and --rmi
When we use passthrough logging and the --rmi option should not try to
delete the image right away. Simply speak passthough only means do not
print the cotnainer id but we should never try to delete the image here
as this will be done in the cleanup process.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-08-27 12:11:32 +02:00
Paul Holzinger 8e78028e2c
podman run: ignore image rm error
Since commit 458ba5a8af the cleanup process now removes the image as
well, thus the removal is racy and it will cause an error here.

The code tried to ignore the error with errors.Is() but this never works
across the remote API. However the API already has a ignore option so
juts use that and fix the error message so that we can easily find the
root cause and I do not have to guess where the log was written.

Fixes #23719

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-08-27 12:06:03 +02:00
openshift-merge-bot[bot] e7905122d7
Merge pull request #23679 from ruihe774/pod-userns
quadlet: support user mapping in pod unit
2024-08-22 12:33:43 +00:00
Misaki Kasumi 4fbfa7de6e quadlet: support user mapping in pod unit
Signed-off-by: Misaki Kasumi <misakikasumi@outlook.com>
2024-08-22 09:41:06 +08:00
Daniel J Walsh 29071ac498
command is not optional to podman exec
Fixes: https://github.com/containers/podman/issues/22849

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-08-21 08:45:50 -04:00
Matt Heon 458ba5a8af Fix podman stop and podman run --rmi
This started off as an attempt to make `podman stop` on a
container started with `--rm` actually remove the container,
instead of just cleaning it up and waiting for the cleanup
process to finish the removal.

In the process, I realized that `podman run --rmi` was rather
broken. It was only done as part of the Podman CLI, not the
cleanup process (meaning it only worked with attached containers)
and the way it was wired meant that I was fairly confident that
it wouldn't work if I did a `podman stop` on an attached
container run with `--rmi`. I rewired it to use the same
mechanism that `podman run --rm` uses, so it should be a lot more
durable now, and I also wired it into `podman inspect` so you can
tell that a container will remove its image.

Tests have been added for the changes to `podman run --rmi`. No
tests for `stop` on a `run --rm` container as that would be racy.

Fixes #22852
Fixes RHEL-39513

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-08-20 09:51:18 -04:00
Paul Holzinger 942f789a88
set !remote build tags where needed
The new golangci-lint version 1.60.1 has problems with typecheck when
linting remote files. We have certain pakcages that should never be
inlcuded in remote but the typecheck tries to compile all of them but
this never works and it seems to ignore the exclude files we gave it.

To fix this the proper way is to mark all packages we only use locally
with !remote tags. This is a bit ugly but more correct. I also moved the
DecodeChanges() code around as it is called from the client so the
handles package which should only be remote doesn't really fit anyway.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-08-19 11:41:28 +02:00
Paul Holzinger c17daf2b09
update golangci-lint to 1.60.1
Fixes new spotted issues around printf() formats and using os.Setenv()
in tests.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-08-19 11:41:28 +02:00
Chad Dougherty 478b262f9b
remove trailing comma in example
Signed-off-by: Chad Dougherty <crd@acm.org>
2024-08-15 11:21:27 -04:00
openshift-merge-bot[bot] 708d6c5e2b
Merge pull request #23449 from ygalblum/quadlet-override-service-name
Quadlet override service name
2024-08-12 13:56:48 +00:00
openshift-merge-bot[bot] 7acaf714ca
Merge pull request #23496 from rhatdan/manifest
Should not force conversion of manifest type to DockerV2ListMediaType
2024-08-12 13:36:30 +00:00
Uzinn Kagurazaka b0948a5cd0
Quadlet: fix filters failure when the search paths are symlinks
Rootless units placed in `users` would be loaded for root when
`/etc/containers/systemd` is a symlink. In this case, since
`UnitDirAdmin` is hardcoded, `userLevelFilter` always returns `true`.
If `/etc/containers/systemd/users` is a symlink, any user would load
other users' units.
Fix the above two problems.

Fixes: #23483

Signed-off-by: Uzinn Kagurazaka <uzinn.kagurazaka@11555511.xyz>
2024-08-11 18:01:13 +08:00
Ygal Blum 795851edd3 Quadlet - Allow the user to override the default service name
Add support for the ServiceName key for all unit types
Extend the PodInfo struct into UnitInfo to consolidate all prepopulated data into a single map
Use the NodesInfo map instead of the resourceName
Update the UnitInfo in the convert function instead of returning it
No need to replace extension anymore just remove it
All e2e tests with dependencies on other Quadlet files moved to a separate section
Add the capability of overriding the service name in the test
Add e2e tests for the new functionality
Adjust integration tests
Update the MAN page

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2024-08-07 17:50:49 +03:00
Daniel J Walsh a06a7d7ba8
Should not force conversion of manifest type to DockerV2ListMediaType
Fixes: https://github.com/containers/podman/issues/23163

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-08-07 06:07:46 -04:00
tomsweeneyredhat b8a9b184af Add --compat-volumes option to build and farm build
Add the `--compat-volumes option from Buildah v1.37 into
Podman in preparation of Podman v5.2

Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2024-07-30 18:26:13 -04:00
Petter Mikkelsen cfac059d14 Disable compose-warning-logs if PODMAN_COMPOSE_WARNING_LOGS=false
Fixes: e62c928642 ("Make podman-compose refer to podman-compose(1) when using an external provider")

- test: add coverage for PODMAN_COMPOSE_WARNING_LOGS

Signed-off-by: Petter Mikkelsen <43xhyr9m@anonaddy.me>
2024-07-30 12:06:11 +00:00
Daniel J Walsh ce7dded38b
Add /run/containers/systemd, ${XDG_RUNTIME_DIR}/containers/systemd quadlet dirs
Fixes: https://github.com/containers/podman/issues/23363

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-07-24 09:28:00 -04:00
Paul Holzinger 85f4f89810
system connection remove: use Args function to validate
Using the ExactArgs(1) function is better because we have less
duplication of the error text and the ValidArgsFunction uses that to
suggest shell completion. The command before this commit would suggest
connection names even if there was already one arg on the cli set.

However because there is the --all option we still must exclude that
first.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-07-18 16:37:37 +02:00
openshift-merge-bot[bot] eecdba4009
Merge pull request #23304 from rhatdan/gpus
Remove references and checks for --gpus
2024-07-18 12:21:10 +00:00
benniekiss 3c52ef43f5 Expand drop-in search paths
* top-level (pod.d)
* truncated (unit-.container.d)

Signed-off-by: Bennie Milburn-Town <63211101+benniekiss@users.noreply.github.com>
2024-07-17 17:43:02 -04:00
Daniel J Walsh 5666100c2e
Remove references and checks for --gpus
No way to test this unless running on a nvidia platform.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-07-17 12:02:51 -04:00
openshift-merge-bot[bot] e225cae781
Merge pull request #23145 from afbjorklund/remove-machine-volume-driver
Remove the unused machine volume-driver
2024-07-15 20:36:19 +00:00
Anders F Björklund f3e945c86e Keep the volume-driver flag deprecated
Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
2024-07-15 21:41:34 +02:00
Giuseppe Scrivano 317a88ee4e
cmd: call shutdown handler stop function
it is needed to wait for the handlers if they are currently being processed.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-07-14 20:06:46 +02:00
openshift-merge-bot[bot] e62c928642
Merge pull request #23074 from marinmo/podman-compose-providerfix
Make podman-compose refer to podman-compose(1) when using an external provider
2024-07-12 13:48:33 +00:00
marinmo 02af4f8bd6 Update warning message when using external compose provider
Change the warning message at runtime to refer to the man page of podman-compose instead of "the documentation"

Add instructions in the man page on how to disable the warning emitted by podman-compose when using an external compose provider

Signed-off-by: marinmo <bugzilla@marinmo.org>
2024-07-12 07:12:32 +02:00
openshift-merge-bot[bot] 46840fa854
Merge pull request #23170 from Luap99/events
podman events: fix error race
2024-07-05 07:02:47 +00:00
openshift-merge-bot[bot] b3dab682b1
Merge pull request #22972 from BlackHole1/improve-error
refactor(build): improve err when file specified by -f does not exist
2024-07-03 12:59:16 +00:00
Paul Holzinger d00e68e550
podman events: fix error race
The events code makes use of two channels, one for the events and one
for the resulting error. Then in the main file we have a loop reading
from both channels that should exit on first error it gets.

However in case the event channel is closed before the error channel
cotains the error it could caused an early exit as it looked like all
events were done. Commit c46884aa93 fixed that somewhat by checking for
an error in the error channel before exiting. This however was still
racy as it added a default case in the select which means the channel
check is non blocking. Thus the error was not yet send into the channel.

To fix this we should make it a blocking read to wait for the error in
the channel. Also the err != nil check can be removed as we either
return err or nil anyway.

And as last step make sure the error channel is closed, that prevents us
from blocking forever in case the main select already processed the nil
error.

Fixes #23165

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-07-03 11:21:30 +02:00