`buildx.Build` doesn't terminate if context is canceled, so this PR rearranges things such that we can wait for the build or context to finish. Fixes #533.
603 lines
19 KiB
Go
603 lines
19 KiB
Go
// Code generated by MockGen. DO NOT EDIT.
|
|
// Source: client.go
|
|
//
|
|
// Generated by this command:
|
|
//
|
|
// mockgen -typed -package internal -source client.go -destination mockclient_test.go --self_package github.com/pulumi/pulumi-docker-build/provider/internal -imports buildx=github.com/docker/buildx/build
|
|
//
|
|
|
|
// Package internal is a generated GoMock package.
|
|
package internal
|
|
|
|
import (
|
|
context "context"
|
|
reflect "reflect"
|
|
|
|
buildx "github.com/docker/buildx/build"
|
|
builder "github.com/docker/buildx/builder"
|
|
pb "github.com/docker/buildx/controller/pb"
|
|
confutil "github.com/docker/buildx/util/confutil"
|
|
dockerutil "github.com/docker/buildx/util/dockerutil"
|
|
progress "github.com/docker/buildx/util/progress"
|
|
client "github.com/moby/buildkit/client"
|
|
session "github.com/moby/buildkit/session"
|
|
descriptor "github.com/regclient/regclient/types/descriptor"
|
|
gomock "go.uber.org/mock/gomock"
|
|
)
|
|
|
|
// MockClient is a mock of Client interface.
|
|
type MockClient struct {
|
|
ctrl *gomock.Controller
|
|
recorder *MockClientMockRecorder
|
|
isgomock struct{}
|
|
}
|
|
|
|
// MockClientMockRecorder is the mock recorder for MockClient.
|
|
type MockClientMockRecorder struct {
|
|
mock *MockClient
|
|
}
|
|
|
|
// NewMockClient creates a new mock instance.
|
|
func NewMockClient(ctrl *gomock.Controller) *MockClient {
|
|
mock := &MockClient{ctrl: ctrl}
|
|
mock.recorder = &MockClientMockRecorder{mock}
|
|
return mock
|
|
}
|
|
|
|
// EXPECT returns an object that allows the caller to indicate expected use.
|
|
func (m *MockClient) EXPECT() *MockClientMockRecorder {
|
|
return m.recorder
|
|
}
|
|
|
|
// Build mocks base method.
|
|
func (m *MockClient) Build(ctx context.Context, b Build) (*client.SolveResponse, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "Build", ctx, b)
|
|
ret0, _ := ret[0].(*client.SolveResponse)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// Build indicates an expected call of Build.
|
|
func (mr *MockClientMockRecorder) Build(ctx, b any) *MockClientBuildCall {
|
|
mr.mock.ctrl.T.Helper()
|
|
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Build", reflect.TypeOf((*MockClient)(nil).Build), ctx, b)
|
|
return &MockClientBuildCall{Call: call}
|
|
}
|
|
|
|
// MockClientBuildCall wrap *gomock.Call
|
|
type MockClientBuildCall struct {
|
|
*gomock.Call
|
|
}
|
|
|
|
// Return rewrite *gomock.Call.Return
|
|
func (c *MockClientBuildCall) Return(arg0 *client.SolveResponse, arg1 error) *MockClientBuildCall {
|
|
c.Call = c.Call.Return(arg0, arg1)
|
|
return c
|
|
}
|
|
|
|
// Do rewrite *gomock.Call.Do
|
|
func (c *MockClientBuildCall) Do(f func(context.Context, Build) (*client.SolveResponse, error)) *MockClientBuildCall {
|
|
c.Call = c.Call.Do(f)
|
|
return c
|
|
}
|
|
|
|
// DoAndReturn rewrite *gomock.Call.DoAndReturn
|
|
func (c *MockClientBuildCall) DoAndReturn(f func(context.Context, Build) (*client.SolveResponse, error)) *MockClientBuildCall {
|
|
c.Call = c.Call.DoAndReturn(f)
|
|
return c
|
|
}
|
|
|
|
// BuildKitEnabled mocks base method.
|
|
func (m *MockClient) BuildKitEnabled() (bool, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "BuildKitEnabled")
|
|
ret0, _ := ret[0].(bool)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// BuildKitEnabled indicates an expected call of BuildKitEnabled.
|
|
func (mr *MockClientMockRecorder) BuildKitEnabled() *MockClientBuildKitEnabledCall {
|
|
mr.mock.ctrl.T.Helper()
|
|
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BuildKitEnabled", reflect.TypeOf((*MockClient)(nil).BuildKitEnabled))
|
|
return &MockClientBuildKitEnabledCall{Call: call}
|
|
}
|
|
|
|
// MockClientBuildKitEnabledCall wrap *gomock.Call
|
|
type MockClientBuildKitEnabledCall struct {
|
|
*gomock.Call
|
|
}
|
|
|
|
// Return rewrite *gomock.Call.Return
|
|
func (c *MockClientBuildKitEnabledCall) Return(arg0 bool, arg1 error) *MockClientBuildKitEnabledCall {
|
|
c.Call = c.Call.Return(arg0, arg1)
|
|
return c
|
|
}
|
|
|
|
// Do rewrite *gomock.Call.Do
|
|
func (c *MockClientBuildKitEnabledCall) Do(f func() (bool, error)) *MockClientBuildKitEnabledCall {
|
|
c.Call = c.Call.Do(f)
|
|
return c
|
|
}
|
|
|
|
// DoAndReturn rewrite *gomock.Call.DoAndReturn
|
|
func (c *MockClientBuildKitEnabledCall) DoAndReturn(f func() (bool, error)) *MockClientBuildKitEnabledCall {
|
|
c.Call = c.Call.DoAndReturn(f)
|
|
return c
|
|
}
|
|
|
|
// Delete mocks base method.
|
|
func (m *MockClient) Delete(ctx context.Context, id string) error {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "Delete", ctx, id)
|
|
ret0, _ := ret[0].(error)
|
|
return ret0
|
|
}
|
|
|
|
// Delete indicates an expected call of Delete.
|
|
func (mr *MockClientMockRecorder) Delete(ctx, id any) *MockClientDeleteCall {
|
|
mr.mock.ctrl.T.Helper()
|
|
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockClient)(nil).Delete), ctx, id)
|
|
return &MockClientDeleteCall{Call: call}
|
|
}
|
|
|
|
// MockClientDeleteCall wrap *gomock.Call
|
|
type MockClientDeleteCall struct {
|
|
*gomock.Call
|
|
}
|
|
|
|
// Return rewrite *gomock.Call.Return
|
|
func (c *MockClientDeleteCall) Return(arg0 error) *MockClientDeleteCall {
|
|
c.Call = c.Call.Return(arg0)
|
|
return c
|
|
}
|
|
|
|
// Do rewrite *gomock.Call.Do
|
|
func (c *MockClientDeleteCall) Do(f func(context.Context, string) error) *MockClientDeleteCall {
|
|
c.Call = c.Call.Do(f)
|
|
return c
|
|
}
|
|
|
|
// DoAndReturn rewrite *gomock.Call.DoAndReturn
|
|
func (c *MockClientDeleteCall) DoAndReturn(f func(context.Context, string) error) *MockClientDeleteCall {
|
|
c.Call = c.Call.DoAndReturn(f)
|
|
return c
|
|
}
|
|
|
|
// Inspect mocks base method.
|
|
func (m *MockClient) Inspect(ctx context.Context, id string) ([]descriptor.Descriptor, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "Inspect", ctx, id)
|
|
ret0, _ := ret[0].([]descriptor.Descriptor)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// Inspect indicates an expected call of Inspect.
|
|
func (mr *MockClientMockRecorder) Inspect(ctx, id any) *MockClientInspectCall {
|
|
mr.mock.ctrl.T.Helper()
|
|
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Inspect", reflect.TypeOf((*MockClient)(nil).Inspect), ctx, id)
|
|
return &MockClientInspectCall{Call: call}
|
|
}
|
|
|
|
// MockClientInspectCall wrap *gomock.Call
|
|
type MockClientInspectCall struct {
|
|
*gomock.Call
|
|
}
|
|
|
|
// Return rewrite *gomock.Call.Return
|
|
func (c *MockClientInspectCall) Return(arg0 []descriptor.Descriptor, arg1 error) *MockClientInspectCall {
|
|
c.Call = c.Call.Return(arg0, arg1)
|
|
return c
|
|
}
|
|
|
|
// Do rewrite *gomock.Call.Do
|
|
func (c *MockClientInspectCall) Do(f func(context.Context, string) ([]descriptor.Descriptor, error)) *MockClientInspectCall {
|
|
c.Call = c.Call.Do(f)
|
|
return c
|
|
}
|
|
|
|
// DoAndReturn rewrite *gomock.Call.DoAndReturn
|
|
func (c *MockClientInspectCall) DoAndReturn(f func(context.Context, string) ([]descriptor.Descriptor, error)) *MockClientInspectCall {
|
|
c.Call = c.Call.DoAndReturn(f)
|
|
return c
|
|
}
|
|
|
|
// ManifestCreate mocks base method.
|
|
func (m *MockClient) ManifestCreate(ctx context.Context, push bool, target string, refs ...string) error {
|
|
m.ctrl.T.Helper()
|
|
varargs := []any{ctx, push, target}
|
|
for _, a := range refs {
|
|
varargs = append(varargs, a)
|
|
}
|
|
ret := m.ctrl.Call(m, "ManifestCreate", varargs...)
|
|
ret0, _ := ret[0].(error)
|
|
return ret0
|
|
}
|
|
|
|
// ManifestCreate indicates an expected call of ManifestCreate.
|
|
func (mr *MockClientMockRecorder) ManifestCreate(ctx, push, target any, refs ...any) *MockClientManifestCreateCall {
|
|
mr.mock.ctrl.T.Helper()
|
|
varargs := append([]any{ctx, push, target}, refs...)
|
|
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ManifestCreate", reflect.TypeOf((*MockClient)(nil).ManifestCreate), varargs...)
|
|
return &MockClientManifestCreateCall{Call: call}
|
|
}
|
|
|
|
// MockClientManifestCreateCall wrap *gomock.Call
|
|
type MockClientManifestCreateCall struct {
|
|
*gomock.Call
|
|
}
|
|
|
|
// Return rewrite *gomock.Call.Return
|
|
func (c *MockClientManifestCreateCall) Return(arg0 error) *MockClientManifestCreateCall {
|
|
c.Call = c.Call.Return(arg0)
|
|
return c
|
|
}
|
|
|
|
// Do rewrite *gomock.Call.Do
|
|
func (c *MockClientManifestCreateCall) Do(f func(context.Context, bool, string, ...string) error) *MockClientManifestCreateCall {
|
|
c.Call = c.Call.Do(f)
|
|
return c
|
|
}
|
|
|
|
// DoAndReturn rewrite *gomock.Call.DoAndReturn
|
|
func (c *MockClientManifestCreateCall) DoAndReturn(f func(context.Context, bool, string, ...string) error) *MockClientManifestCreateCall {
|
|
c.Call = c.Call.DoAndReturn(f)
|
|
return c
|
|
}
|
|
|
|
// ManifestDelete mocks base method.
|
|
func (m *MockClient) ManifestDelete(ctx context.Context, target string) error {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "ManifestDelete", ctx, target)
|
|
ret0, _ := ret[0].(error)
|
|
return ret0
|
|
}
|
|
|
|
// ManifestDelete indicates an expected call of ManifestDelete.
|
|
func (mr *MockClientMockRecorder) ManifestDelete(ctx, target any) *MockClientManifestDeleteCall {
|
|
mr.mock.ctrl.T.Helper()
|
|
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ManifestDelete", reflect.TypeOf((*MockClient)(nil).ManifestDelete), ctx, target)
|
|
return &MockClientManifestDeleteCall{Call: call}
|
|
}
|
|
|
|
// MockClientManifestDeleteCall wrap *gomock.Call
|
|
type MockClientManifestDeleteCall struct {
|
|
*gomock.Call
|
|
}
|
|
|
|
// Return rewrite *gomock.Call.Return
|
|
func (c *MockClientManifestDeleteCall) Return(arg0 error) *MockClientManifestDeleteCall {
|
|
c.Call = c.Call.Return(arg0)
|
|
return c
|
|
}
|
|
|
|
// Do rewrite *gomock.Call.Do
|
|
func (c *MockClientManifestDeleteCall) Do(f func(context.Context, string) error) *MockClientManifestDeleteCall {
|
|
c.Call = c.Call.Do(f)
|
|
return c
|
|
}
|
|
|
|
// DoAndReturn rewrite *gomock.Call.DoAndReturn
|
|
func (c *MockClientManifestDeleteCall) DoAndReturn(f func(context.Context, string) error) *MockClientManifestDeleteCall {
|
|
c.Call = c.Call.DoAndReturn(f)
|
|
return c
|
|
}
|
|
|
|
// ManifestInspect mocks base method.
|
|
func (m *MockClient) ManifestInspect(ctx context.Context, target string) (string, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "ManifestInspect", ctx, target)
|
|
ret0, _ := ret[0].(string)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// ManifestInspect indicates an expected call of ManifestInspect.
|
|
func (mr *MockClientMockRecorder) ManifestInspect(ctx, target any) *MockClientManifestInspectCall {
|
|
mr.mock.ctrl.T.Helper()
|
|
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ManifestInspect", reflect.TypeOf((*MockClient)(nil).ManifestInspect), ctx, target)
|
|
return &MockClientManifestInspectCall{Call: call}
|
|
}
|
|
|
|
// MockClientManifestInspectCall wrap *gomock.Call
|
|
type MockClientManifestInspectCall struct {
|
|
*gomock.Call
|
|
}
|
|
|
|
// Return rewrite *gomock.Call.Return
|
|
func (c *MockClientManifestInspectCall) Return(arg0 string, arg1 error) *MockClientManifestInspectCall {
|
|
c.Call = c.Call.Return(arg0, arg1)
|
|
return c
|
|
}
|
|
|
|
// Do rewrite *gomock.Call.Do
|
|
func (c *MockClientManifestInspectCall) Do(f func(context.Context, string) (string, error)) *MockClientManifestInspectCall {
|
|
c.Call = c.Call.Do(f)
|
|
return c
|
|
}
|
|
|
|
// DoAndReturn rewrite *gomock.Call.DoAndReturn
|
|
func (c *MockClientManifestInspectCall) DoAndReturn(f func(context.Context, string) (string, error)) *MockClientManifestInspectCall {
|
|
c.Call = c.Call.DoAndReturn(f)
|
|
return c
|
|
}
|
|
|
|
// SupportsMultipleExports mocks base method.
|
|
func (m *MockClient) SupportsMultipleExports() bool {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "SupportsMultipleExports")
|
|
ret0, _ := ret[0].(bool)
|
|
return ret0
|
|
}
|
|
|
|
// SupportsMultipleExports indicates an expected call of SupportsMultipleExports.
|
|
func (mr *MockClientMockRecorder) SupportsMultipleExports() *MockClientSupportsMultipleExportsCall {
|
|
mr.mock.ctrl.T.Helper()
|
|
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SupportsMultipleExports", reflect.TypeOf((*MockClient)(nil).SupportsMultipleExports))
|
|
return &MockClientSupportsMultipleExportsCall{Call: call}
|
|
}
|
|
|
|
// MockClientSupportsMultipleExportsCall wrap *gomock.Call
|
|
type MockClientSupportsMultipleExportsCall struct {
|
|
*gomock.Call
|
|
}
|
|
|
|
// Return rewrite *gomock.Call.Return
|
|
func (c *MockClientSupportsMultipleExportsCall) Return(arg0 bool) *MockClientSupportsMultipleExportsCall {
|
|
c.Call = c.Call.Return(arg0)
|
|
return c
|
|
}
|
|
|
|
// Do rewrite *gomock.Call.Do
|
|
func (c *MockClientSupportsMultipleExportsCall) Do(f func() bool) *MockClientSupportsMultipleExportsCall {
|
|
c.Call = c.Call.Do(f)
|
|
return c
|
|
}
|
|
|
|
// DoAndReturn rewrite *gomock.Call.DoAndReturn
|
|
func (c *MockClientSupportsMultipleExportsCall) DoAndReturn(f func() bool) *MockClientSupportsMultipleExportsCall {
|
|
c.Call = c.Call.DoAndReturn(f)
|
|
return c
|
|
}
|
|
|
|
// MockBuild is a mock of Build interface.
|
|
type MockBuild struct {
|
|
ctrl *gomock.Controller
|
|
recorder *MockBuildMockRecorder
|
|
isgomock struct{}
|
|
}
|
|
|
|
// MockBuildMockRecorder is the mock recorder for MockBuild.
|
|
type MockBuildMockRecorder struct {
|
|
mock *MockBuild
|
|
}
|
|
|
|
// NewMockBuild creates a new mock instance.
|
|
func NewMockBuild(ctrl *gomock.Controller) *MockBuild {
|
|
mock := &MockBuild{ctrl: ctrl}
|
|
mock.recorder = &MockBuildMockRecorder{mock}
|
|
return mock
|
|
}
|
|
|
|
// EXPECT returns an object that allows the caller to indicate expected use.
|
|
func (m *MockBuild) EXPECT() *MockBuildMockRecorder {
|
|
return m.recorder
|
|
}
|
|
|
|
// BuildOptions mocks base method.
|
|
func (m *MockBuild) BuildOptions() pb.BuildOptions {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "BuildOptions")
|
|
ret0, _ := ret[0].(pb.BuildOptions)
|
|
return ret0
|
|
}
|
|
|
|
// BuildOptions indicates an expected call of BuildOptions.
|
|
func (mr *MockBuildMockRecorder) BuildOptions() *MockBuildBuildOptionsCall {
|
|
mr.mock.ctrl.T.Helper()
|
|
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BuildOptions", reflect.TypeOf((*MockBuild)(nil).BuildOptions))
|
|
return &MockBuildBuildOptionsCall{Call: call}
|
|
}
|
|
|
|
// MockBuildBuildOptionsCall wrap *gomock.Call
|
|
type MockBuildBuildOptionsCall struct {
|
|
*gomock.Call
|
|
}
|
|
|
|
// Return rewrite *gomock.Call.Return
|
|
func (c *MockBuildBuildOptionsCall) Return(arg0 pb.BuildOptions) *MockBuildBuildOptionsCall {
|
|
c.Call = c.Call.Return(arg0)
|
|
return c
|
|
}
|
|
|
|
// Do rewrite *gomock.Call.Do
|
|
func (c *MockBuildBuildOptionsCall) Do(f func() pb.BuildOptions) *MockBuildBuildOptionsCall {
|
|
c.Call = c.Call.Do(f)
|
|
return c
|
|
}
|
|
|
|
// DoAndReturn rewrite *gomock.Call.DoAndReturn
|
|
func (c *MockBuildBuildOptionsCall) DoAndReturn(f func() pb.BuildOptions) *MockBuildBuildOptionsCall {
|
|
c.Call = c.Call.DoAndReturn(f)
|
|
return c
|
|
}
|
|
|
|
// Inline mocks base method.
|
|
func (m *MockBuild) Inline() string {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "Inline")
|
|
ret0, _ := ret[0].(string)
|
|
return ret0
|
|
}
|
|
|
|
// Inline indicates an expected call of Inline.
|
|
func (mr *MockBuildMockRecorder) Inline() *MockBuildInlineCall {
|
|
mr.mock.ctrl.T.Helper()
|
|
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Inline", reflect.TypeOf((*MockBuild)(nil).Inline))
|
|
return &MockBuildInlineCall{Call: call}
|
|
}
|
|
|
|
// MockBuildInlineCall wrap *gomock.Call
|
|
type MockBuildInlineCall struct {
|
|
*gomock.Call
|
|
}
|
|
|
|
// Return rewrite *gomock.Call.Return
|
|
func (c *MockBuildInlineCall) Return(arg0 string) *MockBuildInlineCall {
|
|
c.Call = c.Call.Return(arg0)
|
|
return c
|
|
}
|
|
|
|
// Do rewrite *gomock.Call.Do
|
|
func (c *MockBuildInlineCall) Do(f func() string) *MockBuildInlineCall {
|
|
c.Call = c.Call.Do(f)
|
|
return c
|
|
}
|
|
|
|
// DoAndReturn rewrite *gomock.Call.DoAndReturn
|
|
func (c *MockBuildInlineCall) DoAndReturn(f func() string) *MockBuildInlineCall {
|
|
c.Call = c.Call.DoAndReturn(f)
|
|
return c
|
|
}
|
|
|
|
// Secrets mocks base method.
|
|
func (m *MockBuild) Secrets() session.Attachable {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "Secrets")
|
|
ret0, _ := ret[0].(session.Attachable)
|
|
return ret0
|
|
}
|
|
|
|
// Secrets indicates an expected call of Secrets.
|
|
func (mr *MockBuildMockRecorder) Secrets() *MockBuildSecretsCall {
|
|
mr.mock.ctrl.T.Helper()
|
|
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Secrets", reflect.TypeOf((*MockBuild)(nil).Secrets))
|
|
return &MockBuildSecretsCall{Call: call}
|
|
}
|
|
|
|
// MockBuildSecretsCall wrap *gomock.Call
|
|
type MockBuildSecretsCall struct {
|
|
*gomock.Call
|
|
}
|
|
|
|
// Return rewrite *gomock.Call.Return
|
|
func (c *MockBuildSecretsCall) Return(arg0 session.Attachable) *MockBuildSecretsCall {
|
|
c.Call = c.Call.Return(arg0)
|
|
return c
|
|
}
|
|
|
|
// Do rewrite *gomock.Call.Do
|
|
func (c *MockBuildSecretsCall) Do(f func() session.Attachable) *MockBuildSecretsCall {
|
|
c.Call = c.Call.Do(f)
|
|
return c
|
|
}
|
|
|
|
// DoAndReturn rewrite *gomock.Call.DoAndReturn
|
|
func (c *MockBuildSecretsCall) DoAndReturn(f func() session.Attachable) *MockBuildSecretsCall {
|
|
c.Call = c.Call.DoAndReturn(f)
|
|
return c
|
|
}
|
|
|
|
// ShouldExec mocks base method.
|
|
func (m *MockBuild) ShouldExec() bool {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "ShouldExec")
|
|
ret0, _ := ret[0].(bool)
|
|
return ret0
|
|
}
|
|
|
|
// ShouldExec indicates an expected call of ShouldExec.
|
|
func (mr *MockBuildMockRecorder) ShouldExec() *MockBuildShouldExecCall {
|
|
mr.mock.ctrl.T.Helper()
|
|
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ShouldExec", reflect.TypeOf((*MockBuild)(nil).ShouldExec))
|
|
return &MockBuildShouldExecCall{Call: call}
|
|
}
|
|
|
|
// MockBuildShouldExecCall wrap *gomock.Call
|
|
type MockBuildShouldExecCall struct {
|
|
*gomock.Call
|
|
}
|
|
|
|
// Return rewrite *gomock.Call.Return
|
|
func (c *MockBuildShouldExecCall) Return(arg0 bool) *MockBuildShouldExecCall {
|
|
c.Call = c.Call.Return(arg0)
|
|
return c
|
|
}
|
|
|
|
// Do rewrite *gomock.Call.Do
|
|
func (c *MockBuildShouldExecCall) Do(f func() bool) *MockBuildShouldExecCall {
|
|
c.Call = c.Call.Do(f)
|
|
return c
|
|
}
|
|
|
|
// DoAndReturn rewrite *gomock.Call.DoAndReturn
|
|
func (c *MockBuildShouldExecCall) DoAndReturn(f func() bool) *MockBuildShouldExecCall {
|
|
c.Call = c.Call.DoAndReturn(f)
|
|
return c
|
|
}
|
|
|
|
// MockBuilder is a mock of Builder interface.
|
|
type MockBuilder struct {
|
|
ctrl *gomock.Controller
|
|
recorder *MockBuilderMockRecorder
|
|
isgomock struct{}
|
|
}
|
|
|
|
// MockBuilderMockRecorder is the mock recorder for MockBuilder.
|
|
type MockBuilderMockRecorder struct {
|
|
mock *MockBuilder
|
|
}
|
|
|
|
// NewMockBuilder creates a new mock instance.
|
|
func NewMockBuilder(ctrl *gomock.Controller) *MockBuilder {
|
|
mock := &MockBuilder{ctrl: ctrl}
|
|
mock.recorder = &MockBuilderMockRecorder{mock}
|
|
return mock
|
|
}
|
|
|
|
// EXPECT returns an object that allows the caller to indicate expected use.
|
|
func (m *MockBuilder) EXPECT() *MockBuilderMockRecorder {
|
|
return m.recorder
|
|
}
|
|
|
|
// Build mocks base method.
|
|
func (m *MockBuilder) Build(ctx context.Context, nodes []builder.Node, opts map[string]buildx.Options, docker *dockerutil.Client, cfg *confutil.Config, w progress.Writer) (map[string]*client.SolveResponse, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "Build", ctx, nodes, opts, docker, cfg, w)
|
|
ret0, _ := ret[0].(map[string]*client.SolveResponse)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// Build indicates an expected call of Build.
|
|
func (mr *MockBuilderMockRecorder) Build(ctx, nodes, opts, docker, cfg, w any) *MockBuilderBuildCall {
|
|
mr.mock.ctrl.T.Helper()
|
|
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Build", reflect.TypeOf((*MockBuilder)(nil).Build), ctx, nodes, opts, docker, cfg, w)
|
|
return &MockBuilderBuildCall{Call: call}
|
|
}
|
|
|
|
// MockBuilderBuildCall wrap *gomock.Call
|
|
type MockBuilderBuildCall struct {
|
|
*gomock.Call
|
|
}
|
|
|
|
// Return rewrite *gomock.Call.Return
|
|
func (c *MockBuilderBuildCall) Return(resp map[string]*client.SolveResponse, err error) *MockBuilderBuildCall {
|
|
c.Call = c.Call.Return(resp, err)
|
|
return c
|
|
}
|
|
|
|
// Do rewrite *gomock.Call.Do
|
|
func (c *MockBuilderBuildCall) Do(f func(context.Context, []builder.Node, map[string]buildx.Options, *dockerutil.Client, *confutil.Config, progress.Writer) (map[string]*client.SolveResponse, error)) *MockBuilderBuildCall {
|
|
c.Call = c.Call.Do(f)
|
|
return c
|
|
}
|
|
|
|
// DoAndReturn rewrite *gomock.Call.DoAndReturn
|
|
func (c *MockBuilderBuildCall) DoAndReturn(f func(context.Context, []builder.Node, map[string]buildx.Options, *dockerutil.Client, *confutil.Config, progress.Writer) (map[string]*client.SolveResponse, error)) *MockBuilderBuildCall {
|
|
c.Call = c.Call.DoAndReturn(f)
|
|
return c
|
|
}
|