Commit Graph
11 Commits
Author SHA1 Message Date
Sebastiaan van Stijn cce2b8294e api: update go-swagger to v0.33.2
full diff: https://github.com/go-swagger/go-swagger/compare/v0.33.1...v0.33.2

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-09-23 11:49:06 +02:00
Sebastiaan van Stijn 918a3294cc api: remove gotest.tools from tests
Most tests only did minimal assertions, which could be replaced with
stdlib.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-09-02 17:35:11 +02:00
Paweł Gronowski 60cb733d21 Merge pull request #53525 from thaJeztah/api_blackbox
api: use blackbox testing
2026-09-01 14:02:17 +02:00
Sebastiaan van Stijn 3428dc2bbe api: use blackbox testing
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-08-31 16:25:02 +02:00
Sebastiaan van Stijn 7c5144c93a api/types/plugin: deprecate Privileges sort.Interface methods
Deprecate Len, Less, and Swap on Privileges in favor of slices.SortFunc.

The sort.Interface implementation is kept for compatibility, but new code can
sort Privileges directly using the generic slices helpers without relying on
the legacy methods.

For example:

    slices.SortFunc(privileges, func(a, b plugin.Privilege) int {
        return cmp.Compare(a.Name, b.Name)
    })

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-08-31 14:57:34 +02:00
Sebastiaan van Stijn 43bc3e9d00 api/types/plugin: fix Privileges Swap implementation
Make Privileges.Swap only swap the requested elements, as required by
sort.Interface.

Previously, Swap also sorted the Value slices of both elements. Besides being
an unexpected side effect, this did not reliably sort all privilege values,
as elements that were never swapped could remain unsorted.

Also document the sort.Interface methods explicitly.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-08-29 13:46:05 +02:00
Sebastiaan van Stijn e8f156110a api/types/plugin: remove deprecated Config.DockerVersion
This was deprecated in c4fda95bea, and
already omitted.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-10 18:11:45 +01:00
Sebastiaan van Stijn 15a048c396 api, client: don't use a pointer-slice for plugins
The backend and router don't use a pointer-slice (the server actually
doesn't use the `plugin.ListResponse` type and a straight slice);
https://github.com/moby/moby/blob/778e5bfad3098bcc1b1457634e14c1c204ebf851/daemon/server/router/plugin/backend.go#L20
https://github.com/moby/moby/blob/6baf274fa3e90731ac653967cb0cea38e82b5e36/daemon/server/router/plugin/plugin_routes.go#L276-L280

Align the type in the API to match, and update the type defined in the
client accordingly.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-07 21:02:26 +01:00
Sebastiaan van Stijn c4fda95bea api/types/plugin: deprecate Config.DockerVersion field
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-06 14:19:53 +02:00
Sebastiaan van Stijn c13266d2c0 api/types: move plugin types to api/types/plugin
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-05 15:42:57 +02:00
Cory Snider ee560a3b23 api/types: fix Plugin.Config.Interface.Types def'n
The wire type of Plugin.Config.Interface.Types is an array of strings,
not of objects with three properties. We just so happen to have a Go
struct type to represent a plugin-interface-type value in memory with
all the fields parsed out for convenience, but that is not part of the
REST API contract documented by the Swager spec.U pdate the Swagger spec
to correctly document that the Types property is an array of strings in
the API, while still generating Go definitions that unmarshal into the
convenient struct type.

Move the definition and marshal/unmarshal methods for
PluginInterfaceType into a more appropriate location than api/types.
Rename the type to one that does not stutter or overload already
heavily overloaded terminology.

Modernize the parser and use property-based testing to assert that it
behaves the same as the old parser for all well-formed inputs.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2025-08-01 13:37:20 -04:00