2024-02-21 16:36:17 +01:00
|
|
|
package builder
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
2025-05-16 18:52:28 +02:00
|
|
|
"github.com/docker/docker/api/types/build"
|
2024-02-21 16:36:17 +01:00
|
|
|
"github.com/docker/docker/client"
|
|
|
|
)
|
|
|
|
|
|
|
|
type fakeClient struct {
|
|
|
|
client.Client
|
2025-05-16 18:52:28 +02:00
|
|
|
builderPruneFunc func(ctx context.Context, opts build.CachePruneOptions) (*build.CachePruneReport, error)
|
2024-02-21 16:36:17 +01:00
|
|
|
}
|
|
|
|
|
2025-05-16 18:52:28 +02:00
|
|
|
func (c *fakeClient) BuildCachePrune(ctx context.Context, opts build.CachePruneOptions) (*build.CachePruneReport, error) {
|
2024-02-21 16:36:17 +01:00
|
|
|
if c.builderPruneFunc != nil {
|
|
|
|
return c.builderPruneFunc(ctx, opts)
|
|
|
|
}
|
|
|
|
return nil, nil
|
|
|
|
}
|