full diff: https://github.com/docker/docker/compare/v28.2.0-rc.1...8601b22f5db511354d643a7722d11d33aa7ae13f Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
29 lines
825 B
Go
29 lines
825 B
Go
package task
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/docker/docker/api/types/swarm"
|
|
"github.com/docker/docker/client"
|
|
)
|
|
|
|
type fakeClient struct {
|
|
client.APIClient
|
|
nodeInspectWithRaw func(ref string) (swarm.Node, []byte, error)
|
|
serviceInspectWithRaw func(ref string, options swarm.ServiceInspectOptions) (swarm.Service, []byte, error)
|
|
}
|
|
|
|
func (cli *fakeClient) NodeInspectWithRaw(_ context.Context, ref string) (swarm.Node, []byte, error) {
|
|
if cli.nodeInspectWithRaw != nil {
|
|
return cli.nodeInspectWithRaw(ref)
|
|
}
|
|
return swarm.Node{}, nil, nil
|
|
}
|
|
|
|
func (cli *fakeClient) ServiceInspectWithRaw(_ context.Context, ref string, options swarm.ServiceInspectOptions) (swarm.Service, []byte, error) {
|
|
if cli.serviceInspectWithRaw != nil {
|
|
return cli.serviceInspectWithRaw(ref, options)
|
|
}
|
|
return swarm.Service{}, nil, nil
|
|
}
|