Commit Graph

3854 Commits

Author SHA1 Message Date
openshift-merge-bot[bot] 39becc2f05
Merge pull request #24781 from ashley-cui/builtfor
Add BuildOrigin field to podman info
2025-02-04 20:13:27 +00:00
openshift-merge-bot[bot] 81431977e6
Merge pull request #25043 from jakecorrenti/machine-copy-files
Add `machine init --playbook`
2025-02-04 15:19:23 +00:00
Jake Correnti 297e8a3476 Add `machine init --playbook`
Allow the user to provide an Ansible playbook file on init which will
then be run on boot.

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
Signed-off-by: Brent Baude <bbaude@redhat.com>
2025-02-03 16:43:04 -05:00
Brent Baude bc2763eac8 Add --noheading to artifact ls
like images and containers, it could be handy to have a --noheading
option that removes the headings on the output.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2025-02-03 10:50:46 -06:00
Brent Baude d575ae12f8 Add --no-trunc to artifact ls
added a --no-trunc flag to artifact ls, which follows what images has
done.  by default now, the ls output will have the shortened 12
character digest.  the --no-trunc will output the full digest.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2025-01-31 16:19:18 -06:00
Brent Baude bd061aa2d5 Add type and annotations to artifact add
podman artifact add now supports two new command line switches.

--type string that describes the type of artifact
--annotation string slice in the form of key=val

These new options allow users to "tag" information in on their artifacts
for any number of purposes down the line

RUN-2446

Signed-off-by: Brent Baude <bbaude@redhat.com>
2025-01-31 09:53:03 -06:00
Ashley Cui d3706bcad1 Add BuildOrigin field to podman info
BuildOrigin is a field that can be set at build time by packagers. This helps us trace how and where the binary was built and installed from, allowing us to see if the issue is due to a specfic installation or a general podman bug. This field shows up in podman version and in podman info when populated. Note that podman info has a new field, Client, that only appears when running podman info using the remote client.

Automatically set the BuildOrigin field when building the macOS pkginstaller to pkginstaller.

Usage: make podman-remote BUILD_ORIGIN="mypackaging"

Signed-off-by: Ashley Cui <acui@redhat.com>
2025-01-30 14:48:30 -05:00
openshift-merge-bot[bot] 48f8742278
Merge pull request #25155 from baude/movedetect
Move detection of libkrun and intel
2025-01-30 15:37:07 +00:00
openshift-merge-bot[bot] be5d807b62
Merge pull request #25164 from giuseppe/replace-walk
util: replace Walk with WalkDir
2025-01-30 13:36:06 +00:00
Giuseppe Scrivano 1f3182009a
util: replace Walk with WalkDir
Closes: https://github.com/containers/podman/issues/25163

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2025-01-30 11:53:34 +01:00
Brent Baude 398377fd97 Move detection of libkrun and intel
A review comment post merge suggested I move the detection of libkrun and intel into the provider.Get()

Signed-off-by: Brent Baude <bbaude@redhat.com>
2025-01-29 13:26:45 -06:00
Brent Baude e893747cf3 Remove unnecessary error handling
A function in the reset code does not return an error.  Simply removing the error variable and check for the condition (which was always false or nil)

Signed-off-by: Brent Baude <bbaude@redhat.com>
2025-01-29 12:12:17 -06:00
Brent Baude 357f76daae error with libkrun on intel-based machines
libkrun is not supported on Intel.  We should error.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2025-01-28 14:12:44 -06:00
openshift-merge-bot[bot] 8d65d1e9e2
Merge pull request #25102 from Honny1/prune
Clean up after unexpectedly terminated build
2025-01-27 16:52:06 +00:00
openshift-merge-bot[bot] 9403c3d98d
Merge pull request #24678 from rhatdan/manifest
Add podman manifest rm --ignore
2025-01-27 14:52:05 +00:00
Jan Rodák 81eb84fdaa
Clean up after unexpectedly terminated build
The `podman system prune` command is able to remove build containers that were created during the build, but were not removed because the build terminated unexpectedly.

By default, build containers are not removed to prevent interference with builds in progress. Use the **--build** flag when running the command to remove build containers as well.

Fixes: https://issues.redhat.com/browse/RHEL-62009

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2025-01-27 14:21:27 +01:00
Paul Holzinger 5522def65a
do not set the CreateCommand for API users
This should be set only by podman as it is used for the podman generate
systemd --new command. For the api it was set to the system service
command which is simply pointless. It must be empty in these cases.

Fixes #25026

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-01-22 19:13:08 +01:00
Daniel J Walsh 5181becfde
Add podman manifest rm --ignore
When removing manifests, users should be allowed to ignore
ones that no longer exists.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2025-01-22 11:43:47 -05:00
Brent Baude d7553fabc7 podman artifact
the podman artifact verb is used to manage OCI artifacts.  the following
verbs were added to `podman artifact`:

* add
* inspect
* ls
* pull
* push
* rm

Notable items with this PR:

* all artifact commands and their output are subject to change. i.e.
  consider all of this tech preview
* there is no way to add a file to an artifact that already exists in
  the store.  you would need to delete and recreate the artifact.
* all references to artifacts names should be fully qualified names in
  the form of repo/name:tag (i.e. quay.io/artifact/foobar:latest)
* i understand that we will likely want to be able to attribute things
  like arch, etc to artifact files.  this function is not available yet.

Many thanks to Paul Holzinger for autocompletion PRs and review PRs that
fixed issues early on.

Also fix up some Args function to specify the correct number of args.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Signed-off-by: Brent Baude <bbaude@redhat.com>
2025-01-21 12:47:30 -06:00
openshift-merge-bot[bot] d4fce5178f
Merge pull request #24974 from rhatdan/quadlet
Switch all calls of assert.Nil to assert.NoError
2025-01-20 14:34:13 +00:00
Valentin Rothberg 34d42514f1 compose docs: fix typo
Fix the typo s/provider/providers/ and give a concrete example to avoid
pitfalls such as the on in #25023.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2025-01-17 08:30:45 +01:00
openshift-merge-bot[bot] a3bb0a1a2f
Merge pull request #25008 from rhatdan/hostname
Add --no-hostname option
2025-01-16 17:14:40 +00:00
openshift-merge-bot[bot] 834a1c9798
Merge pull request #24966 from silver886/patch-2
Remove `.exe` suffix if any in completion
2025-01-16 16:33:28 +00:00
Daniel J Walsh 3fb37c588d
Switch all calls of assert.Nil to assert.NoError
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2025-01-15 07:08:27 -05:00
Daniel J Walsh 6565bde6e8
Add --no-hostname option
Fixes: https://github.com/containers/podman/issues/25002

Also add the ability to inspect containers for
UseImageHosts and UseImageHostname.

Finally fixed some bugs in handling of --no-hosts for Pods,
which I descovered.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2025-01-15 06:51:32 -05:00
Leo Liu a91aa36367 Remove `.exe` suffix if any
Signed-off-by: Leo Liu <silver886@users.noreply.github.com>

Add comment

In shell completion, there is `.exe` suffix on Windows and this does not provide same experience across platforms, #16499

Signed-off-by: Leo Liu <silver886@users.noreply.github.com>

Create unit test for `.exe` suffix removal

Signed-off-by: Leo Liu <11664880+silver886@users.noreply.github.com>

Update comments

Signed-off-by: Leo Liu <11664880+silver886@users.noreply.github.com>
2025-01-14 11:53:19 -08:00
Leo Liu 6dba0d9586
Update description for completion
Signed-off-by: Leo Liu <silver886@users.noreply.github.com>
2025-01-07 18:52:31 -08:00
openshift-merge-bot[bot] 0642bb1c25
Merge pull request #24861 from Luap99/debian-fixes
Some debian test fixes
2024-12-19 11:42:58 +00:00
openshift-merge-bot[bot] 7ba410aa76
Merge pull request #24760 from Honny1/fix-major-minor-nums
Fix device limitations in `podman-remote update` on remote systems
2024-12-18 14:15:11 +00:00
Paul Holzinger 153a975888 shell completion: respect CONTAINERS_REGISTRIES_CONF
Found in debian testing where by default there are no unqualified search
registries installed. As such the test failed as the FIXME said. Now
there is no need for the test to assume anything.

Instead set our own config via CONTAINERS_REGISTRIES_CONF then we can
do exact matches, except that env was not read in the shell completion
code so move some code around to make it read the var in the same way as
podman login/logout.

Signed-off-by: Paul Holzinger <git@holzinger.dev>
2024-12-17 16:29:40 +01:00
Jan Rodák 2f31a61cce
Fix device limitations in podman-remote update on remote systems
Fixes: https://issues.redhat.com/browse/RUN-2381

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2024-12-09 17:35:56 +01:00
Nalin Dahyabhai 8f45474809 Fix panic in `manifest annotate --index`
When the --index flag is used, `manifest annotate` shouldn't be
expecting a second non-flag argument.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2024-12-06 15:31:01 -05:00
Arthur Sengileyev ededb4c3c4 Improve platform specific URL handling in `podman compose` for machines
Use filepath utility instead of generic string replace to convert path
on Windows. This also separates OS specific implementations to separate
compilation sources and removes redundant check for virtualization
provider on Windows platform.

Signed-off-by: Arthur Sengileyev <arthur.sengileyev@gmail.com>
2024-12-02 20:46:51 +02:00
Gavin Lam 4f7395f93a
Add --hosts-file flag to container and pod commands
* Add --hosts-file flag to container create, container run and pod create
* Add HostsFile field to pod inspect and container inspect results
* Test BaseHostsFile config in containers.conf

Signed-off-by: Gavin Lam <gavin.oss@tutamail.com>
2024-11-24 22:00:34 -05:00
openshift-merge-bot[bot] d85ac938e6
Merge pull request #24442 from Honny1/change-healthcheck-config-via-podman-update
Configure HealthCheck with `podman update`
2024-11-22 15:57:30 +00:00
Jan Rodák a1249425bd
Configure HealthCheck with `podman update`
New flags in a `podman update` can change the configuration of HealthCheck when the container is started, without having to restart or recreate the container.

This can help determine why a given container suddenly started failing HealthCheck without interfering with the services it provides. For example, reconfigure HealthCheck to keep logs longer than the usual last X results, store logs to other destinations, etc.

Fixes: https://issues.redhat.com/browse/RHEL-60561

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2024-11-19 19:44:14 +01:00
Paul Holzinger 9eca92d625
update golangci-lint to v1.62.0
- fix issues found by recvcheck
- skip k8s files from recvcheck
- remove two removed linters gomnd and execinquery

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-11-11 14:21:17 +01:00
openshift-merge-bot[bot] 0f25d9ee15
Merge pull request #24406 from Luap99/event-api-response
fix API issue about missing the status code in the events and logs endpoints
2024-11-04 18:54:14 +00:00
Paul Holzinger 768ad8653a
rework event code to improve API errors
One of the problems with the Events() API was that you had to call it in
a new goroutine. This meant the the error returned by it had to be read
back via a second channel. This cuased other bugs in the past but here
the biggest problem is that basic errors such as invalid since/until
options were not directly returned to the caller.
It meant in the API we were not able to write http code 200 quickly
because we always waited for the first event or error from the
channels. This in turn made some clients not happy as they assume the
server hangs on time out if no such events are generated.

To fix this we resturcture the entire event flow. First we spawn the
goroutine inside the eventer Read() function so not all the callers have
to. Then we can return the basic error quickly without the goroutine.
The caller then checks the error like any normal function and the API
can use this one to decide which status code to return.
Second we now return errors/event in one channel then the callers can
decide to ignore or log them which makes it a bit more clear.

Fixes c46884aa93 ("podman events: check for an error after we finish reading events")
Fixes #23712

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-11-01 18:54:13 +01:00
Alicia Boya García 37c8e10031 doc: explain --interactive in more detail
Clarifies the behavior of --interactive in both attached and unattached
scenarios.

Adds a caveat and explanation for --interactive being hungry as
described in https://github.com/containers/podman/issues/24370.

Signed-off-by: Alicia Boya García <aboya@igalia.com>
2024-11-01 08:23:08 +01:00
Paul Holzinger 0cdb9b3b22
ps: fix display of exposed ports
This fixes two problems, first if a port is published and exposed it
should not be shown twice. It is enough to show the published one.

Second, if there is a huge range the ports were no grouped causing the
output to be unreadable basically. Now we group exposed ports like we do
with the normal published ports.

Fixes #23317

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-10-23 15:03:30 +02:00
Paul Holzinger 73fb6623cd
ps: do not loop over port protocol
This can never included a comma in the protocol so it just complicated
things for no reason, we never needed this and commit edc3dc5e11 already
ensures this cannot happen.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-10-23 14:56:26 +02:00
openshift-merge-bot[bot] d5be88e0c2
Merge pull request #24228 from giuseppe/do-not-lower-rlimits
podman: do not set rlimits to the default value
2024-10-15 22:02:52 +00:00
Zachary Hanham feb46513f0 scp: add option types
Prior to this commit, many scp functions existed without option structs, which would make extending functionality (adding new options) impossible without breaking changes, or without adding redundant wrapper functions.

This commit adds in new option types for various scp related functions, and changes those functions' signatures to use the new options.

This commit also modifies the `ImageEngine.Scp()` function's interface to use the new opts.

The commit also renames the existing `ImageScpOptions` entity type to `ScpTransferImageOptions`. This is because the previous `ImageScpOptions` was inaccurate, as it is not the actual options for `ImageEngine.Scp()`. `ImageEngine.Scp()` should instead receive `ImageScpOptions`.

This commit should not change any behavior, however it will break the existing functions' signatures.

Signed-off-by: Zachary Hanham <z.hanham00@gmail.com>
2024-10-14 21:46:55 -04:00
Giuseppe Scrivano 3d57560a21
cmd: use logrus to print error
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-10-11 23:24:37 +02:00
Giuseppe Scrivano 71d5ee0e04
podman: do not set rlimits to the default value
since the effect would be to lower the rlimits when their definition
is higher than the default value.

The test doesn't fail on the previous version, unless the system is
configured with a nofile ulimit higher than the default value.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2317721

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-10-11 23:04:27 +02:00
Paul Holzinger 45df394072
server: fix url parsing in info
When we are activated by systemd the code assumed that we had a valid
URL which was not the case so it failed to parse the URL which causes
the info call to fail all the time.
This fixes two problems first add the schema to the systemd activated
listener URL so it can be parsed correctly but second simply do not
parse it as url as all we care about in the info call is if it is unix
and the file path exists.

Fixes #24152

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-10-07 12:03:56 +02:00
Ed Santiago 043b82ef59
Fixes for vendoring Buildah
This commit was automatically cherry-picked
by buildah-vendor-treadmill v0.3
from the buildah vendor treadmill PR, #13808

  * Fix conflict caused by Ed's local-registry PR in buildah
  * Wire in "new" --retry and --retry-delay, these existed for longer
    but where non functional.

Signed-off-by: Ed Santiago <santiago@redhat.com>
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-10-02 18:38:38 +02:00
Sainath Sativar e07c31068f adding docs for network-cmd-path
Signed-off-by: Sainath Sativar <Sativar.sainath@gmail.com>
2024-09-30 10:41:10 +01:00
openshift-merge-bot[bot] adbb735958
Merge pull request #23945 from jakecorrenti/default-conn
Handle default system connection transfer properly on machine removal
2024-09-27 13:55:08 +00:00