303 Commits

Author SHA1 Message Date
70f6cf7ffa Merge pull request #6634 from baude/v2buildfixes
fix misc remote build issues
2020-06-17 15:36:02 -04:00
78ad57ebd3 Merge pull request #6636 from mheon/add_warnings
Re-add resource limit warnings to Specgen
2020-06-17 16:51:51 +02:00
65c3a56602 fix misc remote build issues
address problem when multiple -t were sent.  and rework remote build's tarball if a context dir is given other than ".".

Fixes: #6578
Fixes: #6577

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-06-17 09:01:43 -05:00
4fb0f56063 Merge pull request #6638 from jwhonce/issues/6548
[CI:DOCS] Fixes #6548
2020-06-17 11:20:51 +02:00
64d3508a94 [CI:DOCS] Fixes #6548
* Update swagger documentation

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-06-16 15:57:38 -07:00
c51c593ff6 Re-add resource limit warnings to Specgen
These were part of Podman v1.9, but were lost in the transition
to using Specgen to create containers. Most resource limits are
checked via the sysinfo package to ensure they are safe to use
(the cgroup is mounted, kernel support is present, etc) and
removed if not safe. Further, bounds checks are performed to
ensure that values are valid.

Ensure these warnings are printed client-side when they occur.
This part is a little bit gross, as it happens in pkg/infra and
not cmd/podman, which is largely down to how we implemented
`podman run` - all the work is done in pkg/infra and it returns
only once the container has exited, and we need warnings to print
*before* the container runs. The solution here, while inelegant,
avoid the need to extensively refactor our handling of run.

Should fix blkio-limit warnings that were identified by the FCOS
test suite.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-06-16 17:32:01 -04:00
af3c4d88b4 handlers/compat: fix lint error
Fix a lint error of an used parameter.  The error must have sneaked in
with a PR that was merged after the recent linter enablement.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-06-16 11:11:53 +02:00
6e0cf67874 Merge pull request #6590 from zhangguanzhang/master
Add the missing return in the API handlers' image_build method
2020-06-15 13:17:41 -04:00
b005465cb0 Merge pull request #6597 from rhatdan/image
Add some additional fields to imageinspect
2020-06-15 13:08:28 -04:00
f4c3b718eb Merge pull request #6557 from rhatdan/lint
Turn on More linters
2020-06-15 09:19:40 -04:00
200cfa41a4 Turn on More linters
- misspell
    - prealloc
    - unparam
    - nakedret

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-06-15 07:05:56 -04:00
ec258365a7 Add some additional fields to imageinspect
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-06-13 08:54:20 -04:00
f9abd33c23 Add the missing return
Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
2020-06-12 23:33:09 +08:00
99f2a4e4b9 Reassemble filters on the server side
--filter label=foo=bar, was been translated on the server side to
--filter label=foo --filter=bar

This PR fixes this back to what the user specified.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-06-12 06:48:49 -04:00
05b90a04b2 [CI:DOCS] Fix carriage returns in API v2 header
ReadTheDocs was wrapping lines and removing leading spaces unless there
a blank line in between.  This adds the blank lines to make the
examples more readable on https://docs.podman.io/en/latest/_static/api.html

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2020-06-11 16:02:06 -04:00
1f05606fac Merge pull request #6564 from TomSweeneyRedHat/dev/tsweeney/apidocstart
[CI:DOCS] Add quick start directions to APIv2 Dock
2020-06-11 14:43:44 -04:00
f1b6840382 Merge pull request #6516 from zhangguanzhang/master
fix api fails with 'strconv.ParseUint: parsing "tcp": invalid syntax'
2020-06-11 10:27:59 -04:00
dee1bf0d2f [CI:DOCS] Add quick start directions to APIv2 Dock
Adds some quick start up directions to the top of the
API v2 documentation and a few examples.
This strongly leverages comments from @jgallucci32 in #6535.

Fixes: #6535

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2020-06-11 09:15:51 -04:00
63468464e8 Merge pull request #6546 from rhatdan/lint
Turn on golint
2020-06-10 08:42:16 -04:00
87718c4e67 Fix Id->ID where possible for lint
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-06-10 05:49:41 -04:00
4bb43b898d Fixup issues found by golint
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-06-10 05:49:41 -04:00
817dbdfdf8 Ensure signal validation happens first in pod kill
This fixes an error in the system tests, which expect that when
you try and kill a nonexistent pod with an incorrect signal, you
receive an error about the signal, not the pod.

At the same time, fix a missing return statement in the bindings,
which could also have caused us grief.

Fixes #6540

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-06-09 14:10:10 -04:00
3218736cff fix api fails with 'strconv.ParseUint: parsing "tcp": invalid syntax'
Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
2020-06-10 00:03:04 +08:00
6229d9d07d /images/.../json: fix port parsing
Fix a bug when parsing the `ExposedPorts` of the image that lead to
panics when the field was set.  The OCI image spec allows three valid
formats: `tcp/port`, `udp/port` and `port`

Fixes: #6490
Reported-by: @jgallucci32
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-06-04 09:37:27 +02:00
e0d9404634 Enable detached exec for remote
The biggest obstacle here was cleanup - we needed a way to remove
detached exec sessions after they exited, but there's no way to
tell if an exec session will be attached or detached when it's
created, and that's when we must add the exit command that would
do the removal. The solution was adding a delay to the exit
command (5 minutes), which gives sufficient time for attached
exec sessions to retrieve the exit code of the session after it
exits, but still guarantees that they will be removed, even for
detached sessions. This requires Conmon 2.0.17, which has the new
`--exit-delay` flag.

As part of the exit command rework, we can drop the hack we were
using to clean up exec sessions (remove them as part of inspect).
This is a lot cleaner, and I'm a lot happier about it.

Otherwise, this is just plumbing - we need a bindings call for
detached exec, and that needed to be added to the tunnel mode
backend for entities.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-06-02 15:30:42 -04:00
45a7e7266e Add bindings for exec and enable attached remote
This adds bindings for starting exec sessions, and then uses them
to wire up detached exec. Code is heavily based on Attach code
for containers, slightly modified to handle exec sessions.

Bindings are presently attached-only, detached is pending on a
Conmon update landing in CI. I'll probably get to that next.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-06-01 17:24:00 -04:00
990514ea92 Add support for format {{.Label}}
the pod ps man page says .Label is valid go template format. i dont think the function was actually ever implemented.

Fixes #6448

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-06-01 11:54:15 -05:00
8c1883721c Fix leak of empty tarball
In cases of trying to export an image, if the image was not found, we leaked an empty tarball or directory depending on the format.

Fixes: #6409

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-06-01 10:07:58 -05:00
c479d63dd6 Merge pull request #6356 from baude/v2copyendpoints
v2 copy endpoints
2020-05-30 05:06:48 -04:00
dc80267b59 compat handlers: add X-Registry-Auth header support
* Support the `X-Registry-Auth` http-request header.

 * The content of the header is a base64 encoded JSON payload which can
   either be a single auth config or a map of auth configs (user+pw or
   token) with the corresponding registries being the keys.  Vanilla
   Docker, projectatomic Docker and the bindings are transparantly
   supported.

 * Add a hidden `--registries-conf` flag.  Buildah exposes the same
   flag, mostly for testing purposes.

 * Do all credential parsing in the client (i.e., `cmd/podman`) pass
   the username and password in the backend instead of unparsed
   credentials.

 * Add a `pkg/auth` which handles most of the heavy lifting.

 * Go through the authentication-handling code of most commands, bindings
   and endpoints.  Migrate them to the new code and fix issues as seen.
   A final evaluation and more tests is still required *after* this
   change.

 * The manifest-push endpoint is missing certain parameters and should
   use the ABI function instead.  Adding auth-support isn't really
   possible without these parts working.

 * The container commands and endpoints (i.e., create and run) have not
   been changed yet.  The APIs don't yet account for the authfile.

 * Add authentication tests to `pkg/bindings`.

Fixes: #6384
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-05-29 15:39:37 +02:00
5626c2163b V2 verify JSON output is consistent and doesn't drift
$ cd test/apiv2
$ python -m unittest -v test_rest_v1_0_0.TestApi

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-05-28 16:20:29 -07:00
c64abd0b03 Merge pull request #6407 from baude/v2eventsstream
Add streaming ability to endpoint
2020-05-27 15:07:32 -04:00
8438fa4fec Add streaming ability to endpoint
Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-05-27 12:16:39 -05:00
ab3a620f74 Merge pull request #6398 from rhatdan/32bit
Fix builds on 32 Arches.
2020-05-27 11:18:37 -04:00
f8632bad82 Fix builds on 32 bit arches
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-05-27 09:52:36 -04:00
d6fd0952f8 v2 libpod push: correct docs
The swagger documentation for the libpod push endpoint were not in sync
with the implementation.  Correct these docs to reflect the parameters
that are actually supported.

Fixes: #6388
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-05-27 15:26:46 +02:00
5dfddf04ee v2 copy endpoints
add copy endpoint inputs and outputs.  these endpoints are not implemented yet, nor are any bindings.  this allows us to update this later without having to change our api version.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-05-26 12:04:20 -05:00
0b7b974868 Merge pull request #6238 from baude/v2compatnet
network compatibility endpoints for API
2020-05-25 04:46:47 -04:00
c3af2faab2 network compatibility endpoints for API
add endpoints for networking compatibility with the API.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-05-22 13:48:52 -05:00
6f5bc712de Add MethodNotAllowedHandler() to add in debugging
Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-05-22 11:48:13 -07:00
f51e0d0597 V2 enable remote logs and testing
* wire up bindings and handler for obtaining logs remotely
* enable debug logging from podman in e2e test using DEBUG and
  DEBUG_SERVICE env variables
* Fix error in streaming log frames
* enable remote logs test

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-05-22 07:51:29 -07:00
cf5d33807f Merge pull request #6345 from QiWang19/mani-push-test
remote manifest test
2020-05-22 15:47:33 +02:00
a61f9fd547 Removes remote system reset functionality. skip e2e test for remote.
As system reset too dangerous for remote use, deleting the functionality
and the test case.

Signed-off-by: Sujil02 <sushah@redhat.com>
2020-05-22 07:49:55 -04:00
f7dd915acc remote manifest test
Enable remove manifest tests. Skip --purge test because remote does not support it.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-05-21 16:17:39 -04:00
845a795a7a v2 podman-remote build
this is a very basic implementation of build.  some of the more advanced options need to be included still as well.  i think the endpoints for compat and libpod will have to split given buildahs more advanced set of options.  that should probably be done by someone more experienced with build internals.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-05-21 14:22:11 -05:00
363f8820bc Merge pull request #6312 from rhatdan/image
Fix remote handling of podman images calls
2020-05-21 17:13:36 +02:00
6668b131eb Merge pull request #6304 from baude/v2remotehctests
Fix remote integration for healthchecks
2020-05-21 16:05:47 +02:00
a4c8198afd Fix remote handling of podman images calls
Enable three more tests
Fix handling of image filters

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-05-21 09:28:42 -04:00
e8e5a5f96e Merge pull request #6305 from baude/v2podcreatetest
enable pod_create remote integration tests
2020-05-20 22:44:12 +02:00
fed4ef09ce enable pod_create remote integration tests
Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-05-20 14:57:30 -05:00