client: PluginInspectWithRaw: refactor and rename to PluginInspect

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2025-10-21 23:14:08 +02:00
parent 2401bd1e12
commit ebc92e015a
11 changed files with 63 additions and 58 deletions

View File

@@ -33,7 +33,7 @@ func (d *Daemon) PluginIsNotRunning(t testing.TB, name string) func(poll.LogT) p
// PluginIsNotPresent provides a poller to check if the specified plugin is not present
func (d *Daemon) PluginIsNotPresent(t testing.TB, name string) func(poll.LogT) poll.Result {
return withClient(t, d, func(c client.APIClient, t poll.LogT) poll.Result {
_, _, err := c.PluginInspectWithRaw(context.Background(), name)
_, err := c.PluginInspect(context.Background(), name, client.PluginInspectOptions{})
if cerrdefs.IsNotFound(err) {
return poll.Success()
}
@@ -56,14 +56,14 @@ func (d *Daemon) PluginReferenceIs(t testing.TB, name, expectedRef string) func(
func withPluginInspect(name string, f func(*plugin.Plugin, poll.LogT) poll.Result) func(client.APIClient, poll.LogT) poll.Result {
return func(c client.APIClient, t poll.LogT) poll.Result {
p, _, err := c.PluginInspectWithRaw(context.Background(), name)
res, err := c.PluginInspect(context.Background(), name, client.PluginInspectOptions{})
if cerrdefs.IsNotFound(err) {
return poll.Continue("plugin %q not found", name)
}
if err != nil {
return poll.Error(err)
}
return f(p, t)
return f(&res.Plugin, t)
}
}