3913 Commits

Author SHA1 Message Date
522934d5cf Replace strings.SplitN with strings.Cut
Cut is a cleaner & more performant api relative to SplitN(_, _, 2) added in go 1.18

Previously applied this refactoring to buildah:
https://github.com/containers/buildah/pull/5239

Signed-off-by: Philip Dubé <philip@peerdb.io>
2024-01-11 13:50:15 +00:00
5ddf92079f Merge pull request #21095 from liuming50/support-config-option
cmd: support --config option
2024-01-10 11:04:45 +00:00
4e4c3e3dbf cmd: support --config option to locate authentication file
Let's support --config option by setting environment variable
DOCKER_CONFIG instead of ignoring it for docker compatibility, so
it could be used to locate config.json as authentication file.

Also add a test case for this change, remove the deprecated one.

Signed-off-by: Ming Liu <liu.ming50@gmail.com>
2024-01-10 09:31:43 +01:00
83fa4843f6 Fix podman machine ssh command
Signed-off-by: Shion Tanaka <shtanaka@redhat.com>
2024-01-10 14:30:24 +09:00
92144024ae Merge pull request #21177 from rhatdan/latest
Remove --latest from podman CMD --help output
2024-01-08 20:20:52 +00:00
3b18c77712 Merge pull request #20878 from ashley-cui/winapiforwarding
Add API forwarding support for HyperV
2024-01-08 20:07:23 +00:00
0a316fa7d4 Merge pull request #21171 from alexandear/refactor-slices-contains
Refactor: replace StringInSlice with slices.Contains
2024-01-05 17:49:26 +00:00
e3f167f770 Add API forwarding support for HyperV
Provides Docker API client access, allowing compose to work by default
for HyperV. Basically the HyperV equiv of the work done here by #12916.

[NO NEW TESTS NEEDED]

Signed-off-by: Ashley Cui <acui@redhat.com>
2024-01-05 11:45:28 -05:00
8341ca0e7b Remove --latest from podman CMD --help output
Because --latest is not supported on podman-remote commands
we should not be showing examples using podman-remote CMD --help
with --latest usage, it confuses users. Rather then hacking up
the code with if remote else --latest, it is better to just remove
information in help messages.

Prevents: https://github.com/containers/podman/issues/21174

[NO NEW TESTS NEEDED] Since normal tests should cover this.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-01-05 10:37:51 -05:00
8bdf77aa20 Refactor: replace StringInSlice with slices.Contains
Signed-off-by: Oleksandr Redko <Oleksandr_Redko@epam.com>
2024-01-05 16:25:56 +02:00
9c80f358fb Merge pull request #21125 from jakecorrenti/single-ssh-key
machine: Use a single ssh key for all machines
2024-01-05 12:55:41 +00:00
b01a330d37 Use single persistent ssh key for all machines
Changes SSH key behavior such that there is a single persisted key for all
machines across all providers. If there is no key that is located at
`.local/share/containers/podman/machine/` then it is created. The keys are
not deleted when the last machine on the host is removed.

The main motivation for this change is it leads to fewer files created on the
host as a result of vm configuration. Having `n` machines on your system doesn't
result in `2n` machine-related files in `.ssh` on your system anymore.

As a result of ssh keys being persisted by default, the `--save-keys` flag
on `podman machine rm` will no longer be supported.

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2024-01-04 23:47:49 -05:00
f0319d5b7a Error messages not being reported unless more then one error present
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-01-04 14:23:04 -05:00
c728eeb39e Create pkg/machine/ignition package
Moves all of the ignitionfiles out of the `machine` package and into
its own called `ignition`. This required `VMType` to get moved out of
the `machine` package and into the `define` package in order to prevent
a circular dependency.

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2024-01-04 08:51:35 -05:00
2a2d0b0e18 chore: delete obsolete // +build lines
Signed-off-by: Oleksandr Redko <Oleksandr_Redko@epam.com>
2024-01-04 11:53:38 +02:00
d026ccf9a7 Kube Play - pass arguments to build
Create a buildah SystemContext from the existing cli arguments
Pass the SystemContext to the build
Add system test

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-12-14 16:31:09 +02:00
4582b61d7c Merge pull request #20958 from rhatdan/ps
Support podman ps --format '{{ .Label label }}'
2023-12-13 14:26:17 +00:00
5db4224427 Merge pull request #20976 from Luap99/string-array
cli: use StringArray over StringSlice Part 2
2023-12-13 12:22:31 +00:00
f51ff77644 Support podman ps --format '{{ .Label label }}'
Also Support for podman pod ps  --format '{{ .Label label }}'

Finally fix support for --format '{{ .Podname }}'
   When user specifies .Podname this implies --pod was passed.

Fixes: https://github.com/containers/podman/issues/20957

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-12-13 07:09:54 -05:00
e5a4f00b7d Podman 5 machine config file - Step 1
The following PR is the very first step in what will a series of steps
to apply a "common" machine configuration file to all providers.
Function names, method names, struct names, and field names are all up
for debate.  The purpose of this PR is to offer a glimpse at the
direction we intend to take.

This PR also contains temporary structs (i.e. aThing) that are not
exported.  These are merely placeholders.

The configuration work in this PR is also unused of yet.  But the code
is compiled.  Once merged, we can begin the next step of development.

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-12-11 16:26:15 -06:00
0f02e43cee cli: podman manifest annotate --annotation use StringArray()
This option accepts arbitrary input so we should allow commas in it.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-11 15:43:21 +01:00
d8c3e5b3c1 cli: podman manifest add --annotation use StringArray()
This option accepts arbitrary input so we should allow commas in it.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-11 15:43:21 +01:00
3e10a68328 cli: podman kube play --configmap use StringArray()
This option accepts a file path so we should allow commas in it.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-11 15:43:21 +01:00
2be4b007b0 cli: podman kube play --log-opt use StringArray()
This option accepts arbitrary input so we should allow commas in it.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-11 15:43:21 +01:00
48ab4aec31 podman kube play: fix broken annotation parsing
If a user did not set an equal sign in the annotation that old code
would panic when accessing the second element in the slice.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-11 15:43:21 +01:00
e916f49f0b cli: podman kube play --annotation use StringArray()
This option accepts arbitrary input so we should allow commas in it.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-11 15:43:20 +01:00
47b65086ee cli: podman image trust set --pubkeysfile use StringArray()
This option accepts a file path so we should allow commas in it.
There ar eno tests for this option, I have no idea what this option does
nor how to use it so I cannot write one.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-11 15:43:20 +01:00
cdb178e954 cli: podman push --encryption-key use StringArray()
This option accepts a file path so we should allow commas in it.
Also add tests for --decryption-key

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-11 15:43:20 +01:00
3e1b9146f7 cli: podman pull --decryption-key use StringArray()
This option accepts a file path so we should allow commas in it.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-11 15:43:20 +01:00
c87311b6d5 Merge pull request #20945 from Luap99/string-array
cli: use StringArray over StringSlice Part 1
2023-12-09 21:11:39 +00:00
06cee546a3 cli: podman exec --env-file use StringArray()
This option accepts a file path so we should allow commas in it.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-08 15:06:23 +01:00
7866f6c6e1 cli: podman run/create --blkio-weight-device use StringArray()
This option accepts a file path so we should allow commas in it.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-08 15:06:23 +01:00
432be13301 cli: podman run/create --device-{read,write}-bps use StringArray()
This option accepts a file path so we should allow commas in it.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-08 15:06:23 +01:00
8de13271ca cli: podman run/create --device-{read,write}-iops use StringArray()
This option accepts a file path so we should allow commas in it.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-08 15:06:23 +01:00
e763cc62b7 cli: podman run/create --device use StringArray()
This options accepts a file path so we should allow commas in it.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-08 15:06:23 +01:00
19571f7509 cli: podman run/create --label-file use StringArray()
This option accepts a file path so we should allow commas in it.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-08 15:06:22 +01:00
24d08a94d8 cli: podman run/create --decryption-key use StringArray()
This option accepts a file path so we should allow commas in it.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-08 15:06:10 +01:00
201920f6a4 cli: podman run/create --chrootdirs use StringArray()
This options accepts a file path so we should allow commas in it.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-08 12:17:02 +01:00
dbbec99361 cli: podman run/create --log-opt use StringArray()
This option accepts arbitrary input so we should allow commas in it.

Fixes #20064

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-08 12:17:01 +01:00
b011aa4430 cli: podman run/create --env-file use StringArray()
This option accepts a file path so we should allow commas in it.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-08 12:17:01 +01:00
ef10073b51 cli: podman run/create --annotation use StringArray()
This option accepts arbitrary input so we should allow commas in it.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-08 12:17:01 +01:00
c5258d4630 cli: podman --hooks-dir use StringArray()
This option accepts a file path so we should allow commas in it.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-08 12:17:01 +01:00
12c39ffda2 cli: podman --module use StringArray()
This option accepts a file path so we should allow commas in it.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-08 12:17:01 +01:00
c97560841f cli: add docs for StringArray vs StringSlice options
In short always use StringArray over StringSlice.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-08 12:16:52 +01:00
19457f3823 system service: split out cgroups call into linux specific file
So that we do not cause compile errors on freebsd.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-07 11:26:36 +01:00
a687c38860 use rootless netns from c/common
Use the new rootlessnetns logic from c/common, drop the podman code
here and make use of the new much simpler API.

ref: https://github.com/containers/common/pull/1761

[NO NEW TESTS NEEDED]

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-07 11:24:46 +01:00
67aae8e62e Merge pull request #20866 from giuseppe/add-preserve-fds-list
podman: new option --preserve-fd
2023-12-06 13:34:34 +00:00
01d397a658 podman: new option --preserve-fd
add a new option --preserve-fd that allows to specify a list of FDs to
pass down to the container.

It is similar to --preserve-fds but it allows to specify a list of FDs
instead of the maximum FD number to preserve.

--preserve-fd and --preserve-fds are mutually exclusive.

It requires crun since runc would complain if any fd below
--preserve-fds is not preserved.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-12-05 10:16:41 +01:00
212b4c9e93 Quadlet .pod - add support for the Network Key
Add e2e tests
Update documentation

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-12-03 10:22:33 +02:00
bc124dd13f Merge pull request #20819 from cgiradkar/20752_farm_flag_move
Move the --farm flag to farm build command
2023-12-01 21:12:38 +00:00