30 Commits

Author SHA1 Message Date
a2bb7bd36b fix podman generate kube with HostAliases
Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
2020-08-27 17:32:51 +08:00
a5e37ad280 Switch all references to github.com/containers/libpod -> podman
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-07-28 08:23:45 -04:00
65e1638f9b Enable a bunch of remote tests
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-07-21 19:23:24 -04:00
4a3ba34d63 Re-enable a generate kube test that failed on Ubuntu
The fix was a new runc version, which we may have sucked in.

Fixes #6506

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-07-20 09:48:48 -04:00
a10d5b42ab Change buildtag for remoteclient to remote for testing
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-07-06 15:22:24 -04:00
8489dc4345 move go module to v2
With the advent of Podman 2.0.0 we crossed the magical barrier of go
modules.  While we were able to continue importing all packages inside
of the project, the project could not be vendored anymore from the
outside.

Move the go module to new major version and change all imports to
`github.com/containers/libpod/v2`.  The renaming of the imports
was done via `gomove` [1].

[1] https://github.com/KSubedi/gomove

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-07-06 15:50:12 +02:00
b62e50f53b Merge pull request #6256 from theunrealgeek/play_kube_deployment
Support k8s Deployment in play kube
2020-06-11 08:53:00 -04:00
efd1422143 Enable Ubuntu tests in CI
Add updates required for ubuntu and run integration tests

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-06-08 12:21:16 +02:00
5330ce9876 Fix podman generate tests that relied on play kube
Signed-off-by: Aditya Kamath <theunrealgeek@gmail.com>
2020-06-02 20:33:16 -07:00
76f8efc0d0 spec: fix order for setting rlimits
also make sure that the limits we set for rootless are not higher than
what we'd set for root containers.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-05-11 13:02:33 +02:00
9b66d1321e enable rootless integration testing
Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-05-10 09:09:07 -05:00
f269be3a31 add {generate,play} kube
Add the `podman generate kube` and `podman play kube` command.  The code
has largely been copied from Podman v1 but restructured to not leak the
K8s core API into the (remote) client.

Both commands are added in the same commit to allow for enabling the
tests at the same time.

Move some exports from `cmd/podman/common` to the appropriate places in
the backend to avoid circular dependencies.

Move definitions of label annotations to `libpod/define` and set the
security-opt labels in the frontend to make kube tests pass.

Implement rest endpoints, bindings and the tunnel interface.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-05-06 17:08:22 +02:00
5c968b7693 Force integration tests to pass
Failing tests are now skipped and we should work from this.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-21 13:48:50 -05:00
17bab33bd2 fix security-opt generate kube
fix #4950
add selinux options from --security-opt of the container to generate kube result

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-03-03 11:21:14 -05:00
a6108f1c19 Add support for RunAsUser and RunAsGroup
Currently podman generate kube does not generate the correct RunAsUser and RunAsGroup
options in the yaml file.  This patch fixes this.

This patch also make `podman play kube` use the RunAdUser and RunAsGroup options if
they are specified in the yaml file.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-11-06 10:35:37 -05:00
60d0be17fc Refactor tests when checking for error exit codes
Rather than checking for non-zero, we need to check for >0 to
distinguish between timeouts and error exit codes.

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2019-10-16 08:10:07 -07:00
341f5e22e5 Add test for generate kube with volumes
Signed-off-by: Peter Hunt <pehunt@redhat.com>
2019-07-02 15:18:44 -04:00
068d3bb3bf Update 'generate kube' tests to verify YAML
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-06-25 12:34:53 -04:00
101a5cd755 Use a different method to retrieve YAML output in tests
OutputToString() was mangling newlines, which made YAML parsers
very, very angry. But not angry enough to actually error, that
would be too easy. Just angry enough to silently not decode
anything.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-06-25 11:10:50 -04:00
79d835457d Fix tests
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-06-24 15:27:37 -04:00
803a2b04d1 Change Marshal -> Unmarshal in generate kube tests
We need to verify that valid YAML was produced - Marshal will
just pack the generated YAML even further.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-06-24 14:56:41 -04:00
567e7c60fa Add test for generate kube on a pod with ports
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-06-24 14:45:07 -04:00
f909b745ec Add --filename option to generate kube
This allows writing output directly to a file, instead of STDOUT.
Makes things easier for some scripting tasks. Like the unit tests
for 'play kube'.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-06-11 11:26:46 -04:00
53435d4d47 Add a test for 'podman play kube' to prevent regression
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-06-10 18:57:29 -04:00
f610a485c1 use imagecaches for local tests
when doing localized tests (not varlink), we can use secondary image
stores as read-only image caches.  this cuts down on test time
significantly because each test does not need to restore the images from
a tarball anymore.

Signed-off-by: baude <bbaude@redhat.com>
2019-05-29 15:12:05 -05:00
ebc8999fcf podman: enable kube for rootless
Closes: https://github.com/containers/libpod/issues/2852

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-04-05 09:34:23 +02:00
c6b205be77 Enable rootless integration tests
Signed-off-by: baude <bbaude@redhat.com>
2019-03-19 15:01:48 +01:00
d5546008ab ginkgo status improvements
a series of improvements to our ginkgo test framework so we can
get better ideas of whats going on when run in CI

Signed-off-by: baude <bbaude@redhat.com>
2019-03-08 13:28:33 -06:00
b30a56c156 Run integrations test with remote-client
Add the ability to run the integration (ginkgo) suite using
the remote client.

Only the images_test.go file is run right now; all the rest are
isolated with a // +build !remotelinux.  As more content is
developed for the remote client, we can unblock the files and
just block single tests as needed.

Signed-off-by: baude <bbaude@redhat.com>
2019-01-14 14:51:32 -06:00
c8436b4912 generate kube
add the ability to generate kubernetes pod and service yaml representations
of libpod containers and pods.

Signed-off-by: baude <bbaude@redhat.com>
2018-12-04 08:03:49 -06:00