Commit Graph

3636 Commits

Author SHA1 Message Date
OpenShift Merge Robot 832b098471
Merge pull request #18303 from n1hility/user-mode
Add user-mode networking feature to Windows/WSL
2023-04-26 16:01:48 -04:00
huangyanfeng e95e9be76b fix manifest annotate help
[NO NEW TESTS NEEDED]
Signed-off-by: huangyanfeng <huangyanfeng1992@gmail.com>
2023-04-26 11:15:29 +08:00
OpenShift Merge Robot 0cf423f1dd
Merge pull request #18313 from c4rlo/patch-1
system/reset.go: help: fix typo
2023-04-25 05:19:15 -04:00
Jason T. Greene 230ddbe0ca Add user mode networking feature to Windows
Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2023-04-24 17:11:54 -05:00
Carlo Teubner 3216110de7 system/reset.go: help: fix typo
[NO NEW TESTS NEEDED]

Signed-off-by: Carlo Teubner <435950+c4rlo@users.noreply.github.com>
2023-04-24 22:08:11 +01:00
Paul Holzinger c5a928c5b7
ps: --format {{.State}} match docker output
We should return the raw state string without any extra formatting in
this case.
`{{.Status}}` returns the nicely formatted string used in the default ps
output, e.g. `Up 2 seconds ago`, while `{{.State}}` returns the state as
string, e.g. `running`.

This matches the docker output and allows better use in scripts.

Fixes #18244

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-04-24 14:18:26 +02:00
Jason T. Greene fb3b92b969 Eliminate transient container deps from wslkerninst
Resolves Win Installer CI issues where dep processing variance can
pull in gpgme, which doesn't compile on Windows without a
specialized msys2 setup.

Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2023-04-23 17:11:55 -05:00
Tobias Klauser 70bd096e47
cmd/podman/pods: omit superfluous runtime.NumCPU call
sysinfo.NumCPU already falls back to runtime.NumCPU in case the
platform-specific sysinfo.numCPU returns 0, see
554799639f/pkg/sysinfo/numcpu.go (L8-L13)

Also omit a second call to sysinfo.NumCPU and use the result from the
earlier call.

[NO NEW TESTS NEEDED]

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2023-04-21 14:28:56 +02:00
openshift-ci[bot] 1821f97ade
Merge pull request #18284 from vrothberg/fix-18216
support `--digestfile` for remote push
2023-04-21 10:24:15 +00:00
Valentin Rothberg 1f1525f2e1 support `--digestfile` for remote push
Wire in support for writing the digest of the pushed image to a
user-specified file.  Requires some massaging of _internal_ APIs
and the extension of the push endpoint to integrate the raw manifest
(i.e., in bytes) in the stream.

Closes: #18216
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-04-21 10:28:40 +02:00
rbagd 6e0cf93447 Fixes format inconsistencies with docker for certain history fields
Closes #17767
Closes #17768

System test for image list and history dates

* Changed field separator in the test to `;` for easier parsing
* Converted date output from image history and image list to be comparable

Signed-off-by: rbagd <mail@rbagd.eu>
2023-04-19 00:20:47 +02:00
Park Jaeon d38b22d507
fix: Document removing anonymous volumes at create
[NO NEW TESTS NEEDED]
Signed-off-by: Park Jaeon <me@finalchild.dev>
2023-04-12 09:44:50 +09:00
OpenShift Merge Robot 3a47342a6a
Merge pull request #18002 from Luap99/netavark-plugin
add netavark plugin support
2023-04-11 13:37:43 -04:00
Paul Holzinger ed99a979ce
network create: add --interface-name
Allow users to customize the network_interface option is the network
config. For bridge this allows users to change the bridge name and for
maclvan it will be the same as `--opt parent=...`.
However the main reason for this option is to allow netavark plugins to
make use of it. I demoed the host-device plugin which makes use of this
as an example. While we could let users set them via --opt it is more
natural to just use the field which is designed for that purpose.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-04-11 17:04:33 +02:00
Urvashi Mohnani 1bf5bdc689 Read kube_generate_type from containers.conf
Use the kube_generate_type from the containers.conf as
the default value for the --type flag for kube generate.
Override the default when userexplicitly sets the --type
flag.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2023-04-11 09:15:05 -04:00
Aditya R 944accffaf
build: pass env by reference
Buildah uses a different logic to pass environment variable to executor
now after: https://github.com/containers/buildah/pull/4702/files so
podman should same logic and pass env by reference.

Signed-off-by: Aditya R <arajan@redhat.com>
2023-04-10 20:31:23 +05:30
Aditya R 260bc3ec4c
vendor: bump containers/(storage, common, buildah, image)
Bump containers/(storage, common, buildah and image)

Changes since 2023-01-01:
 - skip mount-cache-selinux-long-name test under remote, with
   a FIXME requesting that someone see if it can be made to work.

 - skip six tests that fail under rootless-remote

 - add new --build-arg-file option:
 - update man page

Squash of:
* cf56eb1865
* 561f082772

Signed-off-by: Ed Santiago <santiago@redhat.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Signed-off-by: Aditya R <arajan@redhat.com>
2023-04-10 17:30:14 +05:30
Eng Zer Jun 35165df37b
chore: replace `github.com/ghodss/yaml` with `sigs.k8s.io/yaml`
At the time of making this commit, the package `github.com/ghodss/yaml`
is no longer actively maintained.

`sigs.k8s.io/yaml` is a permanent fork of `ghodss/yaml` and is actively
maintained by Kubernetes SIG.

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2023-04-06 21:11:17 +08:00
OpenShift Merge Robot e179079351
Merge pull request #18038 from vrothberg/quadlet-version
add `quadlet -version` flag
2023-04-04 09:01:00 -04:00
Valentin Rothberg 243ca7c280 add `quadlet -version` flag
I recently wanted to check which version of Quadlet I was using and
found a `-version` flag to be missing.  Since Quadlet and Podman are
bundled together, it seems reasonable to me for them to share the same
version.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-04-04 11:32:47 +02:00
Valentin Rothberg 53b16ccd26 quadlet: use `Flag` suffix for variables
Purely cosmetic change for consistency.

[NO NEW TESTS NEEDED]  as it doesn't change functionality.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-04-04 09:55:14 +02:00
OpenShift Merge Robot 98933456bc
Merge pull request #17950 from umohnani8/deployments
Support Deployment generation with kube generate
2023-04-03 11:08:29 -04:00
Ygal Blum 68dbddd979 Add support for secret exists
Add the command along with the abi and tunnel support
Add e2e tests
Add man page
Add apiv2 test to ensure return codes

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-04-03 15:33:50 +03:00
Urvashi Mohnani 4f90194068 Support Deployment generation with kube generate
The podman kube generate command can now generate a
Deployment kind when the --ype flag is set to deployment.
By default, a Pod spec will be generated if --type flag is
not set.
Add --replicas flag to kube generate to allow users to set
the value of replicas in the generated yaml when generating a
Deployment kind.
Add e2e and minikube tests for this feature.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2023-03-31 13:34:38 -04:00
Paul Holzinger 4f3cbf15cf
podman-mac-helper: install: do not error if already installed
Since commit bae07b6ea2 we exit with 1 one errors. This caused problem
for the mac installer which fails because of the error now.
If the helper is already installed do not treat this as hard error and
just log it instead.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-03-24 15:34:30 +01:00
Daniel J Walsh 5f274e45f2
Run make codespell
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-03-21 16:00:54 -04:00
OpenShift Merge Robot 060c125b78
Merge pull request #17838 from baude/addhv1
basic hypverv machine implementation
2023-03-20 10:40:30 -04:00
OpenShift Merge Robot 9ddd4f4abd
Merge pull request #17600 from sstosh/search-auth-opts
Add search --cert-dir, --creds
2023-03-20 04:00:04 -04:00
Brent Baude 0dac214f56 basic hypverv machine implementation
with libhvee, we are able to do the basics of podman machine management
on hyperv.  The basic functions like init, rm, stop, and start are all
functional.  Start and stop will periodically throw a benign error
processing the hyperv message being returned from the action.  The error
is described in the todo's below.

notable items:

* no podman commands will work (like ps, images, etc)
* the machine must be initialized with --image-path and fed a custom image.
* disk size is set to 100GB statically.
* the vm joins the default hyperv network which is TCP/IP network based.
* podman machine ssh does not work
* podman machine set does not work
* you can grab the ip address from hyperv and fake a machine connection
  with `podman system connection`.
* when booting, use the hyperv console to know the boot is complete.

TODOs:
* podman machine ssh
* podman machine set
* podman machine rm needs force bool
* disk size in NewMachine is set to 100GB
* podman start needs to wait until fully booted
* establish a boot complete signal from guest
* implement gvproxy like user networking
* fix benign failures in stop/start -> Error: error 2147749890 (FormatMessage failed with: The system cannot find message text for message number 0x%1 in the message file for %2.)

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-03-17 16:02:28 -05:00
OpenShift Merge Robot 2718f54a29
Merge pull request #17729 from rhatdan/selinux
Support running nested SELinux container separation
2023-03-15 12:07:03 -04:00
Toshiki Sonoda 82f2f8258c Add search --cert-dir, --creds
When we searching any image at a container registry,
--cert-dir and --creds could be required
as well as push, pull, etc.

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
2023-03-15 15:01:26 +09:00
OpenShift Merge Robot 68bf49799d
Merge pull request #17786 from Luap99/mac-helper-error
podman-mac-helper: exit 1 on error
2023-03-14 18:21:33 -04:00
Paul Holzinger bae07b6ea2
podman-mac-helper: exit 1 on error
We should return a proper exit code to signal the failure.

[NO NEW TESTS NEEDED] We do have any tests on macOS.

Fixes #17785

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-03-14 17:56:22 +01:00
Valentin Rothberg 4562e61d20 podman events: unhide --stream
The --stream flag is being used extensively in the tests and some blog
posts refer to it which has been causing some confusion on why the flag
was hidden.  I do not see a good reason to hide it anymore, so unhide it
and add some docs.

[NO NEW TESTS NEEDED] as it's already being tested.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-03-14 11:26:50 +01:00
Daniel J Walsh ad8a96ab95
Support running nested SELinux container separation
Currently Podman prevents SELinux container separation,
when running within a container. This PR adds a new
--security-opt label=nested

When setting this option, Podman unmasks and mountsi
/sys/fs/selinux into the containers making /sys/fs/selinux
fully exposed. Secondly Podman sets the attribute
run.oci.mount_context_type=rootcontext

This attribute tells crun to mount volumes with rootcontext=MOUNTLABEL
as opposed to context=MOUNTLABEL.

With these two settings Podman inside the container is allowed to set
its own SELinux labels on tmpfs file systems mounted into its parents
container, while still being confined by SELinux. Thus you can have
nested SELinux labeling inside of a container.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-03-13 14:21:12 -04:00
OpenShift Merge Robot 76642d5ad3
Merge pull request #17684 from giuseppe/version-no-userns
cmd: do not require userns for "version"
2023-03-03 16:56:05 +01:00
OpenShift Merge Robot 3f0f558609
Merge pull request #17677 from vyasgun/pr/system-default-connection
fix: update the default machine value when the previously set default machine is deleted
2023-03-03 14:50:12 +01:00
Giuseppe Scrivano 0498ce3a56
cmd: do not require userns for "version"
Closes: https://github.com/containers/podman/issues/17657

[NO NEW TESTS NEEDED]

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-03-03 14:27:54 +01:00
Giuseppe Scrivano 2860d55c97
cmd: drop special handling for "scp"
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-03-03 14:27:54 +01:00
Giuseppe Scrivano da04469f06
cmd: clarify meaning of ParentNSRequired
there are no commands that are not supported by rootless mode, but
some commands require to run in the user namespace.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-03-03 14:27:54 +01:00
Valentin Rothberg e77f370f86 sqlite: add a hidden --db-backend flag
Add a hidden flag to set the database backend and plumb it into
podman-info.  Further add a system test to make sure the flag and the
info output are working properly.

Note that the test may need to be changed once we settled on how
to test the sqlite backend in CI.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-03-02 13:43:11 +01:00
vyasgun cca65db01d fix: update the default machine value when the previously set default machine is deleted
[NO NEW TESTS NEEDED]

Fixes: https://github.com/containers/podman/issues/16483
Signed-off-by: vyasgun <vyasgun20@gmail.com>
2023-03-02 11:06:56 +05:30
OpenShift Merge Robot 8457bb5542
Merge pull request #16717 from umohnani8/detach
play kube: Add --wait option
2023-03-01 16:46:54 +01:00
OpenShift Merge Robot 02a77d27a2
Merge pull request #17450 from danishprakash/add-group-entry
create: add entry to /etc/group via `--group-entry`
2023-02-28 21:59:59 +01:00
Urvashi Mohnani 20a42d0e4f play kube: Add --wait option
Add a way to keep play kube running in the foreground and terminating all pods
after receiving a a SIGINT or SIGTERM signal. The pods will also be
cleaned up after the containers in it have exited.
If an error occurrs during kube play, any resources created till the
error point will be cleane up also.

Add tests for the various scenarios.

Fixes #14522

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2023-02-28 13:45:36 -05:00
Giuseppe Scrivano 4b3b944733
system: add warning when running rootless on cgroupv1
when running rootless on cgroupv1, Podman+OCI runtime do not setup a
separate cgroup for the container.  Spawned containers will run in the
same cgroup as the podman system service process, thus will be killed
when the cgroup is destroyed, as it is the case when running as a
systemd service.

[NO NEW TESTS NEEDED]

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-02-23 11:28:05 +01:00
OpenShift Merge Robot 3796e22761
Merge pull request #17586 from mheon/add_sql_state
Add initial SQLite-backed state implementation
2023-02-23 09:11:05 +01:00
OpenShift Merge Robot 7fba1db31a
Merge pull request #17526 from danishprakash/fix-kube-secret
kube: rm secret on down, print secret on play
2023-02-22 19:34:18 +01:00
Matt Heon c4fe0af2aa Remove `--namespace` flag from Podman root
Signed-off-by: Matt Heon <mheon@redhat.com>
2023-02-22 11:00:50 -05:00
Brent Baude ebb45b5bdd machine refactoring preparations for hyperv
before we can support hyperv as a virtualization option for podman
machine, several areas in machine will require cleanup.  this is the
first pass of these changes to keep the review burden low.  changes
include:

  * convert artifact, format (image format) and compression to enums
    with string methods
  * rename Provider interface to VirtProvider
  * change Provider implementation in QEMU to QEMUVirt
  * change Provider implementation in WSL to WSLVirt

as mentioned earlier, there will be several more of these refactoring
PRs because assumptions were made about associations of platforms and
virt providers as well as compression and image formats.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-02-20 13:43:49 -06:00