13417 Commits

Author SHA1 Message Date
673cc5054c Merge pull request #11982 from umohnani8/targetPort
Set targetPort to the port value in the kube yaml
2021-10-15 16:56:43 +02:00
3f6fd8a7bd Merge pull request #11978 from rhatdan/remote
If CONTAINER_HOST env variable is set default podman --remote=true
2021-10-15 16:50:49 +02:00
5ac617ae8a Merge pull request #11976 from jwhonce/issues/10737
Use CGO_ENABLED=1 when building natively on darwin
2021-10-15 15:28:45 +02:00
a5c13bb8f7 Merge pull request #11979 from cevich/more_criu_fix
Test-hang fix: Wait for ready + timeout on connect.
2021-10-15 15:26:46 +02:00
307b1b43b2 Merge pull request #11977 from rhatdan/log
Don't include ctr.log if not using file logging
2021-10-15 15:25:46 +02:00
fecef15332 Merge pull request #11980 from umohnani8/kube
Do not add TCP to protocol in generated kube yaml
2021-10-15 01:22:55 +02:00
4f857bc106 If CONTAINER_HOST env variable is set default podman --remote=true
Users enabling CONTAINER_HOST==PATH is indicating to podman they intend
to use remote functionality.

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

Update man pages to document all of the environment variables.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-10-14 17:08:48 -04:00
8db62d04fd Set targetPort to the port value in the kube yaml
When the targetPort is not defined, it is supposed to
be set to the port value according to the k8s docs.
Add tests for targetPort.
Update tests to be able to check the Service yaml that
is generated.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2021-10-14 17:03:26 -04:00
16e7cc8bf1 Do not add TCP to protocol in generated kube yaml
As the default protocol in k8s is TCP, don't add it
to the generate yaml when using protocol.
Add UDP to the protocol of the generated yaml when udp
is being used.
Add tests for this as well.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2021-10-14 17:03:14 -04:00
ab4c9a8948 Use CGO_ENABLED=1 when building natively on darwin
Need to use CGO for mDNS resolution, but cross builds need CGO disabled
See https://github.com/golang/go/issues/12524 for details

Note: Homebrew forumla will need to be updated to pick up this change

Fixes #10737

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2021-10-14 13:31:41 -07:00
c1497cf44f Test-hang fix: Wait for ready + timeout on connect.
It was observed during initial F35 testing, this test can cause Ginkgo
to "hang" by attempting to connect before the redis is up/listening.
Fix this by confirming the ready-state before attempting to connect.
Also, force IPv4 and timeout on any connection fault - to allow other
tests to run.

Thanks to Adrian Reber for help on this and related fixes.

Signed-off-by: Chris Evich <cevich@redhat.com>
2021-10-14 15:47:45 -04:00
8439a6d5ee Checkpoint/Restore test fixes
Moving to Fedora 35 showed test failures (time outs) in the test

"podman checkpoint and restore container with different port mappings"

The test starts a container and maps the internal port 6379 to the local
port 1234 ('-p 1234:6379') and then tries to connect to localhost:1234

On Fedora 35 this failed and blocked the test because the container was
not yet ready. The test was trying to connect to localhost:1234 but
nothing was running there. So the error was not checkpointing related.

Before trying to connect to the container the test is now waiting for
the container to be ready.

Another problem with this test and running ginkgo in parallel was that
it was possible that the port was already in use. Now for each run a
random port is selected to decrease the chance of collisions.

Signed-off-by: Adrian Reber <areber@redhat.com>
2021-10-14 18:53:32 +00:00
f9ff0525c5 Don't include ctr.log if not using file logging
Checkpoint is blowing up when you use --log-driver=none

[NO NEW TESTS NEEDED] No way currently to test checkpoint restore.

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

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-10-14 14:12:15 -04:00
8d44c548c0 Merge pull request #11967 from rhatdan/docs
Fix codespell errors
2021-10-14 19:55:55 +02:00
77ae43af61 Merge pull request #11971 from rhatdan/archive
Don't use docker/pkg/archive, use containers/storage/pkg/archive
2021-10-14 19:53:55 +02:00
ac733032c1 Merge pull request #11966 from Luap99/panic
Fix panic in container create compat api
2021-10-14 17:28:57 +02:00
50b9d82f2e Don't use docker/pkg/archive, use containers/storage/pkg/archive
[NO NEW TESTS NEEDED]

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-10-14 10:28:42 -04:00
7112a4159b Fix codespell errors
Along with a couple of nits found by Ed.

[NO NEW TESTS NEEDED]

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-10-14 08:44:09 -04:00
184de3955c Adjust tests to verify all subcommands show the help message
Signed-off-by: Markus Thömmes <markusthoemmes@me.com>
2021-10-14 13:54:52 +02:00
8cae2978ef Fix panic in container create compat api
The bind and tmpfs options can be nil, we have to check that before we
try to use it.

Fixes #11961

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-10-14 12:56:44 +02:00
c19f257181 Merge pull request #11898 from rhatdan/docs
[CI:DOCS] Add information about .containerignore to podman build man page
2021-10-14 12:55:35 +02:00
a76c7555e7 Merge pull request #11947 from umohnani8/kube
Don't add image entrypoint to the generate kube yaml
2021-10-14 01:51:24 +02:00
5d18fb9239 Don't add image entrypoint to the generate kube yaml
If no entrypoint or command is set in the podman create
command, and the image command or entrypoint is being
used as the default, then do not add the image command or
entrypoint to the generated kube yaml.
Kubernetes knows to default to the image command and/or
entrypoint settings when not defined in the kube yaml.
Add and modify tests for this case.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2021-10-13 15:18:04 -04:00
9f1452cbb5 Merge pull request #11944 from cdoern/kubeEmit
Kube Gen run as user/group issues
2021-10-13 19:42:14 +02:00
a235f43ac0 Merge pull request #11949 from Luap99/net-range
CNI: fix network create --ip-range
2021-10-13 18:42:15 +02:00
1c156f2267 Merge pull request #11948 from rhatdan/codespell
codespell code
2021-10-13 14:46:00 +02:00
e3cf9b685a Merge pull request #11892 from vrothberg/search
podman search: display only name and description by default
2021-10-13 14:29:59 +02:00
cc875fd268 Display help text on empty subcommand by default
Signed-off-by: Markus Thömmes <markusthoemmes@me.com>
2021-10-13 11:48:45 +02:00
f12dc28bbc Merge pull request #11565 from Luap99/rootlessport-bin
rootlessport: reduce memory usage of the process
2021-10-13 10:41:59 +02:00
14bfee31f7 podman search: display only name and description by default
Change the default format of `podman search` to only display the name
and the description of each image.  The index is redundant to the name
and consumes a lot of space, and other descriptors (i.e., stars,
official, automated) are specific to Docker Hub and also consume a lot
space.  Users can still use `--format` for displaying the descriptors
they want to.

Add a `--compatible` flag to offer an easy way to get them back.

Also update the man page to account for the behavior and get some fresh
data in the examples.

Motivated by a recent conversation in libimage:
https://github.com/containers/common/pull/802#issuecomment-937108734

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-10-13 10:13:24 +02:00
0b8673d0e7 Merge pull request #11943 from baude/issue11929
No space in kube annotations for bind mounts
2021-10-13 10:01:58 +02:00
8600bce53a codespell code
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-10-12 16:44:25 -04:00
7b1e386f7c Add information about .containerignore to podman build man page
Cleanup some other errors in the podman build man page.

Also slip a link between .dockerignore and containerignore.5 man page

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-10-12 16:42:07 -04:00
cead185373 CNI: fix network create --ip-range
The --ip-range option did not work correctly. The endIP was accidentally
assigned to the start IP. New tests are added to make sure it works.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-10-12 22:36:24 +02:00
4631f5b283 Kube Gen run as user/group issues
Removed the inclusion of RunAsUser or RunAsGroup unless a container is run with the --user flag. When building from an image
the user will be pulled from there anyway

resolves #11914

Signed-off-by: cdoern <cdoern@redhat.com>
2021-10-12 16:22:01 -04:00
72e87c0ca8 Merge pull request #11924 from jwhonce/issues/11894
Refactor podman search to be more code friendly
2021-10-12 22:17:09 +02:00
97c74f35a1 Merge pull request #11935 from giuseppe/use-cgroup-controllers
cgroups: use cgroup.controllers to read controllers
2021-10-12 21:58:09 +02:00
3ba69dccf7 rootlessport: reduce memory usage of the process
Don't use reexec for the rootlessport process, instead make it a
separate binary to reduce the memory usage. The problem with reexec is
that it will import all packages that podman uses and therefore loads a
lot of stuff into the heap. The rootlessport process however only needs
the rootlesskit library.
The memory usage is a concern since the rootlessport process will spawn
two process per container which has ports forwarded. The processes stay
until the container dies. On my laptop the current reexec version uses
47800 KB RSS. The new separate binary only uses 4540 KB RSS. This is
more than a 90% improvement.

The Makefile has been updated to compile the new binary and install it
to the libexec directory.

Fixes #10790

[NO TESTS NEEDED]

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-10-12 21:43:11 +02:00
c90beedbe1 Merge pull request #11925 from rhatdan/volume
Remove a volume with --force if container is running
2021-10-12 21:27:09 +02:00
03095bd090 Merge pull request #11927 from jwhonce/issues/11921
Fix CI flake on time of shutdown for API service
2021-10-12 21:08:10 +02:00
65e156467b Merge pull request #11886 from edsantiago/unitfile_path
Unit files: Use actual installed path for podman
2021-10-12 19:39:10 +02:00
ab0e6630f5 No space in kube annotations for bind mounts
Kubernetes fails to deal with an annotation that has a space in it.
Trim these strings to remove spaces.

Fixes: #11929

Signed-off-by: Brent Baude <bbaude@redhat.com>

[NO TESTS NEEDED]
2021-10-12 12:38:15 -05:00
214c13da0a Merge pull request #11932 from flouthoc/build-prune
builder: Add support for builder prune
2021-10-12 19:32:10 +02:00
0459484bdf Fix CI flake on time of shutdown for API service
* Increase timeout for tests to 10s
* To aid in debugging add PID to shutdown package logging
* Added new message for forced service shutdown
* Always wait for HTTP server to shutdown, duration of 0 not friendly
  to clients

Note: The log event

"IdleTracker: StateClosed transition by connection marked un-managed"

denotes a TCP connection has been initiated but no HTTP request was sent.
And is expected during these tests.

Fixes #11921

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2021-10-12 09:53:19 -07:00
b28a8bc198 Refactor podman search to be more code friendly
* JSON and API description fields are no longer truncated. Formatting
  moved to client, better support of MVP.
* --no-trunc now defaults to true
* Updated tests for changes

Closes #11894

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2021-10-12 09:30:40 -07:00
2905bc351b Merge pull request #11939 from containers/dependabot/go_modules/github.com/onsi/ginkgo-1.16.5
Bump github.com/onsi/ginkgo from 1.16.4 to 1.16.5
2021-10-12 18:06:10 +02:00
69b6659960 Unit files: Use actual installed path for podman
Don't hardcode /usr/bin/podman in unit files: instead, use
template files with a path replaced at install time.

Because 'make' can be invoked repeatedly, with different
PREFIX, do not leave the generated files behind in our
work directory: wipe them immediately after install.

To get this to work, fix a longstanding bug in podman.spec.in,
a PREFIX that should've been DESTDIR.

Side note: #7023 made contrib/systemd/user a symlink
to .../system but did not update paths in Makefile.
The unrelated-looking path change you see here is
a belated correction for that.

Fixes: #10787

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-10-12 07:57:26 -06:00
1e81787e3f Bump github.com/onsi/ginkgo from 1.16.4 to 1.16.5
Bumps [github.com/onsi/ginkgo](https://github.com/onsi/ginkgo) from 1.16.4 to 1.16.5.
- [Release notes](https://github.com/onsi/ginkgo/releases)
- [Changelog](https://github.com/onsi/ginkgo/blob/master/CHANGELOG.md)
- [Commits](https://github.com/onsi/ginkgo/compare/v1.16.4...v1.16.5)

---
updated-dependencies:
- dependency-name: github.com/onsi/ginkgo
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-12 12:22:34 +00:00
9042520cfd cgroups: use cgroup.controllers to read controllers
use the cgroup.controllers file instead of cgroup.subtree_control to
read the list of controllers available in the current cgroup.

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

[NO TESTS NEEDED] we have disabled this test in the CI because it is
difficult to know what controllers are going to be enabled for
rootless under all conditions we test.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-10-12 12:24:20 +02:00
ab8fb3876d builder: Add support for builder prune
Docker has support for docker builder prune and
docker builder build

This patch will add a hidden command to support scripts using this
syntax. We don't want to encourage this deviation.

Add podman build prune to implement docker builder prune
functionality.

Co-authored-by: Daniel J Walsh <dwalsh@redhat.com>
Signed-off-by: Aditya Rajan <arajan@redhat.com>
2021-10-12 15:31:54 +05:30