14610 Commits

Author SHA1 Message Date
95dad4d8a4 podman rmi --ignore
Add an `--ignore` flag to `podman image rm` to instruct ignoring image
if a specified image does not exist and to not throw an error.  Other
commands (e.g., `podman container rm`) already support this flag.

Such an `--ignore` flag can come in handy in clean-up scripcts such as
the teardown phases in the Podman tests.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-03-19 10:05:43 +01:00
cc7b5974be Fix type-o and cleanup doc punctuation
Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2022-03-18 17:33:30 -05:00
c2eae35c60 Merge pull request #13554 from vrothberg/vendor-common
vendor c/common@0ededd18a1
2022-03-18 22:52:55 +01:00
8ebb94f2ce Merge pull request #13556 from Luap99/dualstack-flake
fix dual stack network e2e flake
2022-03-18 19:40:41 +01:00
54641f5f76 fix compose test flake
Reading from the nc socket is flaky because docker-compose only starts
the containers. We cannot know at this point if the container did already
send the message. Give the container 5 seconds time to send the message
to prevent flakes.

This happened rarely with compose v1 but it looks like it will happen a
lot more with compose v2.

Example failure log:
https://storage.googleapis.com/cirrus-ci-6707778565701632-fcae48/artifacts/containers/podman/6567556239589376/html/compose_v2-podman-fedora-35-rootless-host.log.html

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-03-18 16:59:14 +01:00
622d0068e4 fix dual stack network e2e flake
We need to use different ipv6 subnets for the tests since they can
collide otherwise when the tests are run in parallel.

In the future we should rethink hardcoding subnets for ipv4/ipv6. This
will make it impossible to run these tests if the subnet is already used
on the host.

Example log: https://storage.googleapis.com/cirrus-ci-6707778565701632-fcae48/artifacts/containers/podman/5711403297275904/html/int-podman-fedora-35-root-host-netavark.log.html#t--podman-network-create-with-multiple-subnets-dual-stack-with-gateway-and-range--1

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-03-18 15:35:00 +01:00
57cdc21b00 vendor c/common@0ededd18a1
Update the login tests to reflect the latest changes to allow http{s}
prefixes (again) to address bugzilla.redhat.com/show_bug.cgi?id=2062072.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-03-18 15:18:30 +01:00
3853ef9b59 Merge pull request #13540 from mheon/fix_11822
Deduplicate between Volumes and Mounts in compat API
2022-03-18 12:48:41 +01:00
e471bf532c Merge pull request #13528 from containers/dependabot/go_modules/github.com/stretchr/testify-1.7.1
build(deps): bump github.com/stretchr/testify from 1.7.0 to 1.7.1
2022-03-18 12:46:38 +01:00
e00e06de9a Merge pull request #13542 from edsantiago/logformatter_linkto_bats
logformatter: link to bats sources on error
2022-03-18 12:40:39 +01:00
b0fefb3e8f Merge pull request #13523 from n1hility/tolerate-old-machine
Tolerate old machine images, but warn they should be recreated
2022-03-18 12:38:40 +01:00
f8b04bf56c Merge pull request #13552 from vrothberg/go1.18
go fmt: use go 1.18 conditional-build syntax
2022-03-18 11:24:58 +01:00
d72a829f59 Merge pull request #13544 from Luap99/root-machine-port
podman machine: remove hostip from port
2022-03-18 11:20:39 +01:00
ea08765f40 go fmt: use go 1.18 conditional-build syntax
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-03-18 09:11:53 +01:00
3c968c3d22 Handle incompatible machines
Start in a reduced mode for recovery, warn, and provide instructions to recreate them

Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2022-03-18 01:16:34 -05:00
d3e3ea843e logformatter: link to bats sources on error
We already link to ginkgo sources, now add links to bats.
Ugly, because we need to hardcode containers/podman (git
repo) and test/system (test file path): those can't be
determined from the log results like they can in ginkgo.

Also, great suggestion from @Luap99: in addition to the
'Annotated results' link which we append to the basic log,
include a short summary of failures. This should help a
viewer see exactly which test(s) failed, which in turn
can be helpful for diagnosing known-flake or real-problem.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-03-17 14:25:09 -06:00
4b359e4598 Set names in compose tests based on version
Compose v2 uses dashes as separators instead of hyphens. This
broke some tests that relied upon container names. Set the name
conditionally to make it safe for both.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2022-03-17 15:16:13 -04:00
bde3ca8c36 Add tests with Docker Compose v2
Add a pair of new Cirrus test suites using Compose v2 instead of
Compose v1 (as is currently packaged in Fedora). They work
identically, and run the same tests, as the Compose v1 tests, but
with the new v2 binary instead.

[NO NEW TESTS NEEDED] This adds an entire Cirrus suite...

Signed-off-by: Matthew Heon <mheon@redhat.com>
2022-03-17 14:29:48 -04:00
1fd76c901f podman machine: remove hostip from port
Inside the podman machine vm we always remove the hostip from the port
mapping because this should only be used on the actual host. Otherwise
you run into issues when we would bind 127.0.0.1 or try to bind a
host address that is not available in the VM.

This was already done for cni/netavark ports and slirp4netns but not for
the port bindings inside libpod which are only used as root.

[NO NEW TESTS NEEDED] We still do not have machine tests!

Fixes #13543

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-03-17 18:59:55 +01:00
e59f71d230 Merge pull request #13530 from vrothberg/fix-13529
podman create: building local pause image: do not read ignore files
2022-03-17 18:28:24 +01:00
0793a58343 Deduplicate between Volumes and Mounts in compat API
Docker Compose v2.0 passes mount specifications in two different
places: Volumes (just the destination) and Mounts (full info
provided - source, destination, etc). This was causing Podman to
refuse to create containers, as the destination was used twice.
Deduplicate between Mounts and Volumes, preferring volumes, to
resolve this.

Fixes #11822

Signed-off-by: Matthew Heon <mheon@redhat.com>
2022-03-17 10:45:08 -04:00
ff54aaa634 podman create: building local pause image: do not read ignore files
Make sure to ignore local {container,docker}ignore files when building a
local pause image.  Otherwise, we may mistakenly not be able to copy
catatonit into the build container.

Fixes: #13529
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-03-17 14:18:16 +01:00
ecd2746ce3 Merge pull request #13527 from machacekondra/set_raw_image_name_for_play_kube
Set rawimage for containers created via play kube
2022-03-17 11:18:01 +01:00
6ce967708d Merge pull request #13299 from npate012/fix_systemd_generate_name_on_empty_prefix
Separator is no longer prepended when prefix is empty on podman generate systemd
2022-03-17 10:34:11 +01:00
714e5a13d9 Separator is no longer prepended when prefix is empty on podman generate systemd
When podman generate systemd is invoked, it previously did not check if
container-prefix or pod-prefix are empty. When these are empty, the file name
starts with the separator, which is hyphen by default. This results in files
like '-containername.service'.

The code now checks if these prefixes are empty. If they are, the filename no
longer adds a separator. Instead, it uses name or ID of the container or pod.

Closes #13272

Signed-off-by: Nirmal Patel <npate012@gmail.com>
2022-03-16 20:26:59 -04:00
b1d37a7e21 Merge pull request #13450 from jwhonce/bz/2052697
Exit code change BZ #2052697
2022-03-16 17:23:50 -04:00
1387b5bd8a Add test for BZ #2052697
Signed-off-by: Jhon Honce <jhonce@redhat.com>
2022-03-16 11:27:07 -07:00
449f2fc0bd Set rawimage for containers created via play kube
This commit set the containers RawImageName to default image name
specified in Pod YAML, so the containers could be used via autoupdate
feature, which needs the RawImageName to be set.

Currently RawImageName is set only for the create/run/clone podman
commands.

[NO NEW TESTS NEEDED]

Signed-off-by: Ondra Machacek <omachace@redhat.com>
2022-03-16 13:37:44 +01:00
c732adf2d0 build(deps): bump github.com/stretchr/testify from 1.7.0 to 1.7.1
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.7.0 to 1.7.1.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.7.0...v1.7.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-16 12:08:28 +00:00
fa33f3527f Merge pull request #13520 from craftyguy/doc_net_macvlan
[CI:DOCS]: Mention netavark limitations for macvlan/ipvlan drivers
2022-03-16 06:36:44 -04:00
bbae81a291 Merge pull request #13489 from Luap99/k8s
move k8s deps into podman
2022-03-16 04:27:41 -04:00
772c6c2206 Merge pull request #13519 from Luap99/version-newline
fix empty newline in version output
2022-03-16 00:02:16 -04:00
ca7376bb11 Exit with 0 when receiving SIGTERM
* systemctl stop podman.service will now return exit code 0
* Update test framework to support JSON boolean and numeric values

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2022-03-15 14:45:11 -07:00
29f24ff68e [CI:DOCS]: Mention netavark limitations for macvlan/ipvlan drivers
The example is also improved to add the --subnet option, this option is required with netavark, else you get:
    Error: macvlan driver needs at least one subnet specified, DHCP is not supported with netavark

Signed-off-by: Clayton Craft <clayton@craftyguy.net>
2022-03-15 13:08:24 -07:00
45df70ec1e fix empty newline in version output
When podman is build without git commit information it will print a
empty newline instead. This is undesirable and a regression introduced
in commit 7d22cc88ef38.

To test build podman with `go build -mod=vendor -o bin/podman ./cmd/podman`
and check the output of bin/podman version with and without this commit.

[NO NEW TESTS NEEDED]

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-03-15 20:44:19 +01:00
fa0d3c564a Merge pull request #13514 from Luap99/bindings
fix breaking change in pkg/bindings
2022-03-15 15:41:52 -04:00
33aa2f2d1c Fix windows win-sshproxy build
Github no longer supports the unauthenticated git protocol, so switch
to using https instead.

https://github.blog/2021-09-01-improving-git-protocol-security-github/

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-03-15 17:33:34 +01:00
4e2334c149 Merge pull request #13512 from containers/dependabot/go_modules/github.com/docker/docker-20.10.13incompatible
Bump github.com/docker/docker from 20.10.12+incompatible to 20.10.13+incompatible
2022-03-15 12:19:57 -04:00
ac6ef74937 Merge pull request #13513 from containers/dependabot/go_modules/github.com/spf13/cobra-1.4.0
Bump github.com/spf13/cobra from 1.3.0 to 1.4.0
2022-03-15 11:52:05 -04:00
0db184fb08 fix breaking change in pkg/bindings
pkg/bindings is considered stable. We cannot make changes that would
break any users. If someone uses this field their code would fail to
compile. Since the fix is obviously correct we will keep it but also
add the old field back in to keep compatibility with old code.

When both fields are set ImportArchive is preferred over ImportAchive.

Fixes changes from commit 217197340c8f

[NO NEW TESTS NEEDED]

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-03-15 15:06:42 +01:00
19d0c5a8a3 pkg/k8s.io: add small readme with copyright notice
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-03-15 14:48:11 +01:00
dd9e4dc72b pkg/k8s.io/api/core/v1: remove unneeded types
Remove types that are not applicable for podman. This are types I do not
think we need, there is definitely more that could be removed but this
should be handled by someone who knows the k8s code better than me.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-03-15 14:48:11 +01:00
f106867acd pkg/k8s.io/...: remove more unneeded files
We do not use the types defined in these fields.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-03-15 14:48:11 +01:00
0612f859b8 pkg/k8s.io/...: remove protobuf field tags
Since we do not use protobuf we can remove these field tags. This will
save some KB in the final binary size.

This change was automated with the following commands:
find pkg/k8s.io/ -type f -name "*.go" -exec sed -i -e 's/\sprotobuf\:\".*\"//g' {} +
find pkg/k8s.io/ -type f -name "*.go" -exec sed -i -e 's/\s`protobuf\:\".*\"`//g' {} +

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-03-15 14:48:11 +01:00
f8577766d0 pkg/k8s.io/...: fix lint errors
Fix linting errors. We use different/stricter linters, instead of
skipping these packages we should fix it.

Most errors are about naming conventions, since I do not want to change
the names I added the nolint comment there. I also removed some unused
fields where the linter complained.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-03-15 14:48:10 +01:00
a0ad1f2ad4 remove unneeded k8s code
There is a lot of unneeded code, k8s is the by far the biggest
dependency in podman. We should remove as much as possible so that we
only have the stuff left that we use.

This is just a quick skim over the code which removes a lot of the
generated code and many packages that are now unused.
I know that this will be impossible to properly review. I will try to
make smaller changes in follow up work.

Right now this reduces about 8 MB in binary size!!!

[NO NEW TESTS NEEDED] Hopefully existing tests will catch any problems.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-03-15 14:48:08 +01:00
918fc88a98 move k8s deps into podman
We only need a small part of the k8s dependencies but they are the
biggest dependencies in podman by far. Moving them into podman allows us
to remove the unnecessary parts.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-03-15 14:46:29 +01:00
3d82d17f8c Bump github.com/spf13/cobra from 1.3.0 to 1.4.0
Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.3.0 to 1.4.0.
- [Release notes](https://github.com/spf13/cobra/releases)
- [Changelog](https://github.com/spf13/cobra/blob/master/CHANGELOG.md)
- [Commits](https://github.com/spf13/cobra/compare/v1.3.0...v1.4.0)

---
updated-dependencies:
- dependency-name: github.com/spf13/cobra
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-15 12:09:17 +00:00
439323cd2e Bump github.com/docker/docker
Bumps [github.com/docker/docker](https://github.com/docker/docker) from 20.10.12+incompatible to 20.10.13+incompatible.
- [Release notes](https://github.com/docker/docker/releases)
- [Changelog](https://github.com/moby/moby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/docker/docker/compare/v20.10.12...v20.10.13)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-15 12:09:10 +00:00
68ce83fe91 Merge pull request #13238 from lsm5/e2e-aardvark
test/e2e: add aardvark specific tests
2022-03-15 06:34:07 -04:00