13 Commits

Author SHA1 Message Date
942f789a88 set !remote build tags where needed
The new golangci-lint version 1.60.1 has problems with typecheck when
linting remote files. We have certain pakcages that should never be
inlcuded in remote but the typecheck tries to compile all of them but
this never works and it seems to ignore the exclude files we gave it.

To fix this the proper way is to mark all packages we only use locally
with !remote tags. This is a bit ugly but more correct. I also moved the
DecodeChanges() code around as it is called from the client so the
handles package which should only be remote doesn't really fit anyway.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-08-19 11:41:28 +02:00
1b45fd7239 /_ping handler: return OSType http header
The docker client expects to read the OSType header from the `/_ping` response in order to determine the OS type of the server, for example, when running `docker run --device=/dev/fuse ...`

https://github.com/moby/moby/blob/master/client/ping.go#L57

Signed-off-by: chnrxn <cohawk@yahoo.com>
2023-08-28 22:28:16 +08:00
deaf969243 Refacter API server emphasis on logging
* To aid in debugging log API request and response bodies at trace
  level. Events can be correlated using the X-Reference-Id.
* Server now echos X-Reference-Id from client if set, otherwise
  generates an unique id.
* Move logic for X-Reference-Id into middleware
* Change uses of Header.Add() to Set() when setting Content-Type
* Log API operations in Apache format using gorilla middleware
* Port server code to use BaseContext and ConnContext

Fixes #10053

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2021-09-10 15:07:25 -07:00
98c1b23624 Jira RUN-1106 System handlers updates
* Update tests to reflect system endpoints
* First implementation of compat /system/df, only fields that are
  populated by libpod are set

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-12-05 16:41:57 -07:00
ad2439264d Merge pull request #8487 from riyad/fix-ping-typo
REST API v2 - ping - fix typo in header
2020-11-26 16:41:53 +01:00
0ae1221a46 REST API v2 - ping - fix typo in header
Signed-off-by: Riyad Preukschas <riyad@informatik.uni-bremen.de>
2020-11-25 20:49:08 +01:00
af6106f3ff REST API v2 - ping - remove newline from response to improve Docker compatibility
Signed-off-by: Riyad Preukschas <riyad@informatik.uni-bremen.de>
2020-11-25 20:43:36 +01:00
8a8bae8299 Refactor API version values
* API-Version header now Major.Minor to support tools parsing this
   header
 * Libpod Version updated to 2.0.0 to reflect changes in API field
   values
 * API-Version and Libpod-API-Version headers are now included in all
   results

Fixes #7327

 * Header support tested against goland 2020.2 and
    https://www.jetbrains.com/help/idea/docker.html plugin

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-09-15 11:29:45 -07: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
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
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
f9c392f50a V2 API Version Support
* Update blang/semver to allow ParseTolerant() support
* Provide helper functions for API handlers to obtain client's 'version'
  path variable focused on API endpoint tree: libpod vs. compat
* Introduce new errors:
  * version not given in path, endpoints may determine if this is a hard
    error (ErrVersionNotGiven)
  * given version not supported (ErrVersionNotSupported), only a soft
    error if the handler is going to hijack the connection
* Added unit tests for version parsing
* bindings check version on connect:
  * client <= Server API version connection is continued
  * client >= Server API version connection fails

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-05-20 10:21:30 -07:00
31112e4b08 Refactor handler packages
To help with packaging, the handlers in pkg/api/handlers are now found
in pkg/api/handler/compat.

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-03-10 08:03:41 -07:00