From 7c6d1be8a7664d1ab2362691fab946d1e85664f1 Mon Sep 17 00:00:00 2001 From: Pasha Sviderski Date: Wed, 28 Oct 2026 20:21:09 +1000 Subject: [PATCH] feat(images): implement RemoveImage gRPC API with extra protection for used images --- .mockery.yml | 6 + HACKING.md | 2 +- Makefile | 4 - api/pb/docker.pb.go | 1015 ++- api/pb/docker.proto | 35 + api/pb/docker_grpc.pb.go | 38 + internal/machine/caddyconfig/mocks_test.go | 11 +- internal/machine/docker/controller.go | 2 +- internal/machine/docker/image.go | 79 + internal/machine/docker/image_test.go | 175 + internal/machine/docker/mocks_test.go | 8271 ++++++++++++++++++++ internal/machine/docker/server.go | 37 +- internal/machine/docker/service.go | 4 +- mise.lock | 132 +- mise.toml | 6 +- pkg/api/client.go | 2 + pkg/api/image.go | 28 +- pkg/client/image.go | 78 + test/e2e/service_test.go | 75 +- 19 files changed, 9623 insertions(+), 377 deletions(-) create mode 100644 internal/machine/docker/image.go create mode 100644 internal/machine/docker/image_test.go create mode 100644 internal/machine/docker/mocks_test.go diff --git a/.mockery.yml b/.mockery.yml index 2d192628..0bac7596 100644 --- a/.mockery.yml +++ b/.mockery.yml @@ -1,4 +1,10 @@ packages: + github.com/docker/docker/client: + config: + dir: internal/machine/docker + pkgname: docker + interfaces: + APIClient: github.com/psviderski/uncloud/internal/machine/caddyconfig: interfaces: CaddyfileValidator: diff --git a/HACKING.md b/HACKING.md index 7297d6ec..05dfadee 100644 --- a/HACKING.md +++ b/HACKING.md @@ -116,7 +116,7 @@ mise run proto Regenerate mocks: ```shell -make mocks +mise run mocks ``` ## Uncloud in Docker (UCinD) diff --git a/Makefile b/Makefile index c1fb8205..cf920294 100644 --- a/Makefile +++ b/Makefile @@ -21,10 +21,6 @@ corrosion-multiarch-image-push: ucind-multiarch-image-push: docker buildx build --push --platform linux/amd64,linux/arm64 -t "$(UCIND_IMAGE)" --target ucind . -.PHONY: mocks -mocks: - @mockery - .PHONY: test test: ifeq ($(TEST_NAME),) diff --git a/api/pb/docker.pb.go b/api/pb/docker.pb.go index d13f7be7..5f535ab6 100644 --- a/api/pb/docker.pb.go +++ b/api/pb/docker.pb.go @@ -67,7 +67,7 @@ func (x CreateServiceContainerRequest_ContainerType) Number() protoreflect.EnumN // Deprecated: Use CreateServiceContainerRequest_ContainerType.Descriptor instead. func (CreateServiceContainerRequest_ContainerType) EnumDescriptor() ([]byte, []int) { - return file_api_pb_docker_proto_rawDescGZIP(), []int{31, 0} + return file_api_pb_docker_proto_rawDescGZIP(), []int{36, 0} } type CreateContainerRequest struct { @@ -1402,6 +1402,318 @@ func (x *ListImagesRequest) GetOptions() []byte { return nil } +type RemoveImageRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Force bool `protobuf:"varint,2,opt,name=force,proto3" json:"force,omitempty"` + PruneChildren bool `protobuf:"varint,3,opt,name=prune_children,json=pruneChildren,proto3" json:"prune_children,omitempty"` + Platforms []*ImagePlatform `protobuf:"bytes,4,rep,name=platforms,proto3" json:"platforms,omitempty"` +} + +func (x *RemoveImageRequest) Reset() { + *x = RemoveImageRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_pb_docker_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemoveImageRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveImageRequest) ProtoMessage() {} + +func (x *RemoveImageRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_pb_docker_proto_msgTypes[23] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoveImageRequest.ProtoReflect.Descriptor instead. +func (*RemoveImageRequest) Descriptor() ([]byte, []int) { + return file_api_pb_docker_proto_rawDescGZIP(), []int{23} +} + +func (x *RemoveImageRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *RemoveImageRequest) GetForce() bool { + if x != nil { + return x.Force + } + return false +} + +func (x *RemoveImageRequest) GetPruneChildren() bool { + if x != nil { + return x.PruneChildren + } + return false +} + +func (x *RemoveImageRequest) GetPlatforms() []*ImagePlatform { + if x != nil { + return x.Platforms + } + return nil +} + +// ImagePlatform describes an OCI image platform. +type ImagePlatform struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Architecture string `protobuf:"bytes,1,opt,name=architecture,proto3" json:"architecture,omitempty"` + Os string `protobuf:"bytes,2,opt,name=os,proto3" json:"os,omitempty"` + OsVersion string `protobuf:"bytes,3,opt,name=os_version,json=osVersion,proto3" json:"os_version,omitempty"` + OsFeatures []string `protobuf:"bytes,4,rep,name=os_features,json=osFeatures,proto3" json:"os_features,omitempty"` + Variant string `protobuf:"bytes,5,opt,name=variant,proto3" json:"variant,omitempty"` +} + +func (x *ImagePlatform) Reset() { + *x = ImagePlatform{} + if protoimpl.UnsafeEnabled { + mi := &file_api_pb_docker_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ImagePlatform) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ImagePlatform) ProtoMessage() {} + +func (x *ImagePlatform) ProtoReflect() protoreflect.Message { + mi := &file_api_pb_docker_proto_msgTypes[24] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ImagePlatform.ProtoReflect.Descriptor instead. +func (*ImagePlatform) Descriptor() ([]byte, []int) { + return file_api_pb_docker_proto_rawDescGZIP(), []int{24} +} + +func (x *ImagePlatform) GetArchitecture() string { + if x != nil { + return x.Architecture + } + return "" +} + +func (x *ImagePlatform) GetOs() string { + if x != nil { + return x.Os + } + return "" +} + +func (x *ImagePlatform) GetOsVersion() string { + if x != nil { + return x.OsVersion + } + return "" +} + +func (x *ImagePlatform) GetOsFeatures() []string { + if x != nil { + return x.OsFeatures + } + return nil +} + +func (x *ImagePlatform) GetVariant() string { + if x != nil { + return x.Variant + } + return "" +} + +type RemoveImageResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Must contain only one repeated messages field to allow broadcasting RemoveImage requests to multiple machines. + Messages []*MachineImageRemoval `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"` +} + +func (x *RemoveImageResponse) Reset() { + *x = RemoveImageResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_api_pb_docker_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemoveImageResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveImageResponse) ProtoMessage() {} + +func (x *RemoveImageResponse) ProtoReflect() protoreflect.Message { + mi := &file_api_pb_docker_proto_msgTypes[25] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoveImageResponse.ProtoReflect.Descriptor instead. +func (*RemoveImageResponse) Descriptor() ([]byte, []int) { + return file_api_pb_docker_proto_rawDescGZIP(), []int{25} +} + +func (x *RemoveImageResponse) GetMessages() []*MachineImageRemoval { + if x != nil { + return x.Messages + } + return nil +} + +type MachineImageRemoval struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Metadata *Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` + Results []*ImageRemoval `protobuf:"bytes,2,rep,name=results,proto3" json:"results,omitempty"` +} + +func (x *MachineImageRemoval) Reset() { + *x = MachineImageRemoval{} + if protoimpl.UnsafeEnabled { + mi := &file_api_pb_docker_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MachineImageRemoval) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MachineImageRemoval) ProtoMessage() {} + +func (x *MachineImageRemoval) ProtoReflect() protoreflect.Message { + mi := &file_api_pb_docker_proto_msgTypes[26] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MachineImageRemoval.ProtoReflect.Descriptor instead. +func (*MachineImageRemoval) Descriptor() ([]byte, []int) { + return file_api_pb_docker_proto_rawDescGZIP(), []int{26} +} + +func (x *MachineImageRemoval) GetMetadata() *Metadata { + if x != nil { + return x.Metadata + } + return nil +} + +func (x *MachineImageRemoval) GetResults() []*ImageRemoval { + if x != nil { + return x.Results + } + return nil +} + +// ImageRemoval reports an image deletion or an untagged image reference. +type ImageRemoval struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The image ID of an image that was deleted. + Deleted string `protobuf:"bytes,1,opt,name=deleted,proto3" json:"deleted,omitempty"` + // The image reference of an image that was untagged. + Untagged string `protobuf:"bytes,2,opt,name=untagged,proto3" json:"untagged,omitempty"` +} + +func (x *ImageRemoval) Reset() { + *x = ImageRemoval{} + if protoimpl.UnsafeEnabled { + mi := &file_api_pb_docker_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ImageRemoval) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ImageRemoval) ProtoMessage() {} + +func (x *ImageRemoval) ProtoReflect() protoreflect.Message { + mi := &file_api_pb_docker_proto_msgTypes[27] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ImageRemoval.ProtoReflect.Descriptor instead. +func (*ImageRemoval) Descriptor() ([]byte, []int) { + return file_api_pb_docker_proto_rawDescGZIP(), []int{27} +} + +func (x *ImageRemoval) GetDeleted() string { + if x != nil { + return x.Deleted + } + return "" +} + +func (x *ImageRemoval) GetUntagged() string { + if x != nil { + return x.Untagged + } + return "" +} + type ListImagesResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1414,7 +1726,7 @@ type ListImagesResponse struct { func (x *ListImagesResponse) Reset() { *x = ListImagesResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_pb_docker_proto_msgTypes[23] + mi := &file_api_pb_docker_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1427,7 +1739,7 @@ func (x *ListImagesResponse) String() string { func (*ListImagesResponse) ProtoMessage() {} func (x *ListImagesResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_pb_docker_proto_msgTypes[23] + mi := &file_api_pb_docker_proto_msgTypes[28] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1440,7 +1752,7 @@ func (x *ListImagesResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListImagesResponse.ProtoReflect.Descriptor instead. func (*ListImagesResponse) Descriptor() ([]byte, []int) { - return file_api_pb_docker_proto_rawDescGZIP(), []int{23} + return file_api_pb_docker_proto_rawDescGZIP(), []int{28} } func (x *ListImagesResponse) GetMessages() []*MachineImages { @@ -1465,7 +1777,7 @@ type MachineImages struct { func (x *MachineImages) Reset() { *x = MachineImages{} if protoimpl.UnsafeEnabled { - mi := &file_api_pb_docker_proto_msgTypes[24] + mi := &file_api_pb_docker_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1478,7 +1790,7 @@ func (x *MachineImages) String() string { func (*MachineImages) ProtoMessage() {} func (x *MachineImages) ProtoReflect() protoreflect.Message { - mi := &file_api_pb_docker_proto_msgTypes[24] + mi := &file_api_pb_docker_proto_msgTypes[29] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1491,7 +1803,7 @@ func (x *MachineImages) ProtoReflect() protoreflect.Message { // Deprecated: Use MachineImages.ProtoReflect.Descriptor instead. func (*MachineImages) Descriptor() ([]byte, []int) { - return file_api_pb_docker_proto_rawDescGZIP(), []int{24} + return file_api_pb_docker_proto_rawDescGZIP(), []int{29} } func (x *MachineImages) GetMetadata() *Metadata { @@ -1527,7 +1839,7 @@ type CreateVolumeRequest struct { func (x *CreateVolumeRequest) Reset() { *x = CreateVolumeRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_pb_docker_proto_msgTypes[25] + mi := &file_api_pb_docker_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1540,7 +1852,7 @@ func (x *CreateVolumeRequest) String() string { func (*CreateVolumeRequest) ProtoMessage() {} func (x *CreateVolumeRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_pb_docker_proto_msgTypes[25] + mi := &file_api_pb_docker_proto_msgTypes[30] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1553,7 +1865,7 @@ func (x *CreateVolumeRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateVolumeRequest.ProtoReflect.Descriptor instead. func (*CreateVolumeRequest) Descriptor() ([]byte, []int) { - return file_api_pb_docker_proto_rawDescGZIP(), []int{25} + return file_api_pb_docker_proto_rawDescGZIP(), []int{30} } func (x *CreateVolumeRequest) GetOptions() []byte { @@ -1575,7 +1887,7 @@ type CreateVolumeResponse struct { func (x *CreateVolumeResponse) Reset() { *x = CreateVolumeResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_pb_docker_proto_msgTypes[26] + mi := &file_api_pb_docker_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1588,7 +1900,7 @@ func (x *CreateVolumeResponse) String() string { func (*CreateVolumeResponse) ProtoMessage() {} func (x *CreateVolumeResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_pb_docker_proto_msgTypes[26] + mi := &file_api_pb_docker_proto_msgTypes[31] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1601,7 +1913,7 @@ func (x *CreateVolumeResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateVolumeResponse.ProtoReflect.Descriptor instead. func (*CreateVolumeResponse) Descriptor() ([]byte, []int) { - return file_api_pb_docker_proto_rawDescGZIP(), []int{26} + return file_api_pb_docker_proto_rawDescGZIP(), []int{31} } func (x *CreateVolumeResponse) GetVolume() []byte { @@ -1623,7 +1935,7 @@ type ListVolumesRequest struct { func (x *ListVolumesRequest) Reset() { *x = ListVolumesRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_pb_docker_proto_msgTypes[27] + mi := &file_api_pb_docker_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1636,7 +1948,7 @@ func (x *ListVolumesRequest) String() string { func (*ListVolumesRequest) ProtoMessage() {} func (x *ListVolumesRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_pb_docker_proto_msgTypes[27] + mi := &file_api_pb_docker_proto_msgTypes[32] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1649,7 +1961,7 @@ func (x *ListVolumesRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ListVolumesRequest.ProtoReflect.Descriptor instead. func (*ListVolumesRequest) Descriptor() ([]byte, []int) { - return file_api_pb_docker_proto_rawDescGZIP(), []int{27} + return file_api_pb_docker_proto_rawDescGZIP(), []int{32} } func (x *ListVolumesRequest) GetOptions() []byte { @@ -1671,7 +1983,7 @@ type ListVolumesResponse struct { func (x *ListVolumesResponse) Reset() { *x = ListVolumesResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_pb_docker_proto_msgTypes[28] + mi := &file_api_pb_docker_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1684,7 +1996,7 @@ func (x *ListVolumesResponse) String() string { func (*ListVolumesResponse) ProtoMessage() {} func (x *ListVolumesResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_pb_docker_proto_msgTypes[28] + mi := &file_api_pb_docker_proto_msgTypes[33] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1697,7 +2009,7 @@ func (x *ListVolumesResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListVolumesResponse.ProtoReflect.Descriptor instead. func (*ListVolumesResponse) Descriptor() ([]byte, []int) { - return file_api_pb_docker_proto_rawDescGZIP(), []int{28} + return file_api_pb_docker_proto_rawDescGZIP(), []int{33} } func (x *ListVolumesResponse) GetMessages() []*MachineVolumes { @@ -1720,7 +2032,7 @@ type MachineVolumes struct { func (x *MachineVolumes) Reset() { *x = MachineVolumes{} if protoimpl.UnsafeEnabled { - mi := &file_api_pb_docker_proto_msgTypes[29] + mi := &file_api_pb_docker_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1733,7 +2045,7 @@ func (x *MachineVolumes) String() string { func (*MachineVolumes) ProtoMessage() {} func (x *MachineVolumes) ProtoReflect() protoreflect.Message { - mi := &file_api_pb_docker_proto_msgTypes[29] + mi := &file_api_pb_docker_proto_msgTypes[34] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1746,7 +2058,7 @@ func (x *MachineVolumes) ProtoReflect() protoreflect.Message { // Deprecated: Use MachineVolumes.ProtoReflect.Descriptor instead. func (*MachineVolumes) Descriptor() ([]byte, []int) { - return file_api_pb_docker_proto_rawDescGZIP(), []int{29} + return file_api_pb_docker_proto_rawDescGZIP(), []int{34} } func (x *MachineVolumes) GetMetadata() *Metadata { @@ -1775,7 +2087,7 @@ type RemoveVolumeRequest struct { func (x *RemoveVolumeRequest) Reset() { *x = RemoveVolumeRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_pb_docker_proto_msgTypes[30] + mi := &file_api_pb_docker_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1788,7 +2100,7 @@ func (x *RemoveVolumeRequest) String() string { func (*RemoveVolumeRequest) ProtoMessage() {} func (x *RemoveVolumeRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_pb_docker_proto_msgTypes[30] + mi := &file_api_pb_docker_proto_msgTypes[35] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1801,7 +2113,7 @@ func (x *RemoveVolumeRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use RemoveVolumeRequest.ProtoReflect.Descriptor instead. func (*RemoveVolumeRequest) Descriptor() ([]byte, []int) { - return file_api_pb_docker_proto_rawDescGZIP(), []int{30} + return file_api_pb_docker_proto_rawDescGZIP(), []int{35} } func (x *RemoveVolumeRequest) GetId() string { @@ -1833,7 +2145,7 @@ type CreateServiceContainerRequest struct { func (x *CreateServiceContainerRequest) Reset() { *x = CreateServiceContainerRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_pb_docker_proto_msgTypes[31] + mi := &file_api_pb_docker_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1846,7 +2158,7 @@ func (x *CreateServiceContainerRequest) String() string { func (*CreateServiceContainerRequest) ProtoMessage() {} func (x *CreateServiceContainerRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_pb_docker_proto_msgTypes[31] + mi := &file_api_pb_docker_proto_msgTypes[36] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1859,7 +2171,7 @@ func (x *CreateServiceContainerRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateServiceContainerRequest.ProtoReflect.Descriptor instead. func (*CreateServiceContainerRequest) Descriptor() ([]byte, []int) { - return file_api_pb_docker_proto_rawDescGZIP(), []int{31} + return file_api_pb_docker_proto_rawDescGZIP(), []int{36} } func (x *CreateServiceContainerRequest) GetServiceId() string { @@ -1904,7 +2216,7 @@ type ServiceContainer struct { func (x *ServiceContainer) Reset() { *x = ServiceContainer{} if protoimpl.UnsafeEnabled { - mi := &file_api_pb_docker_proto_msgTypes[32] + mi := &file_api_pb_docker_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1917,7 +2229,7 @@ func (x *ServiceContainer) String() string { func (*ServiceContainer) ProtoMessage() {} func (x *ServiceContainer) ProtoReflect() protoreflect.Message { - mi := &file_api_pb_docker_proto_msgTypes[32] + mi := &file_api_pb_docker_proto_msgTypes[37] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1930,7 +2242,7 @@ func (x *ServiceContainer) ProtoReflect() protoreflect.Message { // Deprecated: Use ServiceContainer.ProtoReflect.Descriptor instead. func (*ServiceContainer) Descriptor() ([]byte, []int) { - return file_api_pb_docker_proto_rawDescGZIP(), []int{32} + return file_api_pb_docker_proto_rawDescGZIP(), []int{37} } func (x *ServiceContainer) GetContainer() []byte { @@ -1960,7 +2272,7 @@ type ListServiceContainersRequest struct { func (x *ListServiceContainersRequest) Reset() { *x = ListServiceContainersRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_pb_docker_proto_msgTypes[33] + mi := &file_api_pb_docker_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1973,7 +2285,7 @@ func (x *ListServiceContainersRequest) String() string { func (*ListServiceContainersRequest) ProtoMessage() {} func (x *ListServiceContainersRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_pb_docker_proto_msgTypes[33] + mi := &file_api_pb_docker_proto_msgTypes[38] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1986,7 +2298,7 @@ func (x *ListServiceContainersRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ListServiceContainersRequest.ProtoReflect.Descriptor instead. func (*ListServiceContainersRequest) Descriptor() ([]byte, []int) { - return file_api_pb_docker_proto_rawDescGZIP(), []int{33} + return file_api_pb_docker_proto_rawDescGZIP(), []int{38} } func (x *ListServiceContainersRequest) GetServiceId() string { @@ -2016,7 +2328,7 @@ type ListServiceContainersResponse struct { func (x *ListServiceContainersResponse) Reset() { *x = ListServiceContainersResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_pb_docker_proto_msgTypes[34] + mi := &file_api_pb_docker_proto_msgTypes[39] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2029,7 +2341,7 @@ func (x *ListServiceContainersResponse) String() string { func (*ListServiceContainersResponse) ProtoMessage() {} func (x *ListServiceContainersResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_pb_docker_proto_msgTypes[34] + mi := &file_api_pb_docker_proto_msgTypes[39] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2042,7 +2354,7 @@ func (x *ListServiceContainersResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListServiceContainersResponse.ProtoReflect.Descriptor instead. func (*ListServiceContainersResponse) Descriptor() ([]byte, []int) { - return file_api_pb_docker_proto_rawDescGZIP(), []int{34} + return file_api_pb_docker_proto_rawDescGZIP(), []int{39} } func (x *ListServiceContainersResponse) GetMessages() []*MachineServiceContainers { @@ -2066,7 +2378,7 @@ type MachineServiceContainers struct { func (x *MachineServiceContainers) Reset() { *x = MachineServiceContainers{} if protoimpl.UnsafeEnabled { - mi := &file_api_pb_docker_proto_msgTypes[35] + mi := &file_api_pb_docker_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2079,7 +2391,7 @@ func (x *MachineServiceContainers) String() string { func (*MachineServiceContainers) ProtoMessage() {} func (x *MachineServiceContainers) ProtoReflect() protoreflect.Message { - mi := &file_api_pb_docker_proto_msgTypes[35] + mi := &file_api_pb_docker_proto_msgTypes[40] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2092,7 +2404,7 @@ func (x *MachineServiceContainers) ProtoReflect() protoreflect.Message { // Deprecated: Use MachineServiceContainers.ProtoReflect.Descriptor instead. func (*MachineServiceContainers) Descriptor() ([]byte, []int) { - return file_api_pb_docker_proto_rawDescGZIP(), []int{35} + return file_api_pb_docker_proto_rawDescGZIP(), []int{40} } func (x *MachineServiceContainers) GetMetadata() *Metadata { @@ -2233,178 +2545,218 @@ var file_api_pb_docker_proto_rawDesc = []byte{ 0x66, 0x65, 0x73, 0x74, 0x22, 0x2d, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x22, 0x44, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6d, 0x61, 0x67, 0x65, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x08, 0x6d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x73, 0x52, - 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x22, 0x7d, 0x0a, 0x0d, 0x4d, 0x61, 0x63, - 0x68, 0x69, 0x6e, 0x65, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x73, 0x12, 0x29, 0x0a, 0x08, 0x6d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x73, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x73, 0x12, 0x29, 0x0a, - 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x5f, 0x73, 0x74, 0x6f, 0x72, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x64, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x22, 0x2f, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x18, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x2e, 0x0a, 0x14, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x06, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x22, 0x2e, 0x0a, 0x12, 0x4c, 0x69, 0x73, - 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x18, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x46, 0x0a, 0x13, 0x4c, 0x69, 0x73, - 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x2f, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, - 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x73, 0x22, 0x57, 0x0a, 0x0e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x56, 0x6f, 0x6c, 0x75, - 0x6d, 0x65, 0x73, 0x12, 0x29, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1a, - 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3b, 0x0a, 0x13, 0x52, 0x65, - 0x6d, 0x6f, 0x76, 0x65, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, - 0x64, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x22, 0x8f, 0x02, 0x0a, 0x1d, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x12, 0x25, 0x0a, 0x0e, 0x63, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x4e, 0x61, - 0x6d, 0x65, 0x12, 0x57, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, - 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x30, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x43, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0d, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x22, 0x2c, 0x0a, 0x0d, 0x43, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, - 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x50, 0x52, 0x45, - 0x5f, 0x44, 0x45, 0x50, 0x4c, 0x4f, 0x59, 0x10, 0x01, 0x22, 0x53, 0x0a, 0x10, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x1c, 0x0a, - 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x22, 0x57, - 0x0a, 0x1c, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, - 0x0a, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x12, 0x18, 0x0a, - 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, - 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x5a, 0x0a, 0x1d, 0x4c, 0x69, 0x73, 0x74, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x73, 0x22, 0xbc, 0x01, 0x0a, 0x18, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, - 0x12, 0x29, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x35, 0x0a, 0x0a, 0x63, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x15, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x73, 0x12, 0x3e, 0x0a, 0x0f, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x52, 0x0e, 0x68, 0x6f, 0x6f, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x73, 0x32, 0xfb, 0x0a, 0x0a, 0x06, 0x44, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x12, 0x4c, 0x0a, - 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x12, 0x1b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, + 0x6f, 0x6e, 0x73, 0x22, 0x93, 0x01, 0x0a, 0x12, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x49, 0x6d, + 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6f, + 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, + 0x12, 0x25, 0x0a, 0x0e, 0x70, 0x72, 0x75, 0x6e, 0x65, 0x5f, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, + 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x70, 0x72, 0x75, 0x6e, 0x65, 0x43, + 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x12, 0x30, 0x0a, 0x09, 0x70, 0x6c, 0x61, 0x74, 0x66, + 0x6f, 0x72, 0x6d, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x52, 0x09, + 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x73, 0x22, 0x9d, 0x01, 0x0a, 0x0d, 0x49, 0x6d, + 0x61, 0x67, 0x65, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x22, 0x0a, 0x0c, 0x61, + 0x72, 0x63, 0x68, 0x69, 0x74, 0x65, 0x63, 0x74, 0x75, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0c, 0x61, 0x72, 0x63, 0x68, 0x69, 0x74, 0x65, 0x63, 0x74, 0x75, 0x72, 0x65, 0x12, + 0x0e, 0x0a, 0x02, 0x6f, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x6f, 0x73, 0x12, + 0x1d, 0x0a, 0x0a, 0x6f, 0x73, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x6f, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1f, + 0x0a, 0x0b, 0x6f, 0x73, 0x5f, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x04, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x0a, 0x6f, 0x73, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, + 0x18, 0x0a, 0x07, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x22, 0x4b, 0x0a, 0x13, 0x52, 0x65, 0x6d, + 0x6f, 0x76, 0x65, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x34, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, + 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x61, 0x6c, 0x52, 0x08, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x22, 0x6d, 0x0a, 0x13, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, + 0x65, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x61, 0x6c, 0x12, 0x29, 0x0a, + 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, + 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x2b, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x61, 0x6c, 0x52, 0x07, 0x72, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, 0x44, 0x0a, 0x0c, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, + 0x6d, 0x6f, 0x76, 0x61, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x12, + 0x1a, 0x0a, 0x08, 0x75, 0x6e, 0x74, 0x61, 0x67, 0x67, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x75, 0x6e, 0x74, 0x61, 0x67, 0x67, 0x65, 0x64, 0x22, 0x44, 0x0a, 0x12, 0x4c, + 0x69, 0x73, 0x74, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x2e, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, + 0x65, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x73, 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x73, 0x22, 0x7d, 0x0a, 0x0d, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x49, 0x6d, 0x61, 0x67, + 0x65, 0x73, 0x12, 0x29, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x16, 0x0a, + 0x06, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x69, + 0x6d, 0x61, 0x67, 0x65, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, + 0x65, 0x72, 0x64, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x53, 0x74, 0x6f, 0x72, 0x65, + 0x22, 0x2f, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x22, 0x2e, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, 0x6f, 0x6c, 0x75, 0x6d, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x6f, 0x6c, + 0x75, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x76, 0x6f, 0x6c, 0x75, 0x6d, + 0x65, 0x22, 0x2e, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x22, 0x46, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x52, + 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x22, 0x57, 0x0a, 0x0e, 0x4d, 0x61, 0x63, + 0x68, 0x69, 0x6e, 0x65, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x12, 0x29, 0x0a, 0x08, 0x6d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x3b, 0x0a, 0x13, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x56, 0x6f, 0x6c, 0x75, + 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6f, 0x72, + 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x22, + 0x8f, 0x02, 0x0a, 0x1d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, + 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x73, 0x70, 0x65, 0x63, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, + 0x70, 0x65, 0x63, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, + 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x6f, 0x6e, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x57, 0x0a, 0x0e, 0x63, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x30, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, + 0x54, 0x79, 0x70, 0x65, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x54, + 0x79, 0x70, 0x65, 0x22, 0x2c, 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x10, + 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x50, 0x52, 0x45, 0x5f, 0x44, 0x45, 0x50, 0x4c, 0x4f, 0x59, 0x10, + 0x01, 0x22, 0x53, 0x0a, 0x10, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, + 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x73, + 0x70, 0x65, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x22, 0x57, 0x0a, 0x1c, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, + 0x5a, 0x0a, 0x1d, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x39, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, + 0x73, 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x22, 0xbc, 0x01, 0x0a, 0x18, + 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x12, 0x29, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x12, 0x35, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x0a, + 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x12, 0x3e, 0x0a, 0x0f, 0x68, 0x6f, + 0x6f, 0x6b, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x0e, 0x68, 0x6f, 0x6f, 0x6b, + 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x32, 0xbd, 0x0b, 0x0a, 0x06, 0x44, + 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x12, 0x4c, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x1b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x4f, 0x0a, 0x10, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x43, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, + 0x73, 0x70, 0x65, 0x63, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x73, 0x70, + 0x65, 0x63, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, 0x0a, 0x0e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x43, 0x6f, 0x6e, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x74, 0x61, + 0x72, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x42, 0x0a, 0x0d, 0x53, 0x74, + 0x6f, 0x70, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x19, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x49, + 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, + 0x12, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x0f, 0x52, 0x65, 0x6d, + 0x6f, 0x76, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x1b, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, + 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x12, 0x4a, 0x0a, 0x0d, 0x45, 0x78, 0x65, 0x63, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, + 0x65, 0x72, 0x12, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x43, 0x6f, 0x6e, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, + 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x12, 0x32, 0x0a, + 0x0d, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x4c, 0x6f, 0x67, 0x73, 0x12, 0x10, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x0d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x6f, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x30, + 0x01, 0x12, 0x36, 0x0a, 0x09, 0x50, 0x75, 0x6c, 0x6c, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x15, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x50, 0x75, 0x6c, 0x6c, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4a, 0x53, 0x4f, 0x4e, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x30, 0x01, 0x12, 0x43, 0x0a, 0x0c, 0x49, 0x6e, 0x73, + 0x70, 0x65, 0x63, 0x74, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x18, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, + 0x74, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x55, + 0x0a, 0x12, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x49, + 0x6d, 0x61, 0x67, 0x65, 0x12, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x73, 0x70, 0x65, + 0x63, 0x74, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x73, 0x70, 0x65, + 0x63, 0x74, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6d, 0x61, + 0x67, 0x65, 0x73, 0x12, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6d, + 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x0b, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x49, 0x6d, + 0x61, 0x67, 0x65, 0x12, 0x17, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, + 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x12, 0x18, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, 0x6f, 0x6c, + 0x75, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x0b, 0x4c, + 0x69, 0x73, 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x12, 0x17, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x6f, + 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, + 0x0c, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x12, 0x18, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, + 0x5a, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x22, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4f, 0x0a, 0x10, 0x49, - 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, - 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x43, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, 0x0a, 0x0e, - 0x53, 0x74, 0x61, 0x72, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x1a, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, - 0x74, 0x79, 0x12, 0x42, 0x0a, 0x0d, 0x53, 0x74, 0x6f, 0x70, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x12, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x43, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x49, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x12, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x46, 0x0a, 0x0f, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x12, 0x1b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, - 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x4a, 0x0a, 0x0d, 0x45, 0x78, 0x65, - 0x63, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x19, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x45, 0x78, 0x65, 0x63, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x45, 0x78, 0x65, 0x63, - 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x28, 0x01, 0x30, 0x01, 0x12, 0x32, 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x4c, 0x6f, 0x67, 0x73, 0x12, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x6f, 0x67, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, - 0x6f, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x30, 0x01, 0x12, 0x36, 0x0a, 0x09, 0x50, 0x75, 0x6c, - 0x6c, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x15, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x50, 0x75, 0x6c, - 0x6c, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x10, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x4a, 0x53, 0x4f, 0x4e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x30, - 0x01, 0x12, 0x43, 0x0a, 0x0c, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x49, 0x6d, 0x61, 0x67, - 0x65, 0x12, 0x18, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x49, - 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x12, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, - 0x74, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x1e, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, - 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, - 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, - 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x73, 0x12, 0x16, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6d, - 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x0c, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x12, 0x18, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x40, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, - 0x12, 0x17, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, - 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x0c, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x56, 0x6f, 0x6c, - 0x75, 0x6d, 0x65, 0x12, 0x18, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, - 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x5a, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, - 0x22, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x4e, 0x0a, 0x17, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x1c, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x12, 0x5e, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x12, 0x21, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x4d, 0x0a, 0x16, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x1b, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, - 0x42, 0x26, 0x5a, 0x24, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, - 0x73, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x6b, 0x69, 0x2f, 0x75, 0x6e, 0x63, 0x6c, 0x6f, 0x75, - 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4e, 0x0a, 0x17, 0x49, + 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x73, + 0x70, 0x65, 0x63, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x5e, 0x0a, 0x15, 0x4c, + 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x65, 0x72, 0x73, 0x12, 0x21, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, + 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x16, 0x52, + 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x1b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x6d, 0x6f, + 0x76, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x26, 0x5a, 0x24, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x73, 0x76, 0x69, 0x64, 0x65, 0x72, + 0x73, 0x6b, 0x69, 0x2f, 0x75, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2420,7 +2772,7 @@ func file_api_pb_docker_proto_rawDescGZIP() []byte { } var file_api_pb_docker_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_api_pb_docker_proto_msgTypes = make([]protoimpl.MessageInfo, 36) +var file_api_pb_docker_proto_msgTypes = make([]protoimpl.MessageInfo, 41) var file_api_pb_docker_proto_goTypes = []any{ (CreateServiceContainerRequest_ContainerType)(0), // 0: api.CreateServiceContainerRequest.ContainerType (*CreateContainerRequest)(nil), // 1: api.CreateContainerRequest @@ -2446,85 +2798,96 @@ var file_api_pb_docker_proto_goTypes = []any{ (*InspectRemoteImageResponse)(nil), // 21: api.InspectRemoteImageResponse (*RemoteImage)(nil), // 22: api.RemoteImage (*ListImagesRequest)(nil), // 23: api.ListImagesRequest - (*ListImagesResponse)(nil), // 24: api.ListImagesResponse - (*MachineImages)(nil), // 25: api.MachineImages - (*CreateVolumeRequest)(nil), // 26: api.CreateVolumeRequest - (*CreateVolumeResponse)(nil), // 27: api.CreateVolumeResponse - (*ListVolumesRequest)(nil), // 28: api.ListVolumesRequest - (*ListVolumesResponse)(nil), // 29: api.ListVolumesResponse - (*MachineVolumes)(nil), // 30: api.MachineVolumes - (*RemoveVolumeRequest)(nil), // 31: api.RemoveVolumeRequest - (*CreateServiceContainerRequest)(nil), // 32: api.CreateServiceContainerRequest - (*ServiceContainer)(nil), // 33: api.ServiceContainer - (*ListServiceContainersRequest)(nil), // 34: api.ListServiceContainersRequest - (*ListServiceContainersResponse)(nil), // 35: api.ListServiceContainersResponse - (*MachineServiceContainers)(nil), // 36: api.MachineServiceContainers - (*Metadata)(nil), // 37: api.Metadata - (*LogsRequest)(nil), // 38: api.LogsRequest - (*emptypb.Empty)(nil), // 39: google.protobuf.Empty - (*LogEntry)(nil), // 40: api.LogEntry + (*RemoveImageRequest)(nil), // 24: api.RemoveImageRequest + (*ImagePlatform)(nil), // 25: api.ImagePlatform + (*RemoveImageResponse)(nil), // 26: api.RemoveImageResponse + (*MachineImageRemoval)(nil), // 27: api.MachineImageRemoval + (*ImageRemoval)(nil), // 28: api.ImageRemoval + (*ListImagesResponse)(nil), // 29: api.ListImagesResponse + (*MachineImages)(nil), // 30: api.MachineImages + (*CreateVolumeRequest)(nil), // 31: api.CreateVolumeRequest + (*CreateVolumeResponse)(nil), // 32: api.CreateVolumeResponse + (*ListVolumesRequest)(nil), // 33: api.ListVolumesRequest + (*ListVolumesResponse)(nil), // 34: api.ListVolumesResponse + (*MachineVolumes)(nil), // 35: api.MachineVolumes + (*RemoveVolumeRequest)(nil), // 36: api.RemoveVolumeRequest + (*CreateServiceContainerRequest)(nil), // 37: api.CreateServiceContainerRequest + (*ServiceContainer)(nil), // 38: api.ServiceContainer + (*ListServiceContainersRequest)(nil), // 39: api.ListServiceContainersRequest + (*ListServiceContainersResponse)(nil), // 40: api.ListServiceContainersResponse + (*MachineServiceContainers)(nil), // 41: api.MachineServiceContainers + (*Metadata)(nil), // 42: api.Metadata + (*LogsRequest)(nil), // 43: api.LogsRequest + (*emptypb.Empty)(nil), // 44: google.protobuf.Empty + (*LogEntry)(nil), // 45: api.LogEntry } var file_api_pb_docker_proto_depIdxs = []int32{ 9, // 0: api.ListContainersResponse.messages:type_name -> api.MachineContainers - 37, // 1: api.MachineContainers.metadata:type_name -> api.Metadata + 42, // 1: api.MachineContainers.metadata:type_name -> api.Metadata 12, // 2: api.ExecContainerRequest.config:type_name -> api.ExecConfig 13, // 3: api.ExecContainerRequest.resize:type_name -> api.ResizeEvent 19, // 4: api.InspectImageResponse.messages:type_name -> api.Image - 37, // 5: api.Image.metadata:type_name -> api.Metadata + 42, // 5: api.Image.metadata:type_name -> api.Metadata 22, // 6: api.InspectRemoteImageResponse.messages:type_name -> api.RemoteImage - 37, // 7: api.RemoteImage.metadata:type_name -> api.Metadata - 25, // 8: api.ListImagesResponse.messages:type_name -> api.MachineImages - 37, // 9: api.MachineImages.metadata:type_name -> api.Metadata - 30, // 10: api.ListVolumesResponse.messages:type_name -> api.MachineVolumes - 37, // 11: api.MachineVolumes.metadata:type_name -> api.Metadata - 0, // 12: api.CreateServiceContainerRequest.container_type:type_name -> api.CreateServiceContainerRequest.ContainerType - 36, // 13: api.ListServiceContainersResponse.messages:type_name -> api.MachineServiceContainers - 37, // 14: api.MachineServiceContainers.metadata:type_name -> api.Metadata - 33, // 15: api.MachineServiceContainers.containers:type_name -> api.ServiceContainer - 33, // 16: api.MachineServiceContainers.hook_containers:type_name -> api.ServiceContainer - 1, // 17: api.Docker.CreateContainer:input_type -> api.CreateContainerRequest - 3, // 18: api.Docker.InspectContainer:input_type -> api.InspectContainerRequest - 5, // 19: api.Docker.StartContainer:input_type -> api.StartContainerRequest - 6, // 20: api.Docker.StopContainer:input_type -> api.StopContainerRequest - 7, // 21: api.Docker.ListContainers:input_type -> api.ListContainersRequest - 10, // 22: api.Docker.RemoveContainer:input_type -> api.RemoveContainerRequest - 11, // 23: api.Docker.ExecContainer:input_type -> api.ExecContainerRequest - 38, // 24: api.Docker.ContainerLogs:input_type -> api.LogsRequest - 15, // 25: api.Docker.PullImage:input_type -> api.PullImageRequest - 17, // 26: api.Docker.InspectImage:input_type -> api.InspectImageRequest - 20, // 27: api.Docker.InspectRemoteImage:input_type -> api.InspectRemoteImageRequest - 23, // 28: api.Docker.ListImages:input_type -> api.ListImagesRequest - 26, // 29: api.Docker.CreateVolume:input_type -> api.CreateVolumeRequest - 28, // 30: api.Docker.ListVolumes:input_type -> api.ListVolumesRequest - 31, // 31: api.Docker.RemoveVolume:input_type -> api.RemoveVolumeRequest - 32, // 32: api.Docker.CreateServiceContainer:input_type -> api.CreateServiceContainerRequest - 3, // 33: api.Docker.InspectServiceContainer:input_type -> api.InspectContainerRequest - 34, // 34: api.Docker.ListServiceContainers:input_type -> api.ListServiceContainersRequest - 10, // 35: api.Docker.RemoveServiceContainer:input_type -> api.RemoveContainerRequest - 2, // 36: api.Docker.CreateContainer:output_type -> api.CreateContainerResponse - 4, // 37: api.Docker.InspectContainer:output_type -> api.InspectContainerResponse - 39, // 38: api.Docker.StartContainer:output_type -> google.protobuf.Empty - 39, // 39: api.Docker.StopContainer:output_type -> google.protobuf.Empty - 8, // 40: api.Docker.ListContainers:output_type -> api.ListContainersResponse - 39, // 41: api.Docker.RemoveContainer:output_type -> google.protobuf.Empty - 14, // 42: api.Docker.ExecContainer:output_type -> api.ExecContainerResponse - 40, // 43: api.Docker.ContainerLogs:output_type -> api.LogEntry - 16, // 44: api.Docker.PullImage:output_type -> api.JSONMessage - 18, // 45: api.Docker.InspectImage:output_type -> api.InspectImageResponse - 21, // 46: api.Docker.InspectRemoteImage:output_type -> api.InspectRemoteImageResponse - 24, // 47: api.Docker.ListImages:output_type -> api.ListImagesResponse - 27, // 48: api.Docker.CreateVolume:output_type -> api.CreateVolumeResponse - 29, // 49: api.Docker.ListVolumes:output_type -> api.ListVolumesResponse - 39, // 50: api.Docker.RemoveVolume:output_type -> google.protobuf.Empty - 2, // 51: api.Docker.CreateServiceContainer:output_type -> api.CreateContainerResponse - 33, // 52: api.Docker.InspectServiceContainer:output_type -> api.ServiceContainer - 35, // 53: api.Docker.ListServiceContainers:output_type -> api.ListServiceContainersResponse - 39, // 54: api.Docker.RemoveServiceContainer:output_type -> google.protobuf.Empty - 36, // [36:55] is the sub-list for method output_type - 17, // [17:36] is the sub-list for method input_type - 17, // [17:17] is the sub-list for extension type_name - 17, // [17:17] is the sub-list for extension extendee - 0, // [0:17] is the sub-list for field type_name + 42, // 7: api.RemoteImage.metadata:type_name -> api.Metadata + 25, // 8: api.RemoveImageRequest.platforms:type_name -> api.ImagePlatform + 27, // 9: api.RemoveImageResponse.messages:type_name -> api.MachineImageRemoval + 42, // 10: api.MachineImageRemoval.metadata:type_name -> api.Metadata + 28, // 11: api.MachineImageRemoval.results:type_name -> api.ImageRemoval + 30, // 12: api.ListImagesResponse.messages:type_name -> api.MachineImages + 42, // 13: api.MachineImages.metadata:type_name -> api.Metadata + 35, // 14: api.ListVolumesResponse.messages:type_name -> api.MachineVolumes + 42, // 15: api.MachineVolumes.metadata:type_name -> api.Metadata + 0, // 16: api.CreateServiceContainerRequest.container_type:type_name -> api.CreateServiceContainerRequest.ContainerType + 41, // 17: api.ListServiceContainersResponse.messages:type_name -> api.MachineServiceContainers + 42, // 18: api.MachineServiceContainers.metadata:type_name -> api.Metadata + 38, // 19: api.MachineServiceContainers.containers:type_name -> api.ServiceContainer + 38, // 20: api.MachineServiceContainers.hook_containers:type_name -> api.ServiceContainer + 1, // 21: api.Docker.CreateContainer:input_type -> api.CreateContainerRequest + 3, // 22: api.Docker.InspectContainer:input_type -> api.InspectContainerRequest + 5, // 23: api.Docker.StartContainer:input_type -> api.StartContainerRequest + 6, // 24: api.Docker.StopContainer:input_type -> api.StopContainerRequest + 7, // 25: api.Docker.ListContainers:input_type -> api.ListContainersRequest + 10, // 26: api.Docker.RemoveContainer:input_type -> api.RemoveContainerRequest + 11, // 27: api.Docker.ExecContainer:input_type -> api.ExecContainerRequest + 43, // 28: api.Docker.ContainerLogs:input_type -> api.LogsRequest + 15, // 29: api.Docker.PullImage:input_type -> api.PullImageRequest + 17, // 30: api.Docker.InspectImage:input_type -> api.InspectImageRequest + 20, // 31: api.Docker.InspectRemoteImage:input_type -> api.InspectRemoteImageRequest + 23, // 32: api.Docker.ListImages:input_type -> api.ListImagesRequest + 24, // 33: api.Docker.RemoveImage:input_type -> api.RemoveImageRequest + 31, // 34: api.Docker.CreateVolume:input_type -> api.CreateVolumeRequest + 33, // 35: api.Docker.ListVolumes:input_type -> api.ListVolumesRequest + 36, // 36: api.Docker.RemoveVolume:input_type -> api.RemoveVolumeRequest + 37, // 37: api.Docker.CreateServiceContainer:input_type -> api.CreateServiceContainerRequest + 3, // 38: api.Docker.InspectServiceContainer:input_type -> api.InspectContainerRequest + 39, // 39: api.Docker.ListServiceContainers:input_type -> api.ListServiceContainersRequest + 10, // 40: api.Docker.RemoveServiceContainer:input_type -> api.RemoveContainerRequest + 2, // 41: api.Docker.CreateContainer:output_type -> api.CreateContainerResponse + 4, // 42: api.Docker.InspectContainer:output_type -> api.InspectContainerResponse + 44, // 43: api.Docker.StartContainer:output_type -> google.protobuf.Empty + 44, // 44: api.Docker.StopContainer:output_type -> google.protobuf.Empty + 8, // 45: api.Docker.ListContainers:output_type -> api.ListContainersResponse + 44, // 46: api.Docker.RemoveContainer:output_type -> google.protobuf.Empty + 14, // 47: api.Docker.ExecContainer:output_type -> api.ExecContainerResponse + 45, // 48: api.Docker.ContainerLogs:output_type -> api.LogEntry + 16, // 49: api.Docker.PullImage:output_type -> api.JSONMessage + 18, // 50: api.Docker.InspectImage:output_type -> api.InspectImageResponse + 21, // 51: api.Docker.InspectRemoteImage:output_type -> api.InspectRemoteImageResponse + 29, // 52: api.Docker.ListImages:output_type -> api.ListImagesResponse + 26, // 53: api.Docker.RemoveImage:output_type -> api.RemoveImageResponse + 32, // 54: api.Docker.CreateVolume:output_type -> api.CreateVolumeResponse + 34, // 55: api.Docker.ListVolumes:output_type -> api.ListVolumesResponse + 44, // 56: api.Docker.RemoveVolume:output_type -> google.protobuf.Empty + 2, // 57: api.Docker.CreateServiceContainer:output_type -> api.CreateContainerResponse + 38, // 58: api.Docker.InspectServiceContainer:output_type -> api.ServiceContainer + 40, // 59: api.Docker.ListServiceContainers:output_type -> api.ListServiceContainersResponse + 44, // 60: api.Docker.RemoveServiceContainer:output_type -> google.protobuf.Empty + 41, // [41:61] is the sub-list for method output_type + 21, // [21:41] is the sub-list for method input_type + 21, // [21:21] is the sub-list for extension type_name + 21, // [21:21] is the sub-list for extension extendee + 0, // [0:21] is the sub-list for field type_name } func init() { file_api_pb_docker_proto_init() } @@ -2811,7 +3174,7 @@ func file_api_pb_docker_proto_init() { } } file_api_pb_docker_proto_msgTypes[23].Exporter = func(v any, i int) any { - switch v := v.(*ListImagesResponse); i { + switch v := v.(*RemoveImageRequest); i { case 0: return &v.state case 1: @@ -2823,7 +3186,7 @@ func file_api_pb_docker_proto_init() { } } file_api_pb_docker_proto_msgTypes[24].Exporter = func(v any, i int) any { - switch v := v.(*MachineImages); i { + switch v := v.(*ImagePlatform); i { case 0: return &v.state case 1: @@ -2835,7 +3198,7 @@ func file_api_pb_docker_proto_init() { } } file_api_pb_docker_proto_msgTypes[25].Exporter = func(v any, i int) any { - switch v := v.(*CreateVolumeRequest); i { + switch v := v.(*RemoveImageResponse); i { case 0: return &v.state case 1: @@ -2847,7 +3210,7 @@ func file_api_pb_docker_proto_init() { } } file_api_pb_docker_proto_msgTypes[26].Exporter = func(v any, i int) any { - switch v := v.(*CreateVolumeResponse); i { + switch v := v.(*MachineImageRemoval); i { case 0: return &v.state case 1: @@ -2859,7 +3222,7 @@ func file_api_pb_docker_proto_init() { } } file_api_pb_docker_proto_msgTypes[27].Exporter = func(v any, i int) any { - switch v := v.(*ListVolumesRequest); i { + switch v := v.(*ImageRemoval); i { case 0: return &v.state case 1: @@ -2871,7 +3234,7 @@ func file_api_pb_docker_proto_init() { } } file_api_pb_docker_proto_msgTypes[28].Exporter = func(v any, i int) any { - switch v := v.(*ListVolumesResponse); i { + switch v := v.(*ListImagesResponse); i { case 0: return &v.state case 1: @@ -2883,7 +3246,7 @@ func file_api_pb_docker_proto_init() { } } file_api_pb_docker_proto_msgTypes[29].Exporter = func(v any, i int) any { - switch v := v.(*MachineVolumes); i { + switch v := v.(*MachineImages); i { case 0: return &v.state case 1: @@ -2895,7 +3258,7 @@ func file_api_pb_docker_proto_init() { } } file_api_pb_docker_proto_msgTypes[30].Exporter = func(v any, i int) any { - switch v := v.(*RemoveVolumeRequest); i { + switch v := v.(*CreateVolumeRequest); i { case 0: return &v.state case 1: @@ -2907,7 +3270,7 @@ func file_api_pb_docker_proto_init() { } } file_api_pb_docker_proto_msgTypes[31].Exporter = func(v any, i int) any { - switch v := v.(*CreateServiceContainerRequest); i { + switch v := v.(*CreateVolumeResponse); i { case 0: return &v.state case 1: @@ -2919,7 +3282,7 @@ func file_api_pb_docker_proto_init() { } } file_api_pb_docker_proto_msgTypes[32].Exporter = func(v any, i int) any { - switch v := v.(*ServiceContainer); i { + switch v := v.(*ListVolumesRequest); i { case 0: return &v.state case 1: @@ -2931,7 +3294,7 @@ func file_api_pb_docker_proto_init() { } } file_api_pb_docker_proto_msgTypes[33].Exporter = func(v any, i int) any { - switch v := v.(*ListServiceContainersRequest); i { + switch v := v.(*ListVolumesResponse); i { case 0: return &v.state case 1: @@ -2943,7 +3306,7 @@ func file_api_pb_docker_proto_init() { } } file_api_pb_docker_proto_msgTypes[34].Exporter = func(v any, i int) any { - switch v := v.(*ListServiceContainersResponse); i { + switch v := v.(*MachineVolumes); i { case 0: return &v.state case 1: @@ -2955,6 +3318,66 @@ func file_api_pb_docker_proto_init() { } } file_api_pb_docker_proto_msgTypes[35].Exporter = func(v any, i int) any { + switch v := v.(*RemoveVolumeRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_pb_docker_proto_msgTypes[36].Exporter = func(v any, i int) any { + switch v := v.(*CreateServiceContainerRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_pb_docker_proto_msgTypes[37].Exporter = func(v any, i int) any { + switch v := v.(*ServiceContainer); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_pb_docker_proto_msgTypes[38].Exporter = func(v any, i int) any { + switch v := v.(*ListServiceContainersRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_pb_docker_proto_msgTypes[39].Exporter = func(v any, i int) any { + switch v := v.(*ListServiceContainersResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_pb_docker_proto_msgTypes[40].Exporter = func(v any, i int) any { switch v := v.(*MachineServiceContainers); i { case 0: return &v.state @@ -2984,7 +3407,7 @@ func file_api_pb_docker_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_api_pb_docker_proto_rawDesc, NumEnums: 1, - NumMessages: 36, + NumMessages: 41, NumExtensions: 0, NumServices: 1, }, diff --git a/api/pb/docker.proto b/api/pb/docker.proto index 9ed1a75a..21878df9 100644 --- a/api/pb/docker.proto +++ b/api/pb/docker.proto @@ -24,6 +24,7 @@ service Docker { // Docker auth credentials if necessary. rpc InspectRemoteImage(InspectRemoteImageRequest) returns (InspectRemoteImageResponse); rpc ListImages(ListImagesRequest) returns (ListImagesResponse); + rpc RemoveImage(RemoveImageRequest) returns (RemoveImageResponse); rpc CreateVolume(CreateVolumeRequest) returns (CreateVolumeResponse); rpc ListVolumes(ListVolumesRequest) returns (ListVolumesResponse); @@ -179,6 +180,40 @@ message ListImagesRequest { bytes options = 1; } +message RemoveImageRequest { + string id = 1; + bool force = 2; + bool prune_children = 3; + repeated ImagePlatform platforms = 4; +} + +// ImagePlatform describes an OCI image platform. +message ImagePlatform { + string architecture = 1; + string os = 2; + string os_version = 3; + repeated string os_features = 4; + string variant = 5; +} + +message RemoveImageResponse { + // Must contain only one repeated messages field to allow broadcasting RemoveImage requests to multiple machines. + repeated MachineImageRemoval messages = 1; +} + +message MachineImageRemoval { + Metadata metadata = 1; + repeated ImageRemoval results = 2; +} + +// ImageRemoval reports an image deletion or an untagged image reference. +message ImageRemoval { + // The image ID of an image that was deleted. + string deleted = 1; + // The image reference of an image that was untagged. + string untagged = 2; +} + message ListImagesResponse { // Must contain only one repeated messages field to allow broadcasting ListImages requests to multiple machines. repeated MachineImages messages = 1; diff --git a/api/pb/docker_grpc.pb.go b/api/pb/docker_grpc.pb.go index 10e305e5..0d70cb67 100644 --- a/api/pb/docker_grpc.pb.go +++ b/api/pb/docker_grpc.pb.go @@ -32,6 +32,7 @@ const ( Docker_InspectImage_FullMethodName = "/api.Docker/InspectImage" Docker_InspectRemoteImage_FullMethodName = "/api.Docker/InspectRemoteImage" Docker_ListImages_FullMethodName = "/api.Docker/ListImages" + Docker_RemoveImage_FullMethodName = "/api.Docker/RemoveImage" Docker_CreateVolume_FullMethodName = "/api.Docker/CreateVolume" Docker_ListVolumes_FullMethodName = "/api.Docker/ListVolumes" Docker_RemoveVolume_FullMethodName = "/api.Docker/RemoveVolume" @@ -59,6 +60,7 @@ type DockerClient interface { // Docker auth credentials if necessary. InspectRemoteImage(ctx context.Context, in *InspectRemoteImageRequest, opts ...grpc.CallOption) (*InspectRemoteImageResponse, error) ListImages(ctx context.Context, in *ListImagesRequest, opts ...grpc.CallOption) (*ListImagesResponse, error) + RemoveImage(ctx context.Context, in *RemoveImageRequest, opts ...grpc.CallOption) (*RemoveImageResponse, error) CreateVolume(ctx context.Context, in *CreateVolumeRequest, opts ...grpc.CallOption) (*CreateVolumeResponse, error) ListVolumes(ctx context.Context, in *ListVolumesRequest, opts ...grpc.CallOption) (*ListVolumesResponse, error) RemoveVolume(ctx context.Context, in *RemoveVolumeRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) @@ -217,6 +219,16 @@ func (c *dockerClient) ListImages(ctx context.Context, in *ListImagesRequest, op return out, nil } +func (c *dockerClient) RemoveImage(ctx context.Context, in *RemoveImageRequest, opts ...grpc.CallOption) (*RemoveImageResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(RemoveImageResponse) + err := c.cc.Invoke(ctx, Docker_RemoveImage_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *dockerClient) CreateVolume(ctx context.Context, in *CreateVolumeRequest, opts ...grpc.CallOption) (*CreateVolumeResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(CreateVolumeResponse) @@ -305,6 +317,7 @@ type DockerServer interface { // Docker auth credentials if necessary. InspectRemoteImage(context.Context, *InspectRemoteImageRequest) (*InspectRemoteImageResponse, error) ListImages(context.Context, *ListImagesRequest) (*ListImagesResponse, error) + RemoveImage(context.Context, *RemoveImageRequest) (*RemoveImageResponse, error) CreateVolume(context.Context, *CreateVolumeRequest) (*CreateVolumeResponse, error) ListVolumes(context.Context, *ListVolumesRequest) (*ListVolumesResponse, error) RemoveVolume(context.Context, *RemoveVolumeRequest) (*emptypb.Empty, error) @@ -358,6 +371,9 @@ func (UnimplementedDockerServer) InspectRemoteImage(context.Context, *InspectRem func (UnimplementedDockerServer) ListImages(context.Context, *ListImagesRequest) (*ListImagesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListImages not implemented") } +func (UnimplementedDockerServer) RemoveImage(context.Context, *RemoveImageRequest) (*RemoveImageResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RemoveImage not implemented") +} func (UnimplementedDockerServer) CreateVolume(context.Context, *CreateVolumeRequest) (*CreateVolumeResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateVolume not implemented") } @@ -591,6 +607,24 @@ func _Docker_ListImages_Handler(srv interface{}, ctx context.Context, dec func(i return interceptor(ctx, in, info, handler) } +func _Docker_RemoveImage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RemoveImageRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DockerServer).RemoveImage(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Docker_RemoveImage_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DockerServer).RemoveImage(ctx, req.(*RemoveImageRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Docker_CreateVolume_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CreateVolumeRequest) if err := dec(in); err != nil { @@ -760,6 +794,10 @@ var Docker_ServiceDesc = grpc.ServiceDesc{ MethodName: "ListImages", Handler: _Docker_ListImages_Handler, }, + { + MethodName: "RemoveImage", + Handler: _Docker_RemoveImage_Handler, + }, { MethodName: "CreateVolume", Handler: _Docker_CreateVolume_Handler, diff --git a/internal/machine/caddyconfig/mocks_test.go b/internal/machine/caddyconfig/mocks_test.go index 38401b3c..562d1e1d 100644 --- a/internal/machine/caddyconfig/mocks_test.go +++ b/internal/machine/caddyconfig/mocks_test.go @@ -16,10 +16,19 @@ func NewMockCaddyfileValidator(t interface { mock.TestingT Cleanup(func()) }) *MockCaddyfileValidator { + if helper, ok := t.(interface{ Helper() }); ok { + helper.Helper() + } + mock := &MockCaddyfileValidator{} mock.Mock.Test(t) - t.Cleanup(func() { mock.AssertExpectations(t) }) + t.Cleanup(func() { + if helper, ok := t.(interface{ Helper() }); ok { + helper.Helper() + } + mock.AssertExpectations(t) + }) return mock } diff --git a/internal/machine/docker/controller.go b/internal/machine/docker/controller.go index 96f4bc2b..df99aa21 100644 --- a/internal/machine/docker/controller.go +++ b/internal/machine/docker/controller.go @@ -27,7 +27,7 @@ const ( type Controller struct { // machineID is the ID of the machine where the managed Docker daemon is running. machineID string - client *client.Client + client client.APIClient service *Service store *store.Store } diff --git a/internal/machine/docker/image.go b/internal/machine/docker/image.go new file mode 100644 index 00000000..e54d7acd --- /dev/null +++ b/internal/machine/docker/image.go @@ -0,0 +1,79 @@ +package docker + +import ( + "context" + "fmt" + "strings" + + "github.com/containerd/errdefs" + "github.com/distribution/reference" + "github.com/docker/docker/api/types/container" + "github.com/docker/docker/api/types/filters" + "github.com/docker/docker/api/types/image" + "github.com/docker/docker/pkg/stringid" + "github.com/psviderski/uncloud/pkg/api" +) + +// RemoveImage removes an image while protecting names used by containers, even when force is requested. +func (s *Service) RemoveImage(ctx context.Context, id string, opts image.RemoveOptions) ([]image.DeleteResponse, error) { + if err := s.checkImageRemovalConflicts(ctx, id); err != nil { + return nil, err + } + // Docker enforces its own conflicts, including protection of a used image's final reference. + return s.Client.ImageRemove(ctx, id, opts) +} + +// checkImageRemovalConflicts rejects an image ID used by a running or stopped container, or a name used by a +// container while it still resolves to that container's image. A digest request also checks the repository tags +// Docker would remove with it. Unused aliases are allowed. +func (s *Service) checkImageRemovalConflicts(ctx context.Context, id string) error { + img, err := s.Client.ImageInspect(ctx, id) + if err != nil { + return err + } + // Match Docker's resolved ID before parsing names, since a short ID also parses as a repository name. + isID := strings.HasPrefix(strings.TrimPrefix(img.ID, "sha256:"), strings.TrimPrefix(id, "sha256:")) + var named reference.Named + if !isID { + named, err = reference.ParseDockerRef(id) + if err != nil { + return errdefs.ErrInvalidArgument.WithMessage(err.Error()) + } + } + _, isDigest := named.(reference.Canonical) + + containers, err := s.Client.ContainerList(ctx, container.ListOptions{ + All: true, Filters: filters.NewArgs(filters.Arg("ancestor", img.ID)), + }) + if err != nil { + return fmt.Errorf("list containers using image: %w", err) + } + + for _, ctr := range containers { + // The ancestor filter can include descendants. A retagged name must also be checked against its current ID. + if ctr.ImageID != img.ID { + continue + } + + usedRef, err := reference.ParseDockerRef(ctr.Image) + // Familiar names make "alpine:latest" and "docker.io/library/alpine:latest" identify the same tag. + removesUsedName := err == nil && named != nil && reference.FamiliarString(usedRef) == reference.FamiliarString(named) + if isDigest && err == nil && usedRef.Name() == named.Name() { + // Removing a digest also removes this repository's tags pointing at the same image. + removesUsedName = true + } + if isID || removesUsedName { + ctrID, state := stringid.TruncateID(ctr.ID), "stopped" + if serviceName := ctr.Labels[api.LabelServiceName]; serviceName != "" { + ctrID = serviceName + "/" + ctrID + } + if ctr.State == container.StateRunning || ctr.State == container.StatePaused { + state = container.StateRunning + } + return errdefs.ErrConflict.WithMessage( + fmt.Sprintf("image '%s' is used by container '%s' (%s)", id, ctrID, state)) + } + } + + return nil +} diff --git a/internal/machine/docker/image_test.go b/internal/machine/docker/image_test.go new file mode 100644 index 00000000..b72397fc --- /dev/null +++ b/internal/machine/docker/image_test.go @@ -0,0 +1,175 @@ +package docker + +import ( + "context" + "errors" + "fmt" + "strings" + "testing" + + "github.com/containerd/errdefs" + "github.com/docker/docker/api/types/container" + "github.com/docker/docker/api/types/image" + ocispec "github.com/opencontainers/image-spec/specs-go/v1" + "github.com/psviderski/uncloud/pkg/api" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" +) + +func TestCheckImageRemovalConflicts(t *testing.T) { + imageID := "sha256:" + strings.Repeat("a", 64) + otherID := "sha256:" + strings.Repeat("b", 64) + digestRef := "myapp@" + imageID + + tests := []struct { + name string + requested string + configured string + containerImageID string + serviceName string + blocked bool + }{ + {name: "used tag", requested: "myapp:current", configured: "myapp:current", serviceName: "web", blocked: true}, + {name: "qualified request", requested: "docker.io/library/myapp:current", configured: "myapp:current", blocked: true}, + {name: "qualified container reference", requested: "myapp:current", configured: "docker.io/library/myapp:current", blocked: true}, + {name: "implicit latest", requested: "myapp", configured: "myapp:latest", blocked: true}, + {name: "unused alias", requested: "myapp:old", configured: "myapp:current"}, + {name: "unused alias of ID-used image", requested: "myapp:old", configured: imageID}, + {name: "tag may clean up a used digest", requested: "myapp:old", configured: digestRef}, + {name: "used digest", requested: digestRef, configured: digestRef, blocked: true}, + {name: "digest also removes used tag", requested: digestRef, configured: "myapp:current", blocked: true}, + {name: "unused repository digest", requested: digestRef, configured: "other:keep"}, + {name: "image ID", requested: imageID, configured: "myapp:current", blocked: true}, + {name: "short image ID", requested: "aaaaaaaa", configured: "myapp:current", blocked: true}, + {name: "short image ID with algorithm", requested: "sha256:aaaaaaaa", configured: "myapp:current", blocked: true}, + {name: "retagged name", requested: "myapp:current", configured: "myapp:current", containerImageID: otherID}, + } + + for _, tt := range tests { + for _, state := range []string{container.StateExited, container.StateRunning} { + t.Run(fmt.Sprintf("%s/%s", tt.name, state), func(t *testing.T) { + containerImageID := tt.containerImageID + if containerImageID == "" { + containerImageID = imageID + } + + cli := NewMockAPIClient(t) + cli.EXPECT().ImageInspect(mock.Anything, tt.requested). + Return(image.InspectResponse{ID: imageID}, nil).Once() + cli.EXPECT().ContainerList(mock.Anything, mock.MatchedBy(func(opts container.ListOptions) bool { + return opts.All // Stopped containers must be checked too. + })).Return([]container.Summary{{ + ID: strings.Repeat("c", 64), + Labels: map[string]string{api.LabelServiceName: tt.serviceName}, + Names: []string{"/web"}, + ImageID: containerImageID, + Image: tt.configured, + State: state, + }}, nil).Once() + + service := NewService(cli, nil) + err := service.checkImageRemovalConflicts(context.Background(), tt.requested) + + if tt.blocked { + require.True(t, errdefs.IsConflict(err), "%v", err) + assert.ErrorContains(t, err, tt.requested) + if tt.serviceName != "" { + assert.ErrorContains(t, err, "container 'web/cccccccccccc'") + } else { + assert.ErrorContains(t, err, "container 'cccccccccccc'") + } + wantState := "stopped" + if state == container.StateRunning { + wantState = state + } + assert.ErrorContains(t, err, wantState) + } else { + require.NoError(t, err) + } + }) + } + } +} + +func TestCheckImageRemovalConflicts_PropagatesLookupErrors(t *testing.T) { + imageID := "sha256:" + strings.Repeat("a", 64) + t.Run("image lookup fails", func(t *testing.T) { + cli := NewMockAPIClient(t) + lookupErr := errdefs.ErrNotFound.WithMessage("no such image") + cli.EXPECT().ImageInspect(mock.Anything, "myapp:old").Return(image.InspectResponse{}, lookupErr).Once() + + service := NewService(cli, nil) + require.ErrorIs(t, service.checkImageRemovalConflicts(context.Background(), "myapp:old"), lookupErr) + }) + + t.Run("container lookup fails", func(t *testing.T) { + cli := NewMockAPIClient(t) + lookupErr := errors.New("Docker unavailable") + cli.EXPECT().ImageInspect(mock.Anything, "myapp:old").Return(image.InspectResponse{ID: imageID}, nil).Once() + cli.EXPECT().ContainerList(mock.Anything, mock.Anything).Return(nil, lookupErr).Once() + + service := NewService(cli, nil) + err := service.checkImageRemovalConflicts(context.Background(), "myapp:old") + + require.ErrorIs(t, err, lookupErr) + assert.ErrorContains(t, err, "list containers using image") + }) +} + +func TestServiceRemoveImage_RejectsUsedNameBeforeDeletion(t *testing.T) { + imageID := "sha256:" + strings.Repeat("a", 64) + cli := NewMockAPIClient(t) + cli.EXPECT().ImageInspect(mock.Anything, "myapp:current").Return(image.InspectResponse{ID: imageID}, nil).Once() + cli.EXPECT().ContainerList(mock.Anything, mock.Anything).Return([]container.Summary{{ + ID: "container-id", ImageID: imageID, Image: "myapp:current", State: container.StateRunning, + }}, nil).Once() + + service := NewService(cli, nil) + // ImageRemove has no expectation: any deletion call would fail this test. + results, err := service.RemoveImage(context.Background(), "myapp:current", image.RemoveOptions{Force: true}) + + require.True(t, errdefs.IsConflict(err), "%v", err) + assert.Nil(t, results) +} + +func TestServiceRemoveImage_DelegatesToDocker(t *testing.T) { + imageID := "sha256:" + strings.Repeat("a", 64) + tests := []struct { + name string + opts image.RemoveOptions + results []image.DeleteResponse + err error + }{ + { + name: "options and results pass through", + opts: image.RemoveOptions{Force: true, PruneChildren: true, Platforms: []ocispec.Platform{{OS: "linux", Architecture: "amd64"}}}, + results: []image.DeleteResponse{{Deleted: imageID}}, + }, + { + name: "Docker rejects final reference removal", + opts: image.RemoveOptions{PruneChildren: true}, + err: errdefs.ErrConflict.WithMessage("container is using its referenced image"), + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + cli := NewMockAPIClient(t) + cli.EXPECT().ImageInspect(mock.Anything, "myapp:old").Return(image.InspectResponse{ID: imageID}, nil).Once() + cli.EXPECT().ContainerList(mock.Anything, mock.Anything).Return([]container.Summary{{ + ID: "container-id", ImageID: imageID, Image: "myapp@" + imageID, State: container.StateRunning, + }}, nil).Once() + cli.EXPECT().ImageRemove(mock.Anything, "myapp:old", tt.opts).Return(tt.results, tt.err).Once() + + service := NewService(cli, nil) + results, err := service.RemoveImage(context.Background(), "myapp:old", tt.opts) + if tt.err != nil { + require.ErrorIs(t, err, tt.err) + } else { + require.NoError(t, err) + } + assert.Equal(t, tt.results, results) + }) + } +} diff --git a/internal/machine/docker/mocks_test.go b/internal/machine/docker/mocks_test.go new file mode 100644 index 00000000..e4617e14 --- /dev/null +++ b/internal/machine/docker/mocks_test.go @@ -0,0 +1,8271 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package docker + +import ( + "context" + "io" + "net" + "net/http" + + "github.com/docker/docker/api/types" + "github.com/docker/docker/api/types/build" + "github.com/docker/docker/api/types/checkpoint" + "github.com/docker/docker/api/types/container" + "github.com/docker/docker/api/types/events" + "github.com/docker/docker/api/types/filters" + "github.com/docker/docker/api/types/image" + "github.com/docker/docker/api/types/network" + "github.com/docker/docker/api/types/registry" + "github.com/docker/docker/api/types/swarm" + "github.com/docker/docker/api/types/system" + "github.com/docker/docker/api/types/volume" + "github.com/docker/docker/client" + "github.com/opencontainers/image-spec/specs-go/v1" + mock "github.com/stretchr/testify/mock" +) + +// NewMockAPIClient creates a new instance of MockAPIClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockAPIClient(t interface { + mock.TestingT + Cleanup(func()) +}) *MockAPIClient { + if helper, ok := t.(interface{ Helper() }); ok { + helper.Helper() + } + + mock := &MockAPIClient{} + mock.Mock.Test(t) + + t.Cleanup(func() { + if helper, ok := t.(interface{ Helper() }); ok { + helper.Helper() + } + mock.AssertExpectations(t) + }) + + return mock +} + +// MockAPIClient is an autogenerated mock type for the APIClient type +type MockAPIClient struct { + mock.Mock +} + +type MockAPIClient_Expecter struct { + mock *mock.Mock +} + +func (_m *MockAPIClient) EXPECT() *MockAPIClient_Expecter { + return &MockAPIClient_Expecter{mock: &_m.Mock} +} + +// BuildCachePrune provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) BuildCachePrune(ctx context.Context, opts build.CachePruneOptions) (*build.CachePruneReport, error) { + ret := _mock.Called(ctx, opts) + + if len(ret) == 0 { + panic("no return value specified for BuildCachePrune") + } + + var r0 *build.CachePruneReport + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, build.CachePruneOptions) (*build.CachePruneReport, error)); ok { + return returnFunc(ctx, opts) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, build.CachePruneOptions) *build.CachePruneReport); ok { + r0 = returnFunc(ctx, opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*build.CachePruneReport) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, build.CachePruneOptions) error); ok { + r1 = returnFunc(ctx, opts) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_BuildCachePrune_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BuildCachePrune' +type MockAPIClient_BuildCachePrune_Call struct { + *mock.Call +} + +// BuildCachePrune is a helper method to define mock.On call +// - ctx context.Context +// - opts build.CachePruneOptions +func (_e *MockAPIClient_Expecter) BuildCachePrune(ctx any, opts any) *MockAPIClient_BuildCachePrune_Call { + return &MockAPIClient_BuildCachePrune_Call{Call: _e.mock.On("BuildCachePrune", ctx, opts)} +} + +func (_c *MockAPIClient_BuildCachePrune_Call) Run(run func(ctx context.Context, opts build.CachePruneOptions)) *MockAPIClient_BuildCachePrune_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 build.CachePruneOptions + if args[1] != nil { + arg1 = args[1].(build.CachePruneOptions) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockAPIClient_BuildCachePrune_Call) Return(cachePruneReport *build.CachePruneReport, err error) *MockAPIClient_BuildCachePrune_Call { + _c.Call.Return(cachePruneReport, err) + return _c +} + +func (_c *MockAPIClient_BuildCachePrune_Call) RunAndReturn(run func(ctx context.Context, opts build.CachePruneOptions) (*build.CachePruneReport, error)) *MockAPIClient_BuildCachePrune_Call { + _c.Call.Return(run) + return _c +} + +// BuildCancel provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) BuildCancel(ctx context.Context, id string) error { + ret := _mock.Called(ctx, id) + + if len(ret) == 0 { + panic("no return value specified for BuildCancel") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = returnFunc(ctx, id) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockAPIClient_BuildCancel_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BuildCancel' +type MockAPIClient_BuildCancel_Call struct { + *mock.Call +} + +// BuildCancel is a helper method to define mock.On call +// - ctx context.Context +// - id string +func (_e *MockAPIClient_Expecter) BuildCancel(ctx any, id any) *MockAPIClient_BuildCancel_Call { + return &MockAPIClient_BuildCancel_Call{Call: _e.mock.On("BuildCancel", ctx, id)} +} + +func (_c *MockAPIClient_BuildCancel_Call) Run(run func(ctx context.Context, id string)) *MockAPIClient_BuildCancel_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockAPIClient_BuildCancel_Call) Return(err error) *MockAPIClient_BuildCancel_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockAPIClient_BuildCancel_Call) RunAndReturn(run func(ctx context.Context, id string) error) *MockAPIClient_BuildCancel_Call { + _c.Call.Return(run) + return _c +} + +// CheckpointCreate provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) CheckpointCreate(ctx context.Context, container string, options checkpoint.CreateOptions) error { + ret := _mock.Called(ctx, container, options) + + if len(ret) == 0 { + panic("no return value specified for CheckpointCreate") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, checkpoint.CreateOptions) error); ok { + r0 = returnFunc(ctx, container, options) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockAPIClient_CheckpointCreate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CheckpointCreate' +type MockAPIClient_CheckpointCreate_Call struct { + *mock.Call +} + +// CheckpointCreate is a helper method to define mock.On call +// - ctx context.Context +// - container string +// - options checkpoint.CreateOptions +func (_e *MockAPIClient_Expecter) CheckpointCreate(ctx any, container any, options any) *MockAPIClient_CheckpointCreate_Call { + return &MockAPIClient_CheckpointCreate_Call{Call: _e.mock.On("CheckpointCreate", ctx, container, options)} +} + +func (_c *MockAPIClient_CheckpointCreate_Call) Run(run func(ctx context.Context, container string, options checkpoint.CreateOptions)) *MockAPIClient_CheckpointCreate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 checkpoint.CreateOptions + if args[2] != nil { + arg2 = args[2].(checkpoint.CreateOptions) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockAPIClient_CheckpointCreate_Call) Return(err error) *MockAPIClient_CheckpointCreate_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockAPIClient_CheckpointCreate_Call) RunAndReturn(run func(ctx context.Context, container string, options checkpoint.CreateOptions) error) *MockAPIClient_CheckpointCreate_Call { + _c.Call.Return(run) + return _c +} + +// CheckpointDelete provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) CheckpointDelete(ctx context.Context, container string, options checkpoint.DeleteOptions) error { + ret := _mock.Called(ctx, container, options) + + if len(ret) == 0 { + panic("no return value specified for CheckpointDelete") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, checkpoint.DeleteOptions) error); ok { + r0 = returnFunc(ctx, container, options) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockAPIClient_CheckpointDelete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CheckpointDelete' +type MockAPIClient_CheckpointDelete_Call struct { + *mock.Call +} + +// CheckpointDelete is a helper method to define mock.On call +// - ctx context.Context +// - container string +// - options checkpoint.DeleteOptions +func (_e *MockAPIClient_Expecter) CheckpointDelete(ctx any, container any, options any) *MockAPIClient_CheckpointDelete_Call { + return &MockAPIClient_CheckpointDelete_Call{Call: _e.mock.On("CheckpointDelete", ctx, container, options)} +} + +func (_c *MockAPIClient_CheckpointDelete_Call) Run(run func(ctx context.Context, container string, options checkpoint.DeleteOptions)) *MockAPIClient_CheckpointDelete_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 checkpoint.DeleteOptions + if args[2] != nil { + arg2 = args[2].(checkpoint.DeleteOptions) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockAPIClient_CheckpointDelete_Call) Return(err error) *MockAPIClient_CheckpointDelete_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockAPIClient_CheckpointDelete_Call) RunAndReturn(run func(ctx context.Context, container string, options checkpoint.DeleteOptions) error) *MockAPIClient_CheckpointDelete_Call { + _c.Call.Return(run) + return _c +} + +// CheckpointList provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) CheckpointList(ctx context.Context, container string, options checkpoint.ListOptions) ([]checkpoint.Summary, error) { + ret := _mock.Called(ctx, container, options) + + if len(ret) == 0 { + panic("no return value specified for CheckpointList") + } + + var r0 []checkpoint.Summary + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, checkpoint.ListOptions) ([]checkpoint.Summary, error)); ok { + return returnFunc(ctx, container, options) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, string, checkpoint.ListOptions) []checkpoint.Summary); ok { + r0 = returnFunc(ctx, container, options) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]checkpoint.Summary) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, string, checkpoint.ListOptions) error); ok { + r1 = returnFunc(ctx, container, options) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_CheckpointList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CheckpointList' +type MockAPIClient_CheckpointList_Call struct { + *mock.Call +} + +// CheckpointList is a helper method to define mock.On call +// - ctx context.Context +// - container string +// - options checkpoint.ListOptions +func (_e *MockAPIClient_Expecter) CheckpointList(ctx any, container any, options any) *MockAPIClient_CheckpointList_Call { + return &MockAPIClient_CheckpointList_Call{Call: _e.mock.On("CheckpointList", ctx, container, options)} +} + +func (_c *MockAPIClient_CheckpointList_Call) Run(run func(ctx context.Context, container string, options checkpoint.ListOptions)) *MockAPIClient_CheckpointList_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 checkpoint.ListOptions + if args[2] != nil { + arg2 = args[2].(checkpoint.ListOptions) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockAPIClient_CheckpointList_Call) Return(summarys []checkpoint.Summary, err error) *MockAPIClient_CheckpointList_Call { + _c.Call.Return(summarys, err) + return _c +} + +func (_c *MockAPIClient_CheckpointList_Call) RunAndReturn(run func(ctx context.Context, container string, options checkpoint.ListOptions) ([]checkpoint.Summary, error)) *MockAPIClient_CheckpointList_Call { + _c.Call.Return(run) + return _c +} + +// ClientVersion provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ClientVersion() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for ClientVersion") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// MockAPIClient_ClientVersion_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ClientVersion' +type MockAPIClient_ClientVersion_Call struct { + *mock.Call +} + +// ClientVersion is a helper method to define mock.On call +func (_e *MockAPIClient_Expecter) ClientVersion() *MockAPIClient_ClientVersion_Call { + return &MockAPIClient_ClientVersion_Call{Call: _e.mock.On("ClientVersion")} +} + +func (_c *MockAPIClient_ClientVersion_Call) Run(run func()) *MockAPIClient_ClientVersion_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockAPIClient_ClientVersion_Call) Return(s string) *MockAPIClient_ClientVersion_Call { + _c.Call.Return(s) + return _c +} + +func (_c *MockAPIClient_ClientVersion_Call) RunAndReturn(run func() string) *MockAPIClient_ClientVersion_Call { + _c.Call.Return(run) + return _c +} + +// Close provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) Close() error { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Close") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func() error); ok { + r0 = returnFunc() + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockAPIClient_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type MockAPIClient_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *MockAPIClient_Expecter) Close() *MockAPIClient_Close_Call { + return &MockAPIClient_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *MockAPIClient_Close_Call) Run(run func()) *MockAPIClient_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockAPIClient_Close_Call) Return(err error) *MockAPIClient_Close_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockAPIClient_Close_Call) RunAndReturn(run func() error) *MockAPIClient_Close_Call { + _c.Call.Return(run) + return _c +} + +// ConfigCreate provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ConfigCreate(ctx context.Context, config swarm.ConfigSpec) (swarm.ConfigCreateResponse, error) { + ret := _mock.Called(ctx, config) + + if len(ret) == 0 { + panic("no return value specified for ConfigCreate") + } + + var r0 swarm.ConfigCreateResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, swarm.ConfigSpec) (swarm.ConfigCreateResponse, error)); ok { + return returnFunc(ctx, config) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, swarm.ConfigSpec) swarm.ConfigCreateResponse); ok { + r0 = returnFunc(ctx, config) + } else { + r0 = ret.Get(0).(swarm.ConfigCreateResponse) + } + if returnFunc, ok := ret.Get(1).(func(context.Context, swarm.ConfigSpec) error); ok { + r1 = returnFunc(ctx, config) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_ConfigCreate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ConfigCreate' +type MockAPIClient_ConfigCreate_Call struct { + *mock.Call +} + +// ConfigCreate is a helper method to define mock.On call +// - ctx context.Context +// - config swarm.ConfigSpec +func (_e *MockAPIClient_Expecter) ConfigCreate(ctx any, config any) *MockAPIClient_ConfigCreate_Call { + return &MockAPIClient_ConfigCreate_Call{Call: _e.mock.On("ConfigCreate", ctx, config)} +} + +func (_c *MockAPIClient_ConfigCreate_Call) Run(run func(ctx context.Context, config swarm.ConfigSpec)) *MockAPIClient_ConfigCreate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 swarm.ConfigSpec + if args[1] != nil { + arg1 = args[1].(swarm.ConfigSpec) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockAPIClient_ConfigCreate_Call) Return(configCreateResponse swarm.ConfigCreateResponse, err error) *MockAPIClient_ConfigCreate_Call { + _c.Call.Return(configCreateResponse, err) + return _c +} + +func (_c *MockAPIClient_ConfigCreate_Call) RunAndReturn(run func(ctx context.Context, config swarm.ConfigSpec) (swarm.ConfigCreateResponse, error)) *MockAPIClient_ConfigCreate_Call { + _c.Call.Return(run) + return _c +} + +// ConfigInspectWithRaw provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ConfigInspectWithRaw(ctx context.Context, name string) (swarm.Config, []byte, error) { + ret := _mock.Called(ctx, name) + + if len(ret) == 0 { + panic("no return value specified for ConfigInspectWithRaw") + } + + var r0 swarm.Config + var r1 []byte + var r2 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string) (swarm.Config, []byte, error)); ok { + return returnFunc(ctx, name) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, string) swarm.Config); ok { + r0 = returnFunc(ctx, name) + } else { + r0 = ret.Get(0).(swarm.Config) + } + if returnFunc, ok := ret.Get(1).(func(context.Context, string) []byte); ok { + r1 = returnFunc(ctx, name) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).([]byte) + } + } + if returnFunc, ok := ret.Get(2).(func(context.Context, string) error); ok { + r2 = returnFunc(ctx, name) + } else { + r2 = ret.Error(2) + } + return r0, r1, r2 +} + +// MockAPIClient_ConfigInspectWithRaw_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ConfigInspectWithRaw' +type MockAPIClient_ConfigInspectWithRaw_Call struct { + *mock.Call +} + +// ConfigInspectWithRaw is a helper method to define mock.On call +// - ctx context.Context +// - name string +func (_e *MockAPIClient_Expecter) ConfigInspectWithRaw(ctx any, name any) *MockAPIClient_ConfigInspectWithRaw_Call { + return &MockAPIClient_ConfigInspectWithRaw_Call{Call: _e.mock.On("ConfigInspectWithRaw", ctx, name)} +} + +func (_c *MockAPIClient_ConfigInspectWithRaw_Call) Run(run func(ctx context.Context, name string)) *MockAPIClient_ConfigInspectWithRaw_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockAPIClient_ConfigInspectWithRaw_Call) Return(config swarm.Config, bytes []byte, err error) *MockAPIClient_ConfigInspectWithRaw_Call { + _c.Call.Return(config, bytes, err) + return _c +} + +func (_c *MockAPIClient_ConfigInspectWithRaw_Call) RunAndReturn(run func(ctx context.Context, name string) (swarm.Config, []byte, error)) *MockAPIClient_ConfigInspectWithRaw_Call { + _c.Call.Return(run) + return _c +} + +// ConfigList provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ConfigList(ctx context.Context, options swarm.ConfigListOptions) ([]swarm.Config, error) { + ret := _mock.Called(ctx, options) + + if len(ret) == 0 { + panic("no return value specified for ConfigList") + } + + var r0 []swarm.Config + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, swarm.ConfigListOptions) ([]swarm.Config, error)); ok { + return returnFunc(ctx, options) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, swarm.ConfigListOptions) []swarm.Config); ok { + r0 = returnFunc(ctx, options) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]swarm.Config) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, swarm.ConfigListOptions) error); ok { + r1 = returnFunc(ctx, options) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_ConfigList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ConfigList' +type MockAPIClient_ConfigList_Call struct { + *mock.Call +} + +// ConfigList is a helper method to define mock.On call +// - ctx context.Context +// - options swarm.ConfigListOptions +func (_e *MockAPIClient_Expecter) ConfigList(ctx any, options any) *MockAPIClient_ConfigList_Call { + return &MockAPIClient_ConfigList_Call{Call: _e.mock.On("ConfigList", ctx, options)} +} + +func (_c *MockAPIClient_ConfigList_Call) Run(run func(ctx context.Context, options swarm.ConfigListOptions)) *MockAPIClient_ConfigList_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 swarm.ConfigListOptions + if args[1] != nil { + arg1 = args[1].(swarm.ConfigListOptions) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockAPIClient_ConfigList_Call) Return(configs []swarm.Config, err error) *MockAPIClient_ConfigList_Call { + _c.Call.Return(configs, err) + return _c +} + +func (_c *MockAPIClient_ConfigList_Call) RunAndReturn(run func(ctx context.Context, options swarm.ConfigListOptions) ([]swarm.Config, error)) *MockAPIClient_ConfigList_Call { + _c.Call.Return(run) + return _c +} + +// ConfigRemove provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ConfigRemove(ctx context.Context, id string) error { + ret := _mock.Called(ctx, id) + + if len(ret) == 0 { + panic("no return value specified for ConfigRemove") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = returnFunc(ctx, id) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockAPIClient_ConfigRemove_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ConfigRemove' +type MockAPIClient_ConfigRemove_Call struct { + *mock.Call +} + +// ConfigRemove is a helper method to define mock.On call +// - ctx context.Context +// - id string +func (_e *MockAPIClient_Expecter) ConfigRemove(ctx any, id any) *MockAPIClient_ConfigRemove_Call { + return &MockAPIClient_ConfigRemove_Call{Call: _e.mock.On("ConfigRemove", ctx, id)} +} + +func (_c *MockAPIClient_ConfigRemove_Call) Run(run func(ctx context.Context, id string)) *MockAPIClient_ConfigRemove_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockAPIClient_ConfigRemove_Call) Return(err error) *MockAPIClient_ConfigRemove_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockAPIClient_ConfigRemove_Call) RunAndReturn(run func(ctx context.Context, id string) error) *MockAPIClient_ConfigRemove_Call { + _c.Call.Return(run) + return _c +} + +// ConfigUpdate provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ConfigUpdate(ctx context.Context, id string, version swarm.Version, config swarm.ConfigSpec) error { + ret := _mock.Called(ctx, id, version, config) + + if len(ret) == 0 { + panic("no return value specified for ConfigUpdate") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, swarm.Version, swarm.ConfigSpec) error); ok { + r0 = returnFunc(ctx, id, version, config) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockAPIClient_ConfigUpdate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ConfigUpdate' +type MockAPIClient_ConfigUpdate_Call struct { + *mock.Call +} + +// ConfigUpdate is a helper method to define mock.On call +// - ctx context.Context +// - id string +// - version swarm.Version +// - config swarm.ConfigSpec +func (_e *MockAPIClient_Expecter) ConfigUpdate(ctx any, id any, version any, config any) *MockAPIClient_ConfigUpdate_Call { + return &MockAPIClient_ConfigUpdate_Call{Call: _e.mock.On("ConfigUpdate", ctx, id, version, config)} +} + +func (_c *MockAPIClient_ConfigUpdate_Call) Run(run func(ctx context.Context, id string, version swarm.Version, config swarm.ConfigSpec)) *MockAPIClient_ConfigUpdate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 swarm.Version + if args[2] != nil { + arg2 = args[2].(swarm.Version) + } + var arg3 swarm.ConfigSpec + if args[3] != nil { + arg3 = args[3].(swarm.ConfigSpec) + } + run( + arg0, + arg1, + arg2, + arg3, + ) + }) + return _c +} + +func (_c *MockAPIClient_ConfigUpdate_Call) Return(err error) *MockAPIClient_ConfigUpdate_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockAPIClient_ConfigUpdate_Call) RunAndReturn(run func(ctx context.Context, id string, version swarm.Version, config swarm.ConfigSpec) error) *MockAPIClient_ConfigUpdate_Call { + _c.Call.Return(run) + return _c +} + +// ContainerAttach provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ContainerAttach(ctx context.Context, container1 string, options container.AttachOptions) (types.HijackedResponse, error) { + ret := _mock.Called(ctx, container1, options) + + if len(ret) == 0 { + panic("no return value specified for ContainerAttach") + } + + var r0 types.HijackedResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, container.AttachOptions) (types.HijackedResponse, error)); ok { + return returnFunc(ctx, container1, options) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, string, container.AttachOptions) types.HijackedResponse); ok { + r0 = returnFunc(ctx, container1, options) + } else { + r0 = ret.Get(0).(types.HijackedResponse) + } + if returnFunc, ok := ret.Get(1).(func(context.Context, string, container.AttachOptions) error); ok { + r1 = returnFunc(ctx, container1, options) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_ContainerAttach_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ContainerAttach' +type MockAPIClient_ContainerAttach_Call struct { + *mock.Call +} + +// ContainerAttach is a helper method to define mock.On call +// - ctx context.Context +// - container1 string +// - options container.AttachOptions +func (_e *MockAPIClient_Expecter) ContainerAttach(ctx any, container1 any, options any) *MockAPIClient_ContainerAttach_Call { + return &MockAPIClient_ContainerAttach_Call{Call: _e.mock.On("ContainerAttach", ctx, container1, options)} +} + +func (_c *MockAPIClient_ContainerAttach_Call) Run(run func(ctx context.Context, container1 string, options container.AttachOptions)) *MockAPIClient_ContainerAttach_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 container.AttachOptions + if args[2] != nil { + arg2 = args[2].(container.AttachOptions) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockAPIClient_ContainerAttach_Call) Return(hijackedResponse types.HijackedResponse, err error) *MockAPIClient_ContainerAttach_Call { + _c.Call.Return(hijackedResponse, err) + return _c +} + +func (_c *MockAPIClient_ContainerAttach_Call) RunAndReturn(run func(ctx context.Context, container1 string, options container.AttachOptions) (types.HijackedResponse, error)) *MockAPIClient_ContainerAttach_Call { + _c.Call.Return(run) + return _c +} + +// ContainerCommit provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ContainerCommit(ctx context.Context, container1 string, options container.CommitOptions) (container.CommitResponse, error) { + ret := _mock.Called(ctx, container1, options) + + if len(ret) == 0 { + panic("no return value specified for ContainerCommit") + } + + var r0 container.CommitResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, container.CommitOptions) (container.CommitResponse, error)); ok { + return returnFunc(ctx, container1, options) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, string, container.CommitOptions) container.CommitResponse); ok { + r0 = returnFunc(ctx, container1, options) + } else { + r0 = ret.Get(0).(container.CommitResponse) + } + if returnFunc, ok := ret.Get(1).(func(context.Context, string, container.CommitOptions) error); ok { + r1 = returnFunc(ctx, container1, options) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_ContainerCommit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ContainerCommit' +type MockAPIClient_ContainerCommit_Call struct { + *mock.Call +} + +// ContainerCommit is a helper method to define mock.On call +// - ctx context.Context +// - container1 string +// - options container.CommitOptions +func (_e *MockAPIClient_Expecter) ContainerCommit(ctx any, container1 any, options any) *MockAPIClient_ContainerCommit_Call { + return &MockAPIClient_ContainerCommit_Call{Call: _e.mock.On("ContainerCommit", ctx, container1, options)} +} + +func (_c *MockAPIClient_ContainerCommit_Call) Run(run func(ctx context.Context, container1 string, options container.CommitOptions)) *MockAPIClient_ContainerCommit_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 container.CommitOptions + if args[2] != nil { + arg2 = args[2].(container.CommitOptions) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockAPIClient_ContainerCommit_Call) Return(commitResponse container.CommitResponse, err error) *MockAPIClient_ContainerCommit_Call { + _c.Call.Return(commitResponse, err) + return _c +} + +func (_c *MockAPIClient_ContainerCommit_Call) RunAndReturn(run func(ctx context.Context, container1 string, options container.CommitOptions) (container.CommitResponse, error)) *MockAPIClient_ContainerCommit_Call { + _c.Call.Return(run) + return _c +} + +// ContainerCreate provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ContainerCreate(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, platform *v1.Platform, containerName string) (container.CreateResponse, error) { + ret := _mock.Called(ctx, config, hostConfig, networkingConfig, platform, containerName) + + if len(ret) == 0 { + panic("no return value specified for ContainerCreate") + } + + var r0 container.CreateResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *container.Config, *container.HostConfig, *network.NetworkingConfig, *v1.Platform, string) (container.CreateResponse, error)); ok { + return returnFunc(ctx, config, hostConfig, networkingConfig, platform, containerName) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *container.Config, *container.HostConfig, *network.NetworkingConfig, *v1.Platform, string) container.CreateResponse); ok { + r0 = returnFunc(ctx, config, hostConfig, networkingConfig, platform, containerName) + } else { + r0 = ret.Get(0).(container.CreateResponse) + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *container.Config, *container.HostConfig, *network.NetworkingConfig, *v1.Platform, string) error); ok { + r1 = returnFunc(ctx, config, hostConfig, networkingConfig, platform, containerName) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_ContainerCreate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ContainerCreate' +type MockAPIClient_ContainerCreate_Call struct { + *mock.Call +} + +// ContainerCreate is a helper method to define mock.On call +// - ctx context.Context +// - config *container.Config +// - hostConfig *container.HostConfig +// - networkingConfig *network.NetworkingConfig +// - platform *v1.Platform +// - containerName string +func (_e *MockAPIClient_Expecter) ContainerCreate(ctx any, config any, hostConfig any, networkingConfig any, platform any, containerName any) *MockAPIClient_ContainerCreate_Call { + return &MockAPIClient_ContainerCreate_Call{Call: _e.mock.On("ContainerCreate", ctx, config, hostConfig, networkingConfig, platform, containerName)} +} + +func (_c *MockAPIClient_ContainerCreate_Call) Run(run func(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, platform *v1.Platform, containerName string)) *MockAPIClient_ContainerCreate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *container.Config + if args[1] != nil { + arg1 = args[1].(*container.Config) + } + var arg2 *container.HostConfig + if args[2] != nil { + arg2 = args[2].(*container.HostConfig) + } + var arg3 *network.NetworkingConfig + if args[3] != nil { + arg3 = args[3].(*network.NetworkingConfig) + } + var arg4 *v1.Platform + if args[4] != nil { + arg4 = args[4].(*v1.Platform) + } + var arg5 string + if args[5] != nil { + arg5 = args[5].(string) + } + run( + arg0, + arg1, + arg2, + arg3, + arg4, + arg5, + ) + }) + return _c +} + +func (_c *MockAPIClient_ContainerCreate_Call) Return(createResponse container.CreateResponse, err error) *MockAPIClient_ContainerCreate_Call { + _c.Call.Return(createResponse, err) + return _c +} + +func (_c *MockAPIClient_ContainerCreate_Call) RunAndReturn(run func(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, platform *v1.Platform, containerName string) (container.CreateResponse, error)) *MockAPIClient_ContainerCreate_Call { + _c.Call.Return(run) + return _c +} + +// ContainerDiff provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ContainerDiff(ctx context.Context, container1 string) ([]container.FilesystemChange, error) { + ret := _mock.Called(ctx, container1) + + if len(ret) == 0 { + panic("no return value specified for ContainerDiff") + } + + var r0 []container.FilesystemChange + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string) ([]container.FilesystemChange, error)); ok { + return returnFunc(ctx, container1) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, string) []container.FilesystemChange); ok { + r0 = returnFunc(ctx, container1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]container.FilesystemChange) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = returnFunc(ctx, container1) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_ContainerDiff_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ContainerDiff' +type MockAPIClient_ContainerDiff_Call struct { + *mock.Call +} + +// ContainerDiff is a helper method to define mock.On call +// - ctx context.Context +// - container1 string +func (_e *MockAPIClient_Expecter) ContainerDiff(ctx any, container1 any) *MockAPIClient_ContainerDiff_Call { + return &MockAPIClient_ContainerDiff_Call{Call: _e.mock.On("ContainerDiff", ctx, container1)} +} + +func (_c *MockAPIClient_ContainerDiff_Call) Run(run func(ctx context.Context, container1 string)) *MockAPIClient_ContainerDiff_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockAPIClient_ContainerDiff_Call) Return(filesystemChanges []container.FilesystemChange, err error) *MockAPIClient_ContainerDiff_Call { + _c.Call.Return(filesystemChanges, err) + return _c +} + +func (_c *MockAPIClient_ContainerDiff_Call) RunAndReturn(run func(ctx context.Context, container1 string) ([]container.FilesystemChange, error)) *MockAPIClient_ContainerDiff_Call { + _c.Call.Return(run) + return _c +} + +// ContainerExecAttach provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ContainerExecAttach(ctx context.Context, execID string, options container.ExecAttachOptions) (types.HijackedResponse, error) { + ret := _mock.Called(ctx, execID, options) + + if len(ret) == 0 { + panic("no return value specified for ContainerExecAttach") + } + + var r0 types.HijackedResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, container.ExecAttachOptions) (types.HijackedResponse, error)); ok { + return returnFunc(ctx, execID, options) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, string, container.ExecAttachOptions) types.HijackedResponse); ok { + r0 = returnFunc(ctx, execID, options) + } else { + r0 = ret.Get(0).(types.HijackedResponse) + } + if returnFunc, ok := ret.Get(1).(func(context.Context, string, container.ExecAttachOptions) error); ok { + r1 = returnFunc(ctx, execID, options) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_ContainerExecAttach_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ContainerExecAttach' +type MockAPIClient_ContainerExecAttach_Call struct { + *mock.Call +} + +// ContainerExecAttach is a helper method to define mock.On call +// - ctx context.Context +// - execID string +// - options container.ExecAttachOptions +func (_e *MockAPIClient_Expecter) ContainerExecAttach(ctx any, execID any, options any) *MockAPIClient_ContainerExecAttach_Call { + return &MockAPIClient_ContainerExecAttach_Call{Call: _e.mock.On("ContainerExecAttach", ctx, execID, options)} +} + +func (_c *MockAPIClient_ContainerExecAttach_Call) Run(run func(ctx context.Context, execID string, options container.ExecAttachOptions)) *MockAPIClient_ContainerExecAttach_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 container.ExecAttachOptions + if args[2] != nil { + arg2 = args[2].(container.ExecAttachOptions) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockAPIClient_ContainerExecAttach_Call) Return(hijackedResponse types.HijackedResponse, err error) *MockAPIClient_ContainerExecAttach_Call { + _c.Call.Return(hijackedResponse, err) + return _c +} + +func (_c *MockAPIClient_ContainerExecAttach_Call) RunAndReturn(run func(ctx context.Context, execID string, options container.ExecAttachOptions) (types.HijackedResponse, error)) *MockAPIClient_ContainerExecAttach_Call { + _c.Call.Return(run) + return _c +} + +// ContainerExecCreate provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ContainerExecCreate(ctx context.Context, container1 string, options container.ExecOptions) (container.ExecCreateResponse, error) { + ret := _mock.Called(ctx, container1, options) + + if len(ret) == 0 { + panic("no return value specified for ContainerExecCreate") + } + + var r0 container.ExecCreateResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, container.ExecOptions) (container.ExecCreateResponse, error)); ok { + return returnFunc(ctx, container1, options) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, string, container.ExecOptions) container.ExecCreateResponse); ok { + r0 = returnFunc(ctx, container1, options) + } else { + r0 = ret.Get(0).(container.ExecCreateResponse) + } + if returnFunc, ok := ret.Get(1).(func(context.Context, string, container.ExecOptions) error); ok { + r1 = returnFunc(ctx, container1, options) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_ContainerExecCreate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ContainerExecCreate' +type MockAPIClient_ContainerExecCreate_Call struct { + *mock.Call +} + +// ContainerExecCreate is a helper method to define mock.On call +// - ctx context.Context +// - container1 string +// - options container.ExecOptions +func (_e *MockAPIClient_Expecter) ContainerExecCreate(ctx any, container1 any, options any) *MockAPIClient_ContainerExecCreate_Call { + return &MockAPIClient_ContainerExecCreate_Call{Call: _e.mock.On("ContainerExecCreate", ctx, container1, options)} +} + +func (_c *MockAPIClient_ContainerExecCreate_Call) Run(run func(ctx context.Context, container1 string, options container.ExecOptions)) *MockAPIClient_ContainerExecCreate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 container.ExecOptions + if args[2] != nil { + arg2 = args[2].(container.ExecOptions) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockAPIClient_ContainerExecCreate_Call) Return(execCreateResponse container.ExecCreateResponse, err error) *MockAPIClient_ContainerExecCreate_Call { + _c.Call.Return(execCreateResponse, err) + return _c +} + +func (_c *MockAPIClient_ContainerExecCreate_Call) RunAndReturn(run func(ctx context.Context, container1 string, options container.ExecOptions) (container.ExecCreateResponse, error)) *MockAPIClient_ContainerExecCreate_Call { + _c.Call.Return(run) + return _c +} + +// ContainerExecInspect provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ContainerExecInspect(ctx context.Context, execID string) (container.ExecInspect, error) { + ret := _mock.Called(ctx, execID) + + if len(ret) == 0 { + panic("no return value specified for ContainerExecInspect") + } + + var r0 container.ExecInspect + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string) (container.ExecInspect, error)); ok { + return returnFunc(ctx, execID) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, string) container.ExecInspect); ok { + r0 = returnFunc(ctx, execID) + } else { + r0 = ret.Get(0).(container.ExecInspect) + } + if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = returnFunc(ctx, execID) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_ContainerExecInspect_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ContainerExecInspect' +type MockAPIClient_ContainerExecInspect_Call struct { + *mock.Call +} + +// ContainerExecInspect is a helper method to define mock.On call +// - ctx context.Context +// - execID string +func (_e *MockAPIClient_Expecter) ContainerExecInspect(ctx any, execID any) *MockAPIClient_ContainerExecInspect_Call { + return &MockAPIClient_ContainerExecInspect_Call{Call: _e.mock.On("ContainerExecInspect", ctx, execID)} +} + +func (_c *MockAPIClient_ContainerExecInspect_Call) Run(run func(ctx context.Context, execID string)) *MockAPIClient_ContainerExecInspect_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockAPIClient_ContainerExecInspect_Call) Return(execInspect container.ExecInspect, err error) *MockAPIClient_ContainerExecInspect_Call { + _c.Call.Return(execInspect, err) + return _c +} + +func (_c *MockAPIClient_ContainerExecInspect_Call) RunAndReturn(run func(ctx context.Context, execID string) (container.ExecInspect, error)) *MockAPIClient_ContainerExecInspect_Call { + _c.Call.Return(run) + return _c +} + +// ContainerExecResize provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ContainerExecResize(ctx context.Context, execID string, options container.ResizeOptions) error { + ret := _mock.Called(ctx, execID, options) + + if len(ret) == 0 { + panic("no return value specified for ContainerExecResize") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, container.ResizeOptions) error); ok { + r0 = returnFunc(ctx, execID, options) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockAPIClient_ContainerExecResize_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ContainerExecResize' +type MockAPIClient_ContainerExecResize_Call struct { + *mock.Call +} + +// ContainerExecResize is a helper method to define mock.On call +// - ctx context.Context +// - execID string +// - options container.ResizeOptions +func (_e *MockAPIClient_Expecter) ContainerExecResize(ctx any, execID any, options any) *MockAPIClient_ContainerExecResize_Call { + return &MockAPIClient_ContainerExecResize_Call{Call: _e.mock.On("ContainerExecResize", ctx, execID, options)} +} + +func (_c *MockAPIClient_ContainerExecResize_Call) Run(run func(ctx context.Context, execID string, options container.ResizeOptions)) *MockAPIClient_ContainerExecResize_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 container.ResizeOptions + if args[2] != nil { + arg2 = args[2].(container.ResizeOptions) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockAPIClient_ContainerExecResize_Call) Return(err error) *MockAPIClient_ContainerExecResize_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockAPIClient_ContainerExecResize_Call) RunAndReturn(run func(ctx context.Context, execID string, options container.ResizeOptions) error) *MockAPIClient_ContainerExecResize_Call { + _c.Call.Return(run) + return _c +} + +// ContainerExecStart provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ContainerExecStart(ctx context.Context, execID string, options container.ExecStartOptions) error { + ret := _mock.Called(ctx, execID, options) + + if len(ret) == 0 { + panic("no return value specified for ContainerExecStart") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, container.ExecStartOptions) error); ok { + r0 = returnFunc(ctx, execID, options) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockAPIClient_ContainerExecStart_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ContainerExecStart' +type MockAPIClient_ContainerExecStart_Call struct { + *mock.Call +} + +// ContainerExecStart is a helper method to define mock.On call +// - ctx context.Context +// - execID string +// - options container.ExecStartOptions +func (_e *MockAPIClient_Expecter) ContainerExecStart(ctx any, execID any, options any) *MockAPIClient_ContainerExecStart_Call { + return &MockAPIClient_ContainerExecStart_Call{Call: _e.mock.On("ContainerExecStart", ctx, execID, options)} +} + +func (_c *MockAPIClient_ContainerExecStart_Call) Run(run func(ctx context.Context, execID string, options container.ExecStartOptions)) *MockAPIClient_ContainerExecStart_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 container.ExecStartOptions + if args[2] != nil { + arg2 = args[2].(container.ExecStartOptions) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockAPIClient_ContainerExecStart_Call) Return(err error) *MockAPIClient_ContainerExecStart_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockAPIClient_ContainerExecStart_Call) RunAndReturn(run func(ctx context.Context, execID string, options container.ExecStartOptions) error) *MockAPIClient_ContainerExecStart_Call { + _c.Call.Return(run) + return _c +} + +// ContainerExport provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ContainerExport(ctx context.Context, container1 string) (io.ReadCloser, error) { + ret := _mock.Called(ctx, container1) + + if len(ret) == 0 { + panic("no return value specified for ContainerExport") + } + + var r0 io.ReadCloser + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string) (io.ReadCloser, error)); ok { + return returnFunc(ctx, container1) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, string) io.ReadCloser); ok { + r0 = returnFunc(ctx, container1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(io.ReadCloser) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = returnFunc(ctx, container1) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_ContainerExport_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ContainerExport' +type MockAPIClient_ContainerExport_Call struct { + *mock.Call +} + +// ContainerExport is a helper method to define mock.On call +// - ctx context.Context +// - container1 string +func (_e *MockAPIClient_Expecter) ContainerExport(ctx any, container1 any) *MockAPIClient_ContainerExport_Call { + return &MockAPIClient_ContainerExport_Call{Call: _e.mock.On("ContainerExport", ctx, container1)} +} + +func (_c *MockAPIClient_ContainerExport_Call) Run(run func(ctx context.Context, container1 string)) *MockAPIClient_ContainerExport_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockAPIClient_ContainerExport_Call) Return(readCloser io.ReadCloser, err error) *MockAPIClient_ContainerExport_Call { + _c.Call.Return(readCloser, err) + return _c +} + +func (_c *MockAPIClient_ContainerExport_Call) RunAndReturn(run func(ctx context.Context, container1 string) (io.ReadCloser, error)) *MockAPIClient_ContainerExport_Call { + _c.Call.Return(run) + return _c +} + +// ContainerInspect provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ContainerInspect(ctx context.Context, container1 string) (container.InspectResponse, error) { + ret := _mock.Called(ctx, container1) + + if len(ret) == 0 { + panic("no return value specified for ContainerInspect") + } + + var r0 container.InspectResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string) (container.InspectResponse, error)); ok { + return returnFunc(ctx, container1) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, string) container.InspectResponse); ok { + r0 = returnFunc(ctx, container1) + } else { + r0 = ret.Get(0).(container.InspectResponse) + } + if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = returnFunc(ctx, container1) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_ContainerInspect_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ContainerInspect' +type MockAPIClient_ContainerInspect_Call struct { + *mock.Call +} + +// ContainerInspect is a helper method to define mock.On call +// - ctx context.Context +// - container1 string +func (_e *MockAPIClient_Expecter) ContainerInspect(ctx any, container1 any) *MockAPIClient_ContainerInspect_Call { + return &MockAPIClient_ContainerInspect_Call{Call: _e.mock.On("ContainerInspect", ctx, container1)} +} + +func (_c *MockAPIClient_ContainerInspect_Call) Run(run func(ctx context.Context, container1 string)) *MockAPIClient_ContainerInspect_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockAPIClient_ContainerInspect_Call) Return(inspectResponse container.InspectResponse, err error) *MockAPIClient_ContainerInspect_Call { + _c.Call.Return(inspectResponse, err) + return _c +} + +func (_c *MockAPIClient_ContainerInspect_Call) RunAndReturn(run func(ctx context.Context, container1 string) (container.InspectResponse, error)) *MockAPIClient_ContainerInspect_Call { + _c.Call.Return(run) + return _c +} + +// ContainerInspectWithRaw provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ContainerInspectWithRaw(ctx context.Context, container1 string, getSize bool) (container.InspectResponse, []byte, error) { + ret := _mock.Called(ctx, container1, getSize) + + if len(ret) == 0 { + panic("no return value specified for ContainerInspectWithRaw") + } + + var r0 container.InspectResponse + var r1 []byte + var r2 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, bool) (container.InspectResponse, []byte, error)); ok { + return returnFunc(ctx, container1, getSize) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, string, bool) container.InspectResponse); ok { + r0 = returnFunc(ctx, container1, getSize) + } else { + r0 = ret.Get(0).(container.InspectResponse) + } + if returnFunc, ok := ret.Get(1).(func(context.Context, string, bool) []byte); ok { + r1 = returnFunc(ctx, container1, getSize) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).([]byte) + } + } + if returnFunc, ok := ret.Get(2).(func(context.Context, string, bool) error); ok { + r2 = returnFunc(ctx, container1, getSize) + } else { + r2 = ret.Error(2) + } + return r0, r1, r2 +} + +// MockAPIClient_ContainerInspectWithRaw_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ContainerInspectWithRaw' +type MockAPIClient_ContainerInspectWithRaw_Call struct { + *mock.Call +} + +// ContainerInspectWithRaw is a helper method to define mock.On call +// - ctx context.Context +// - container1 string +// - getSize bool +func (_e *MockAPIClient_Expecter) ContainerInspectWithRaw(ctx any, container1 any, getSize any) *MockAPIClient_ContainerInspectWithRaw_Call { + return &MockAPIClient_ContainerInspectWithRaw_Call{Call: _e.mock.On("ContainerInspectWithRaw", ctx, container1, getSize)} +} + +func (_c *MockAPIClient_ContainerInspectWithRaw_Call) Run(run func(ctx context.Context, container1 string, getSize bool)) *MockAPIClient_ContainerInspectWithRaw_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 bool + if args[2] != nil { + arg2 = args[2].(bool) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockAPIClient_ContainerInspectWithRaw_Call) Return(inspectResponse container.InspectResponse, bytes []byte, err error) *MockAPIClient_ContainerInspectWithRaw_Call { + _c.Call.Return(inspectResponse, bytes, err) + return _c +} + +func (_c *MockAPIClient_ContainerInspectWithRaw_Call) RunAndReturn(run func(ctx context.Context, container1 string, getSize bool) (container.InspectResponse, []byte, error)) *MockAPIClient_ContainerInspectWithRaw_Call { + _c.Call.Return(run) + return _c +} + +// ContainerKill provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ContainerKill(ctx context.Context, container1 string, signal string) error { + ret := _mock.Called(ctx, container1, signal) + + if len(ret) == 0 { + panic("no return value specified for ContainerKill") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) error); ok { + r0 = returnFunc(ctx, container1, signal) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockAPIClient_ContainerKill_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ContainerKill' +type MockAPIClient_ContainerKill_Call struct { + *mock.Call +} + +// ContainerKill is a helper method to define mock.On call +// - ctx context.Context +// - container1 string +// - signal string +func (_e *MockAPIClient_Expecter) ContainerKill(ctx any, container1 any, signal any) *MockAPIClient_ContainerKill_Call { + return &MockAPIClient_ContainerKill_Call{Call: _e.mock.On("ContainerKill", ctx, container1, signal)} +} + +func (_c *MockAPIClient_ContainerKill_Call) Run(run func(ctx context.Context, container1 string, signal string)) *MockAPIClient_ContainerKill_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 string + if args[2] != nil { + arg2 = args[2].(string) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockAPIClient_ContainerKill_Call) Return(err error) *MockAPIClient_ContainerKill_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockAPIClient_ContainerKill_Call) RunAndReturn(run func(ctx context.Context, container1 string, signal string) error) *MockAPIClient_ContainerKill_Call { + _c.Call.Return(run) + return _c +} + +// ContainerList provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ContainerList(ctx context.Context, options container.ListOptions) ([]container.Summary, error) { + ret := _mock.Called(ctx, options) + + if len(ret) == 0 { + panic("no return value specified for ContainerList") + } + + var r0 []container.Summary + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, container.ListOptions) ([]container.Summary, error)); ok { + return returnFunc(ctx, options) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, container.ListOptions) []container.Summary); ok { + r0 = returnFunc(ctx, options) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]container.Summary) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, container.ListOptions) error); ok { + r1 = returnFunc(ctx, options) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_ContainerList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ContainerList' +type MockAPIClient_ContainerList_Call struct { + *mock.Call +} + +// ContainerList is a helper method to define mock.On call +// - ctx context.Context +// - options container.ListOptions +func (_e *MockAPIClient_Expecter) ContainerList(ctx any, options any) *MockAPIClient_ContainerList_Call { + return &MockAPIClient_ContainerList_Call{Call: _e.mock.On("ContainerList", ctx, options)} +} + +func (_c *MockAPIClient_ContainerList_Call) Run(run func(ctx context.Context, options container.ListOptions)) *MockAPIClient_ContainerList_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 container.ListOptions + if args[1] != nil { + arg1 = args[1].(container.ListOptions) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockAPIClient_ContainerList_Call) Return(summarys []container.Summary, err error) *MockAPIClient_ContainerList_Call { + _c.Call.Return(summarys, err) + return _c +} + +func (_c *MockAPIClient_ContainerList_Call) RunAndReturn(run func(ctx context.Context, options container.ListOptions) ([]container.Summary, error)) *MockAPIClient_ContainerList_Call { + _c.Call.Return(run) + return _c +} + +// ContainerLogs provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ContainerLogs(ctx context.Context, container1 string, options container.LogsOptions) (io.ReadCloser, error) { + ret := _mock.Called(ctx, container1, options) + + if len(ret) == 0 { + panic("no return value specified for ContainerLogs") + } + + var r0 io.ReadCloser + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, container.LogsOptions) (io.ReadCloser, error)); ok { + return returnFunc(ctx, container1, options) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, string, container.LogsOptions) io.ReadCloser); ok { + r0 = returnFunc(ctx, container1, options) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(io.ReadCloser) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, string, container.LogsOptions) error); ok { + r1 = returnFunc(ctx, container1, options) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_ContainerLogs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ContainerLogs' +type MockAPIClient_ContainerLogs_Call struct { + *mock.Call +} + +// ContainerLogs is a helper method to define mock.On call +// - ctx context.Context +// - container1 string +// - options container.LogsOptions +func (_e *MockAPIClient_Expecter) ContainerLogs(ctx any, container1 any, options any) *MockAPIClient_ContainerLogs_Call { + return &MockAPIClient_ContainerLogs_Call{Call: _e.mock.On("ContainerLogs", ctx, container1, options)} +} + +func (_c *MockAPIClient_ContainerLogs_Call) Run(run func(ctx context.Context, container1 string, options container.LogsOptions)) *MockAPIClient_ContainerLogs_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 container.LogsOptions + if args[2] != nil { + arg2 = args[2].(container.LogsOptions) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockAPIClient_ContainerLogs_Call) Return(readCloser io.ReadCloser, err error) *MockAPIClient_ContainerLogs_Call { + _c.Call.Return(readCloser, err) + return _c +} + +func (_c *MockAPIClient_ContainerLogs_Call) RunAndReturn(run func(ctx context.Context, container1 string, options container.LogsOptions) (io.ReadCloser, error)) *MockAPIClient_ContainerLogs_Call { + _c.Call.Return(run) + return _c +} + +// ContainerPause provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ContainerPause(ctx context.Context, container1 string) error { + ret := _mock.Called(ctx, container1) + + if len(ret) == 0 { + panic("no return value specified for ContainerPause") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = returnFunc(ctx, container1) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockAPIClient_ContainerPause_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ContainerPause' +type MockAPIClient_ContainerPause_Call struct { + *mock.Call +} + +// ContainerPause is a helper method to define mock.On call +// - ctx context.Context +// - container1 string +func (_e *MockAPIClient_Expecter) ContainerPause(ctx any, container1 any) *MockAPIClient_ContainerPause_Call { + return &MockAPIClient_ContainerPause_Call{Call: _e.mock.On("ContainerPause", ctx, container1)} +} + +func (_c *MockAPIClient_ContainerPause_Call) Run(run func(ctx context.Context, container1 string)) *MockAPIClient_ContainerPause_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockAPIClient_ContainerPause_Call) Return(err error) *MockAPIClient_ContainerPause_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockAPIClient_ContainerPause_Call) RunAndReturn(run func(ctx context.Context, container1 string) error) *MockAPIClient_ContainerPause_Call { + _c.Call.Return(run) + return _c +} + +// ContainerRemove provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ContainerRemove(ctx context.Context, container1 string, options container.RemoveOptions) error { + ret := _mock.Called(ctx, container1, options) + + if len(ret) == 0 { + panic("no return value specified for ContainerRemove") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, container.RemoveOptions) error); ok { + r0 = returnFunc(ctx, container1, options) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockAPIClient_ContainerRemove_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ContainerRemove' +type MockAPIClient_ContainerRemove_Call struct { + *mock.Call +} + +// ContainerRemove is a helper method to define mock.On call +// - ctx context.Context +// - container1 string +// - options container.RemoveOptions +func (_e *MockAPIClient_Expecter) ContainerRemove(ctx any, container1 any, options any) *MockAPIClient_ContainerRemove_Call { + return &MockAPIClient_ContainerRemove_Call{Call: _e.mock.On("ContainerRemove", ctx, container1, options)} +} + +func (_c *MockAPIClient_ContainerRemove_Call) Run(run func(ctx context.Context, container1 string, options container.RemoveOptions)) *MockAPIClient_ContainerRemove_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 container.RemoveOptions + if args[2] != nil { + arg2 = args[2].(container.RemoveOptions) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockAPIClient_ContainerRemove_Call) Return(err error) *MockAPIClient_ContainerRemove_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockAPIClient_ContainerRemove_Call) RunAndReturn(run func(ctx context.Context, container1 string, options container.RemoveOptions) error) *MockAPIClient_ContainerRemove_Call { + _c.Call.Return(run) + return _c +} + +// ContainerRename provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ContainerRename(ctx context.Context, container1 string, newContainerName string) error { + ret := _mock.Called(ctx, container1, newContainerName) + + if len(ret) == 0 { + panic("no return value specified for ContainerRename") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) error); ok { + r0 = returnFunc(ctx, container1, newContainerName) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockAPIClient_ContainerRename_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ContainerRename' +type MockAPIClient_ContainerRename_Call struct { + *mock.Call +} + +// ContainerRename is a helper method to define mock.On call +// - ctx context.Context +// - container1 string +// - newContainerName string +func (_e *MockAPIClient_Expecter) ContainerRename(ctx any, container1 any, newContainerName any) *MockAPIClient_ContainerRename_Call { + return &MockAPIClient_ContainerRename_Call{Call: _e.mock.On("ContainerRename", ctx, container1, newContainerName)} +} + +func (_c *MockAPIClient_ContainerRename_Call) Run(run func(ctx context.Context, container1 string, newContainerName string)) *MockAPIClient_ContainerRename_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 string + if args[2] != nil { + arg2 = args[2].(string) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockAPIClient_ContainerRename_Call) Return(err error) *MockAPIClient_ContainerRename_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockAPIClient_ContainerRename_Call) RunAndReturn(run func(ctx context.Context, container1 string, newContainerName string) error) *MockAPIClient_ContainerRename_Call { + _c.Call.Return(run) + return _c +} + +// ContainerResize provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ContainerResize(ctx context.Context, container1 string, options container.ResizeOptions) error { + ret := _mock.Called(ctx, container1, options) + + if len(ret) == 0 { + panic("no return value specified for ContainerResize") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, container.ResizeOptions) error); ok { + r0 = returnFunc(ctx, container1, options) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockAPIClient_ContainerResize_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ContainerResize' +type MockAPIClient_ContainerResize_Call struct { + *mock.Call +} + +// ContainerResize is a helper method to define mock.On call +// - ctx context.Context +// - container1 string +// - options container.ResizeOptions +func (_e *MockAPIClient_Expecter) ContainerResize(ctx any, container1 any, options any) *MockAPIClient_ContainerResize_Call { + return &MockAPIClient_ContainerResize_Call{Call: _e.mock.On("ContainerResize", ctx, container1, options)} +} + +func (_c *MockAPIClient_ContainerResize_Call) Run(run func(ctx context.Context, container1 string, options container.ResizeOptions)) *MockAPIClient_ContainerResize_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 container.ResizeOptions + if args[2] != nil { + arg2 = args[2].(container.ResizeOptions) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockAPIClient_ContainerResize_Call) Return(err error) *MockAPIClient_ContainerResize_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockAPIClient_ContainerResize_Call) RunAndReturn(run func(ctx context.Context, container1 string, options container.ResizeOptions) error) *MockAPIClient_ContainerResize_Call { + _c.Call.Return(run) + return _c +} + +// ContainerRestart provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ContainerRestart(ctx context.Context, container1 string, options container.StopOptions) error { + ret := _mock.Called(ctx, container1, options) + + if len(ret) == 0 { + panic("no return value specified for ContainerRestart") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, container.StopOptions) error); ok { + r0 = returnFunc(ctx, container1, options) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockAPIClient_ContainerRestart_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ContainerRestart' +type MockAPIClient_ContainerRestart_Call struct { + *mock.Call +} + +// ContainerRestart is a helper method to define mock.On call +// - ctx context.Context +// - container1 string +// - options container.StopOptions +func (_e *MockAPIClient_Expecter) ContainerRestart(ctx any, container1 any, options any) *MockAPIClient_ContainerRestart_Call { + return &MockAPIClient_ContainerRestart_Call{Call: _e.mock.On("ContainerRestart", ctx, container1, options)} +} + +func (_c *MockAPIClient_ContainerRestart_Call) Run(run func(ctx context.Context, container1 string, options container.StopOptions)) *MockAPIClient_ContainerRestart_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 container.StopOptions + if args[2] != nil { + arg2 = args[2].(container.StopOptions) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockAPIClient_ContainerRestart_Call) Return(err error) *MockAPIClient_ContainerRestart_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockAPIClient_ContainerRestart_Call) RunAndReturn(run func(ctx context.Context, container1 string, options container.StopOptions) error) *MockAPIClient_ContainerRestart_Call { + _c.Call.Return(run) + return _c +} + +// ContainerStart provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ContainerStart(ctx context.Context, container1 string, options container.StartOptions) error { + ret := _mock.Called(ctx, container1, options) + + if len(ret) == 0 { + panic("no return value specified for ContainerStart") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, container.StartOptions) error); ok { + r0 = returnFunc(ctx, container1, options) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockAPIClient_ContainerStart_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ContainerStart' +type MockAPIClient_ContainerStart_Call struct { + *mock.Call +} + +// ContainerStart is a helper method to define mock.On call +// - ctx context.Context +// - container1 string +// - options container.StartOptions +func (_e *MockAPIClient_Expecter) ContainerStart(ctx any, container1 any, options any) *MockAPIClient_ContainerStart_Call { + return &MockAPIClient_ContainerStart_Call{Call: _e.mock.On("ContainerStart", ctx, container1, options)} +} + +func (_c *MockAPIClient_ContainerStart_Call) Run(run func(ctx context.Context, container1 string, options container.StartOptions)) *MockAPIClient_ContainerStart_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 container.StartOptions + if args[2] != nil { + arg2 = args[2].(container.StartOptions) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockAPIClient_ContainerStart_Call) Return(err error) *MockAPIClient_ContainerStart_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockAPIClient_ContainerStart_Call) RunAndReturn(run func(ctx context.Context, container1 string, options container.StartOptions) error) *MockAPIClient_ContainerStart_Call { + _c.Call.Return(run) + return _c +} + +// ContainerStatPath provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ContainerStatPath(ctx context.Context, container1 string, path string) (container.PathStat, error) { + ret := _mock.Called(ctx, container1, path) + + if len(ret) == 0 { + panic("no return value specified for ContainerStatPath") + } + + var r0 container.PathStat + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) (container.PathStat, error)); ok { + return returnFunc(ctx, container1, path) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) container.PathStat); ok { + r0 = returnFunc(ctx, container1, path) + } else { + r0 = ret.Get(0).(container.PathStat) + } + if returnFunc, ok := ret.Get(1).(func(context.Context, string, string) error); ok { + r1 = returnFunc(ctx, container1, path) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_ContainerStatPath_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ContainerStatPath' +type MockAPIClient_ContainerStatPath_Call struct { + *mock.Call +} + +// ContainerStatPath is a helper method to define mock.On call +// - ctx context.Context +// - container1 string +// - path string +func (_e *MockAPIClient_Expecter) ContainerStatPath(ctx any, container1 any, path any) *MockAPIClient_ContainerStatPath_Call { + return &MockAPIClient_ContainerStatPath_Call{Call: _e.mock.On("ContainerStatPath", ctx, container1, path)} +} + +func (_c *MockAPIClient_ContainerStatPath_Call) Run(run func(ctx context.Context, container1 string, path string)) *MockAPIClient_ContainerStatPath_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 string + if args[2] != nil { + arg2 = args[2].(string) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockAPIClient_ContainerStatPath_Call) Return(pathStat container.PathStat, err error) *MockAPIClient_ContainerStatPath_Call { + _c.Call.Return(pathStat, err) + return _c +} + +func (_c *MockAPIClient_ContainerStatPath_Call) RunAndReturn(run func(ctx context.Context, container1 string, path string) (container.PathStat, error)) *MockAPIClient_ContainerStatPath_Call { + _c.Call.Return(run) + return _c +} + +// ContainerStats provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ContainerStats(ctx context.Context, container1 string, stream bool) (container.StatsResponseReader, error) { + ret := _mock.Called(ctx, container1, stream) + + if len(ret) == 0 { + panic("no return value specified for ContainerStats") + } + + var r0 container.StatsResponseReader + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, bool) (container.StatsResponseReader, error)); ok { + return returnFunc(ctx, container1, stream) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, string, bool) container.StatsResponseReader); ok { + r0 = returnFunc(ctx, container1, stream) + } else { + r0 = ret.Get(0).(container.StatsResponseReader) + } + if returnFunc, ok := ret.Get(1).(func(context.Context, string, bool) error); ok { + r1 = returnFunc(ctx, container1, stream) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_ContainerStats_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ContainerStats' +type MockAPIClient_ContainerStats_Call struct { + *mock.Call +} + +// ContainerStats is a helper method to define mock.On call +// - ctx context.Context +// - container1 string +// - stream bool +func (_e *MockAPIClient_Expecter) ContainerStats(ctx any, container1 any, stream any) *MockAPIClient_ContainerStats_Call { + return &MockAPIClient_ContainerStats_Call{Call: _e.mock.On("ContainerStats", ctx, container1, stream)} +} + +func (_c *MockAPIClient_ContainerStats_Call) Run(run func(ctx context.Context, container1 string, stream bool)) *MockAPIClient_ContainerStats_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 bool + if args[2] != nil { + arg2 = args[2].(bool) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockAPIClient_ContainerStats_Call) Return(statsResponseReader container.StatsResponseReader, err error) *MockAPIClient_ContainerStats_Call { + _c.Call.Return(statsResponseReader, err) + return _c +} + +func (_c *MockAPIClient_ContainerStats_Call) RunAndReturn(run func(ctx context.Context, container1 string, stream bool) (container.StatsResponseReader, error)) *MockAPIClient_ContainerStats_Call { + _c.Call.Return(run) + return _c +} + +// ContainerStatsOneShot provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ContainerStatsOneShot(ctx context.Context, container1 string) (container.StatsResponseReader, error) { + ret := _mock.Called(ctx, container1) + + if len(ret) == 0 { + panic("no return value specified for ContainerStatsOneShot") + } + + var r0 container.StatsResponseReader + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string) (container.StatsResponseReader, error)); ok { + return returnFunc(ctx, container1) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, string) container.StatsResponseReader); ok { + r0 = returnFunc(ctx, container1) + } else { + r0 = ret.Get(0).(container.StatsResponseReader) + } + if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = returnFunc(ctx, container1) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_ContainerStatsOneShot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ContainerStatsOneShot' +type MockAPIClient_ContainerStatsOneShot_Call struct { + *mock.Call +} + +// ContainerStatsOneShot is a helper method to define mock.On call +// - ctx context.Context +// - container1 string +func (_e *MockAPIClient_Expecter) ContainerStatsOneShot(ctx any, container1 any) *MockAPIClient_ContainerStatsOneShot_Call { + return &MockAPIClient_ContainerStatsOneShot_Call{Call: _e.mock.On("ContainerStatsOneShot", ctx, container1)} +} + +func (_c *MockAPIClient_ContainerStatsOneShot_Call) Run(run func(ctx context.Context, container1 string)) *MockAPIClient_ContainerStatsOneShot_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockAPIClient_ContainerStatsOneShot_Call) Return(statsResponseReader container.StatsResponseReader, err error) *MockAPIClient_ContainerStatsOneShot_Call { + _c.Call.Return(statsResponseReader, err) + return _c +} + +func (_c *MockAPIClient_ContainerStatsOneShot_Call) RunAndReturn(run func(ctx context.Context, container1 string) (container.StatsResponseReader, error)) *MockAPIClient_ContainerStatsOneShot_Call { + _c.Call.Return(run) + return _c +} + +// ContainerStop provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ContainerStop(ctx context.Context, container1 string, options container.StopOptions) error { + ret := _mock.Called(ctx, container1, options) + + if len(ret) == 0 { + panic("no return value specified for ContainerStop") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, container.StopOptions) error); ok { + r0 = returnFunc(ctx, container1, options) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockAPIClient_ContainerStop_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ContainerStop' +type MockAPIClient_ContainerStop_Call struct { + *mock.Call +} + +// ContainerStop is a helper method to define mock.On call +// - ctx context.Context +// - container1 string +// - options container.StopOptions +func (_e *MockAPIClient_Expecter) ContainerStop(ctx any, container1 any, options any) *MockAPIClient_ContainerStop_Call { + return &MockAPIClient_ContainerStop_Call{Call: _e.mock.On("ContainerStop", ctx, container1, options)} +} + +func (_c *MockAPIClient_ContainerStop_Call) Run(run func(ctx context.Context, container1 string, options container.StopOptions)) *MockAPIClient_ContainerStop_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 container.StopOptions + if args[2] != nil { + arg2 = args[2].(container.StopOptions) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockAPIClient_ContainerStop_Call) Return(err error) *MockAPIClient_ContainerStop_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockAPIClient_ContainerStop_Call) RunAndReturn(run func(ctx context.Context, container1 string, options container.StopOptions) error) *MockAPIClient_ContainerStop_Call { + _c.Call.Return(run) + return _c +} + +// ContainerTop provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ContainerTop(ctx context.Context, container1 string, arguments []string) (container.TopResponse, error) { + ret := _mock.Called(ctx, container1, arguments) + + if len(ret) == 0 { + panic("no return value specified for ContainerTop") + } + + var r0 container.TopResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, []string) (container.TopResponse, error)); ok { + return returnFunc(ctx, container1, arguments) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, string, []string) container.TopResponse); ok { + r0 = returnFunc(ctx, container1, arguments) + } else { + r0 = ret.Get(0).(container.TopResponse) + } + if returnFunc, ok := ret.Get(1).(func(context.Context, string, []string) error); ok { + r1 = returnFunc(ctx, container1, arguments) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_ContainerTop_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ContainerTop' +type MockAPIClient_ContainerTop_Call struct { + *mock.Call +} + +// ContainerTop is a helper method to define mock.On call +// - ctx context.Context +// - container1 string +// - arguments []string +func (_e *MockAPIClient_Expecter) ContainerTop(ctx any, container1 any, arguments any) *MockAPIClient_ContainerTop_Call { + return &MockAPIClient_ContainerTop_Call{Call: _e.mock.On("ContainerTop", ctx, container1, arguments)} +} + +func (_c *MockAPIClient_ContainerTop_Call) Run(run func(ctx context.Context, container1 string, arguments []string)) *MockAPIClient_ContainerTop_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 []string + if args[2] != nil { + arg2 = args[2].([]string) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockAPIClient_ContainerTop_Call) Return(topResponse container.TopResponse, err error) *MockAPIClient_ContainerTop_Call { + _c.Call.Return(topResponse, err) + return _c +} + +func (_c *MockAPIClient_ContainerTop_Call) RunAndReturn(run func(ctx context.Context, container1 string, arguments []string) (container.TopResponse, error)) *MockAPIClient_ContainerTop_Call { + _c.Call.Return(run) + return _c +} + +// ContainerUnpause provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ContainerUnpause(ctx context.Context, container1 string) error { + ret := _mock.Called(ctx, container1) + + if len(ret) == 0 { + panic("no return value specified for ContainerUnpause") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = returnFunc(ctx, container1) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockAPIClient_ContainerUnpause_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ContainerUnpause' +type MockAPIClient_ContainerUnpause_Call struct { + *mock.Call +} + +// ContainerUnpause is a helper method to define mock.On call +// - ctx context.Context +// - container1 string +func (_e *MockAPIClient_Expecter) ContainerUnpause(ctx any, container1 any) *MockAPIClient_ContainerUnpause_Call { + return &MockAPIClient_ContainerUnpause_Call{Call: _e.mock.On("ContainerUnpause", ctx, container1)} +} + +func (_c *MockAPIClient_ContainerUnpause_Call) Run(run func(ctx context.Context, container1 string)) *MockAPIClient_ContainerUnpause_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockAPIClient_ContainerUnpause_Call) Return(err error) *MockAPIClient_ContainerUnpause_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockAPIClient_ContainerUnpause_Call) RunAndReturn(run func(ctx context.Context, container1 string) error) *MockAPIClient_ContainerUnpause_Call { + _c.Call.Return(run) + return _c +} + +// ContainerUpdate provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ContainerUpdate(ctx context.Context, container1 string, updateConfig container.UpdateConfig) (container.UpdateResponse, error) { + ret := _mock.Called(ctx, container1, updateConfig) + + if len(ret) == 0 { + panic("no return value specified for ContainerUpdate") + } + + var r0 container.UpdateResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, container.UpdateConfig) (container.UpdateResponse, error)); ok { + return returnFunc(ctx, container1, updateConfig) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, string, container.UpdateConfig) container.UpdateResponse); ok { + r0 = returnFunc(ctx, container1, updateConfig) + } else { + r0 = ret.Get(0).(container.UpdateResponse) + } + if returnFunc, ok := ret.Get(1).(func(context.Context, string, container.UpdateConfig) error); ok { + r1 = returnFunc(ctx, container1, updateConfig) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_ContainerUpdate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ContainerUpdate' +type MockAPIClient_ContainerUpdate_Call struct { + *mock.Call +} + +// ContainerUpdate is a helper method to define mock.On call +// - ctx context.Context +// - container1 string +// - updateConfig container.UpdateConfig +func (_e *MockAPIClient_Expecter) ContainerUpdate(ctx any, container1 any, updateConfig any) *MockAPIClient_ContainerUpdate_Call { + return &MockAPIClient_ContainerUpdate_Call{Call: _e.mock.On("ContainerUpdate", ctx, container1, updateConfig)} +} + +func (_c *MockAPIClient_ContainerUpdate_Call) Run(run func(ctx context.Context, container1 string, updateConfig container.UpdateConfig)) *MockAPIClient_ContainerUpdate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 container.UpdateConfig + if args[2] != nil { + arg2 = args[2].(container.UpdateConfig) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockAPIClient_ContainerUpdate_Call) Return(updateResponse container.UpdateResponse, err error) *MockAPIClient_ContainerUpdate_Call { + _c.Call.Return(updateResponse, err) + return _c +} + +func (_c *MockAPIClient_ContainerUpdate_Call) RunAndReturn(run func(ctx context.Context, container1 string, updateConfig container.UpdateConfig) (container.UpdateResponse, error)) *MockAPIClient_ContainerUpdate_Call { + _c.Call.Return(run) + return _c +} + +// ContainerWait provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ContainerWait(ctx context.Context, container1 string, condition container.WaitCondition) (<-chan container.WaitResponse, <-chan error) { + ret := _mock.Called(ctx, container1, condition) + + if len(ret) == 0 { + panic("no return value specified for ContainerWait") + } + + var r0 <-chan container.WaitResponse + var r1 <-chan error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, container.WaitCondition) (<-chan container.WaitResponse, <-chan error)); ok { + return returnFunc(ctx, container1, condition) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, string, container.WaitCondition) <-chan container.WaitResponse); ok { + r0 = returnFunc(ctx, container1, condition) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(<-chan container.WaitResponse) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, string, container.WaitCondition) <-chan error); ok { + r1 = returnFunc(ctx, container1, condition) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(<-chan error) + } + } + return r0, r1 +} + +// MockAPIClient_ContainerWait_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ContainerWait' +type MockAPIClient_ContainerWait_Call struct { + *mock.Call +} + +// ContainerWait is a helper method to define mock.On call +// - ctx context.Context +// - container1 string +// - condition container.WaitCondition +func (_e *MockAPIClient_Expecter) ContainerWait(ctx any, container1 any, condition any) *MockAPIClient_ContainerWait_Call { + return &MockAPIClient_ContainerWait_Call{Call: _e.mock.On("ContainerWait", ctx, container1, condition)} +} + +func (_c *MockAPIClient_ContainerWait_Call) Run(run func(ctx context.Context, container1 string, condition container.WaitCondition)) *MockAPIClient_ContainerWait_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 container.WaitCondition + if args[2] != nil { + arg2 = args[2].(container.WaitCondition) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockAPIClient_ContainerWait_Call) Return(waitResponseCh <-chan container.WaitResponse, errCh <-chan error) *MockAPIClient_ContainerWait_Call { + _c.Call.Return(waitResponseCh, errCh) + return _c +} + +func (_c *MockAPIClient_ContainerWait_Call) RunAndReturn(run func(ctx context.Context, container1 string, condition container.WaitCondition) (<-chan container.WaitResponse, <-chan error)) *MockAPIClient_ContainerWait_Call { + _c.Call.Return(run) + return _c +} + +// ContainersPrune provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ContainersPrune(ctx context.Context, pruneFilters filters.Args) (container.PruneReport, error) { + ret := _mock.Called(ctx, pruneFilters) + + if len(ret) == 0 { + panic("no return value specified for ContainersPrune") + } + + var r0 container.PruneReport + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, filters.Args) (container.PruneReport, error)); ok { + return returnFunc(ctx, pruneFilters) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, filters.Args) container.PruneReport); ok { + r0 = returnFunc(ctx, pruneFilters) + } else { + r0 = ret.Get(0).(container.PruneReport) + } + if returnFunc, ok := ret.Get(1).(func(context.Context, filters.Args) error); ok { + r1 = returnFunc(ctx, pruneFilters) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_ContainersPrune_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ContainersPrune' +type MockAPIClient_ContainersPrune_Call struct { + *mock.Call +} + +// ContainersPrune is a helper method to define mock.On call +// - ctx context.Context +// - pruneFilters filters.Args +func (_e *MockAPIClient_Expecter) ContainersPrune(ctx any, pruneFilters any) *MockAPIClient_ContainersPrune_Call { + return &MockAPIClient_ContainersPrune_Call{Call: _e.mock.On("ContainersPrune", ctx, pruneFilters)} +} + +func (_c *MockAPIClient_ContainersPrune_Call) Run(run func(ctx context.Context, pruneFilters filters.Args)) *MockAPIClient_ContainersPrune_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 filters.Args + if args[1] != nil { + arg1 = args[1].(filters.Args) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockAPIClient_ContainersPrune_Call) Return(pruneReport container.PruneReport, err error) *MockAPIClient_ContainersPrune_Call { + _c.Call.Return(pruneReport, err) + return _c +} + +func (_c *MockAPIClient_ContainersPrune_Call) RunAndReturn(run func(ctx context.Context, pruneFilters filters.Args) (container.PruneReport, error)) *MockAPIClient_ContainersPrune_Call { + _c.Call.Return(run) + return _c +} + +// CopyFromContainer provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) CopyFromContainer(ctx context.Context, container1 string, srcPath string) (io.ReadCloser, container.PathStat, error) { + ret := _mock.Called(ctx, container1, srcPath) + + if len(ret) == 0 { + panic("no return value specified for CopyFromContainer") + } + + var r0 io.ReadCloser + var r1 container.PathStat + var r2 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) (io.ReadCloser, container.PathStat, error)); ok { + return returnFunc(ctx, container1, srcPath) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) io.ReadCloser); ok { + r0 = returnFunc(ctx, container1, srcPath) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(io.ReadCloser) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, string, string) container.PathStat); ok { + r1 = returnFunc(ctx, container1, srcPath) + } else { + r1 = ret.Get(1).(container.PathStat) + } + if returnFunc, ok := ret.Get(2).(func(context.Context, string, string) error); ok { + r2 = returnFunc(ctx, container1, srcPath) + } else { + r2 = ret.Error(2) + } + return r0, r1, r2 +} + +// MockAPIClient_CopyFromContainer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CopyFromContainer' +type MockAPIClient_CopyFromContainer_Call struct { + *mock.Call +} + +// CopyFromContainer is a helper method to define mock.On call +// - ctx context.Context +// - container1 string +// - srcPath string +func (_e *MockAPIClient_Expecter) CopyFromContainer(ctx any, container1 any, srcPath any) *MockAPIClient_CopyFromContainer_Call { + return &MockAPIClient_CopyFromContainer_Call{Call: _e.mock.On("CopyFromContainer", ctx, container1, srcPath)} +} + +func (_c *MockAPIClient_CopyFromContainer_Call) Run(run func(ctx context.Context, container1 string, srcPath string)) *MockAPIClient_CopyFromContainer_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 string + if args[2] != nil { + arg2 = args[2].(string) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockAPIClient_CopyFromContainer_Call) Return(readCloser io.ReadCloser, pathStat container.PathStat, err error) *MockAPIClient_CopyFromContainer_Call { + _c.Call.Return(readCloser, pathStat, err) + return _c +} + +func (_c *MockAPIClient_CopyFromContainer_Call) RunAndReturn(run func(ctx context.Context, container1 string, srcPath string) (io.ReadCloser, container.PathStat, error)) *MockAPIClient_CopyFromContainer_Call { + _c.Call.Return(run) + return _c +} + +// CopyToContainer provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) CopyToContainer(ctx context.Context, container1 string, path string, content io.Reader, options container.CopyToContainerOptions) error { + ret := _mock.Called(ctx, container1, path, content, options) + + if len(ret) == 0 { + panic("no return value specified for CopyToContainer") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, io.Reader, container.CopyToContainerOptions) error); ok { + r0 = returnFunc(ctx, container1, path, content, options) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockAPIClient_CopyToContainer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CopyToContainer' +type MockAPIClient_CopyToContainer_Call struct { + *mock.Call +} + +// CopyToContainer is a helper method to define mock.On call +// - ctx context.Context +// - container1 string +// - path string +// - content io.Reader +// - options container.CopyToContainerOptions +func (_e *MockAPIClient_Expecter) CopyToContainer(ctx any, container1 any, path any, content any, options any) *MockAPIClient_CopyToContainer_Call { + return &MockAPIClient_CopyToContainer_Call{Call: _e.mock.On("CopyToContainer", ctx, container1, path, content, options)} +} + +func (_c *MockAPIClient_CopyToContainer_Call) Run(run func(ctx context.Context, container1 string, path string, content io.Reader, options container.CopyToContainerOptions)) *MockAPIClient_CopyToContainer_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 string + if args[2] != nil { + arg2 = args[2].(string) + } + var arg3 io.Reader + if args[3] != nil { + arg3 = args[3].(io.Reader) + } + var arg4 container.CopyToContainerOptions + if args[4] != nil { + arg4 = args[4].(container.CopyToContainerOptions) + } + run( + arg0, + arg1, + arg2, + arg3, + arg4, + ) + }) + return _c +} + +func (_c *MockAPIClient_CopyToContainer_Call) Return(err error) *MockAPIClient_CopyToContainer_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockAPIClient_CopyToContainer_Call) RunAndReturn(run func(ctx context.Context, container1 string, path string, content io.Reader, options container.CopyToContainerOptions) error) *MockAPIClient_CopyToContainer_Call { + _c.Call.Return(run) + return _c +} + +// DaemonHost provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) DaemonHost() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for DaemonHost") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// MockAPIClient_DaemonHost_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DaemonHost' +type MockAPIClient_DaemonHost_Call struct { + *mock.Call +} + +// DaemonHost is a helper method to define mock.On call +func (_e *MockAPIClient_Expecter) DaemonHost() *MockAPIClient_DaemonHost_Call { + return &MockAPIClient_DaemonHost_Call{Call: _e.mock.On("DaemonHost")} +} + +func (_c *MockAPIClient_DaemonHost_Call) Run(run func()) *MockAPIClient_DaemonHost_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockAPIClient_DaemonHost_Call) Return(s string) *MockAPIClient_DaemonHost_Call { + _c.Call.Return(s) + return _c +} + +func (_c *MockAPIClient_DaemonHost_Call) RunAndReturn(run func() string) *MockAPIClient_DaemonHost_Call { + _c.Call.Return(run) + return _c +} + +// DialHijack provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) DialHijack(ctx context.Context, url string, proto string, meta map[string][]string) (net.Conn, error) { + ret := _mock.Called(ctx, url, proto, meta) + + if len(ret) == 0 { + panic("no return value specified for DialHijack") + } + + var r0 net.Conn + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, map[string][]string) (net.Conn, error)); ok { + return returnFunc(ctx, url, proto, meta) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, map[string][]string) net.Conn); ok { + r0 = returnFunc(ctx, url, proto, meta) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(net.Conn) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, string, string, map[string][]string) error); ok { + r1 = returnFunc(ctx, url, proto, meta) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_DialHijack_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DialHijack' +type MockAPIClient_DialHijack_Call struct { + *mock.Call +} + +// DialHijack is a helper method to define mock.On call +// - ctx context.Context +// - url string +// - proto string +// - meta map[string][]string +func (_e *MockAPIClient_Expecter) DialHijack(ctx any, url any, proto any, meta any) *MockAPIClient_DialHijack_Call { + return &MockAPIClient_DialHijack_Call{Call: _e.mock.On("DialHijack", ctx, url, proto, meta)} +} + +func (_c *MockAPIClient_DialHijack_Call) Run(run func(ctx context.Context, url string, proto string, meta map[string][]string)) *MockAPIClient_DialHijack_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 string + if args[2] != nil { + arg2 = args[2].(string) + } + var arg3 map[string][]string + if args[3] != nil { + arg3 = args[3].(map[string][]string) + } + run( + arg0, + arg1, + arg2, + arg3, + ) + }) + return _c +} + +func (_c *MockAPIClient_DialHijack_Call) Return(conn net.Conn, err error) *MockAPIClient_DialHijack_Call { + _c.Call.Return(conn, err) + return _c +} + +func (_c *MockAPIClient_DialHijack_Call) RunAndReturn(run func(ctx context.Context, url string, proto string, meta map[string][]string) (net.Conn, error)) *MockAPIClient_DialHijack_Call { + _c.Call.Return(run) + return _c +} + +// Dialer provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) Dialer() func(context.Context) (net.Conn, error) { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Dialer") + } + + var r0 func(context.Context) (net.Conn, error) + if returnFunc, ok := ret.Get(0).(func() func(context.Context) (net.Conn, error)); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(func(context.Context) (net.Conn, error)) + } + } + return r0 +} + +// MockAPIClient_Dialer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Dialer' +type MockAPIClient_Dialer_Call struct { + *mock.Call +} + +// Dialer is a helper method to define mock.On call +func (_e *MockAPIClient_Expecter) Dialer() *MockAPIClient_Dialer_Call { + return &MockAPIClient_Dialer_Call{Call: _e.mock.On("Dialer")} +} + +func (_c *MockAPIClient_Dialer_Call) Run(run func()) *MockAPIClient_Dialer_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockAPIClient_Dialer_Call) Return(fn func(context.Context) (net.Conn, error)) *MockAPIClient_Dialer_Call { + _c.Call.Return(fn) + return _c +} + +func (_c *MockAPIClient_Dialer_Call) RunAndReturn(run func() func(context.Context) (net.Conn, error)) *MockAPIClient_Dialer_Call { + _c.Call.Return(run) + return _c +} + +// DiskUsage provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) DiskUsage(ctx context.Context, options types.DiskUsageOptions) (types.DiskUsage, error) { + ret := _mock.Called(ctx, options) + + if len(ret) == 0 { + panic("no return value specified for DiskUsage") + } + + var r0 types.DiskUsage + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, types.DiskUsageOptions) (types.DiskUsage, error)); ok { + return returnFunc(ctx, options) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, types.DiskUsageOptions) types.DiskUsage); ok { + r0 = returnFunc(ctx, options) + } else { + r0 = ret.Get(0).(types.DiskUsage) + } + if returnFunc, ok := ret.Get(1).(func(context.Context, types.DiskUsageOptions) error); ok { + r1 = returnFunc(ctx, options) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_DiskUsage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DiskUsage' +type MockAPIClient_DiskUsage_Call struct { + *mock.Call +} + +// DiskUsage is a helper method to define mock.On call +// - ctx context.Context +// - options types.DiskUsageOptions +func (_e *MockAPIClient_Expecter) DiskUsage(ctx any, options any) *MockAPIClient_DiskUsage_Call { + return &MockAPIClient_DiskUsage_Call{Call: _e.mock.On("DiskUsage", ctx, options)} +} + +func (_c *MockAPIClient_DiskUsage_Call) Run(run func(ctx context.Context, options types.DiskUsageOptions)) *MockAPIClient_DiskUsage_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 types.DiskUsageOptions + if args[1] != nil { + arg1 = args[1].(types.DiskUsageOptions) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockAPIClient_DiskUsage_Call) Return(diskUsage types.DiskUsage, err error) *MockAPIClient_DiskUsage_Call { + _c.Call.Return(diskUsage, err) + return _c +} + +func (_c *MockAPIClient_DiskUsage_Call) RunAndReturn(run func(ctx context.Context, options types.DiskUsageOptions) (types.DiskUsage, error)) *MockAPIClient_DiskUsage_Call { + _c.Call.Return(run) + return _c +} + +// DistributionInspect provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) DistributionInspect(ctx context.Context, image string, encodedRegistryAuth string) (registry.DistributionInspect, error) { + ret := _mock.Called(ctx, image, encodedRegistryAuth) + + if len(ret) == 0 { + panic("no return value specified for DistributionInspect") + } + + var r0 registry.DistributionInspect + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) (registry.DistributionInspect, error)); ok { + return returnFunc(ctx, image, encodedRegistryAuth) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) registry.DistributionInspect); ok { + r0 = returnFunc(ctx, image, encodedRegistryAuth) + } else { + r0 = ret.Get(0).(registry.DistributionInspect) + } + if returnFunc, ok := ret.Get(1).(func(context.Context, string, string) error); ok { + r1 = returnFunc(ctx, image, encodedRegistryAuth) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_DistributionInspect_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DistributionInspect' +type MockAPIClient_DistributionInspect_Call struct { + *mock.Call +} + +// DistributionInspect is a helper method to define mock.On call +// - ctx context.Context +// - image string +// - encodedRegistryAuth string +func (_e *MockAPIClient_Expecter) DistributionInspect(ctx any, image any, encodedRegistryAuth any) *MockAPIClient_DistributionInspect_Call { + return &MockAPIClient_DistributionInspect_Call{Call: _e.mock.On("DistributionInspect", ctx, image, encodedRegistryAuth)} +} + +func (_c *MockAPIClient_DistributionInspect_Call) Run(run func(ctx context.Context, image string, encodedRegistryAuth string)) *MockAPIClient_DistributionInspect_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 string + if args[2] != nil { + arg2 = args[2].(string) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockAPIClient_DistributionInspect_Call) Return(distributionInspect registry.DistributionInspect, err error) *MockAPIClient_DistributionInspect_Call { + _c.Call.Return(distributionInspect, err) + return _c +} + +func (_c *MockAPIClient_DistributionInspect_Call) RunAndReturn(run func(ctx context.Context, image string, encodedRegistryAuth string) (registry.DistributionInspect, error)) *MockAPIClient_DistributionInspect_Call { + _c.Call.Return(run) + return _c +} + +// Events provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) Events(ctx context.Context, options events.ListOptions) (<-chan events.Message, <-chan error) { + ret := _mock.Called(ctx, options) + + if len(ret) == 0 { + panic("no return value specified for Events") + } + + var r0 <-chan events.Message + var r1 <-chan error + if returnFunc, ok := ret.Get(0).(func(context.Context, events.ListOptions) (<-chan events.Message, <-chan error)); ok { + return returnFunc(ctx, options) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, events.ListOptions) <-chan events.Message); ok { + r0 = returnFunc(ctx, options) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(<-chan events.Message) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, events.ListOptions) <-chan error); ok { + r1 = returnFunc(ctx, options) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(<-chan error) + } + } + return r0, r1 +} + +// MockAPIClient_Events_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Events' +type MockAPIClient_Events_Call struct { + *mock.Call +} + +// Events is a helper method to define mock.On call +// - ctx context.Context +// - options events.ListOptions +func (_e *MockAPIClient_Expecter) Events(ctx any, options any) *MockAPIClient_Events_Call { + return &MockAPIClient_Events_Call{Call: _e.mock.On("Events", ctx, options)} +} + +func (_c *MockAPIClient_Events_Call) Run(run func(ctx context.Context, options events.ListOptions)) *MockAPIClient_Events_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 events.ListOptions + if args[1] != nil { + arg1 = args[1].(events.ListOptions) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockAPIClient_Events_Call) Return(messageCh <-chan events.Message, errCh <-chan error) *MockAPIClient_Events_Call { + _c.Call.Return(messageCh, errCh) + return _c +} + +func (_c *MockAPIClient_Events_Call) RunAndReturn(run func(ctx context.Context, options events.ListOptions) (<-chan events.Message, <-chan error)) *MockAPIClient_Events_Call { + _c.Call.Return(run) + return _c +} + +// HTTPClient provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) HTTPClient() *http.Client { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for HTTPClient") + } + + var r0 *http.Client + if returnFunc, ok := ret.Get(0).(func() *http.Client); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*http.Client) + } + } + return r0 +} + +// MockAPIClient_HTTPClient_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HTTPClient' +type MockAPIClient_HTTPClient_Call struct { + *mock.Call +} + +// HTTPClient is a helper method to define mock.On call +func (_e *MockAPIClient_Expecter) HTTPClient() *MockAPIClient_HTTPClient_Call { + return &MockAPIClient_HTTPClient_Call{Call: _e.mock.On("HTTPClient")} +} + +func (_c *MockAPIClient_HTTPClient_Call) Run(run func()) *MockAPIClient_HTTPClient_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockAPIClient_HTTPClient_Call) Return(client *http.Client) *MockAPIClient_HTTPClient_Call { + _c.Call.Return(client) + return _c +} + +func (_c *MockAPIClient_HTTPClient_Call) RunAndReturn(run func() *http.Client) *MockAPIClient_HTTPClient_Call { + _c.Call.Return(run) + return _c +} + +// ImageBuild provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ImageBuild(ctx context.Context, context1 io.Reader, options build.ImageBuildOptions) (build.ImageBuildResponse, error) { + ret := _mock.Called(ctx, context1, options) + + if len(ret) == 0 { + panic("no return value specified for ImageBuild") + } + + var r0 build.ImageBuildResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, io.Reader, build.ImageBuildOptions) (build.ImageBuildResponse, error)); ok { + return returnFunc(ctx, context1, options) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, io.Reader, build.ImageBuildOptions) build.ImageBuildResponse); ok { + r0 = returnFunc(ctx, context1, options) + } else { + r0 = ret.Get(0).(build.ImageBuildResponse) + } + if returnFunc, ok := ret.Get(1).(func(context.Context, io.Reader, build.ImageBuildOptions) error); ok { + r1 = returnFunc(ctx, context1, options) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_ImageBuild_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ImageBuild' +type MockAPIClient_ImageBuild_Call struct { + *mock.Call +} + +// ImageBuild is a helper method to define mock.On call +// - ctx context.Context +// - context1 io.Reader +// - options build.ImageBuildOptions +func (_e *MockAPIClient_Expecter) ImageBuild(ctx any, context1 any, options any) *MockAPIClient_ImageBuild_Call { + return &MockAPIClient_ImageBuild_Call{Call: _e.mock.On("ImageBuild", ctx, context1, options)} +} + +func (_c *MockAPIClient_ImageBuild_Call) Run(run func(ctx context.Context, context1 io.Reader, options build.ImageBuildOptions)) *MockAPIClient_ImageBuild_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 io.Reader + if args[1] != nil { + arg1 = args[1].(io.Reader) + } + var arg2 build.ImageBuildOptions + if args[2] != nil { + arg2 = args[2].(build.ImageBuildOptions) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockAPIClient_ImageBuild_Call) Return(imageBuildResponse build.ImageBuildResponse, err error) *MockAPIClient_ImageBuild_Call { + _c.Call.Return(imageBuildResponse, err) + return _c +} + +func (_c *MockAPIClient_ImageBuild_Call) RunAndReturn(run func(ctx context.Context, context1 io.Reader, options build.ImageBuildOptions) (build.ImageBuildResponse, error)) *MockAPIClient_ImageBuild_Call { + _c.Call.Return(run) + return _c +} + +// ImageCreate provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ImageCreate(ctx context.Context, parentReference string, options image.CreateOptions) (io.ReadCloser, error) { + ret := _mock.Called(ctx, parentReference, options) + + if len(ret) == 0 { + panic("no return value specified for ImageCreate") + } + + var r0 io.ReadCloser + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, image.CreateOptions) (io.ReadCloser, error)); ok { + return returnFunc(ctx, parentReference, options) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, string, image.CreateOptions) io.ReadCloser); ok { + r0 = returnFunc(ctx, parentReference, options) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(io.ReadCloser) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, string, image.CreateOptions) error); ok { + r1 = returnFunc(ctx, parentReference, options) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_ImageCreate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ImageCreate' +type MockAPIClient_ImageCreate_Call struct { + *mock.Call +} + +// ImageCreate is a helper method to define mock.On call +// - ctx context.Context +// - parentReference string +// - options image.CreateOptions +func (_e *MockAPIClient_Expecter) ImageCreate(ctx any, parentReference any, options any) *MockAPIClient_ImageCreate_Call { + return &MockAPIClient_ImageCreate_Call{Call: _e.mock.On("ImageCreate", ctx, parentReference, options)} +} + +func (_c *MockAPIClient_ImageCreate_Call) Run(run func(ctx context.Context, parentReference string, options image.CreateOptions)) *MockAPIClient_ImageCreate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 image.CreateOptions + if args[2] != nil { + arg2 = args[2].(image.CreateOptions) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockAPIClient_ImageCreate_Call) Return(readCloser io.ReadCloser, err error) *MockAPIClient_ImageCreate_Call { + _c.Call.Return(readCloser, err) + return _c +} + +func (_c *MockAPIClient_ImageCreate_Call) RunAndReturn(run func(ctx context.Context, parentReference string, options image.CreateOptions) (io.ReadCloser, error)) *MockAPIClient_ImageCreate_Call { + _c.Call.Return(run) + return _c +} + +// ImageHistory provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ImageHistory(ctx context.Context, image1 string, imageHistoryOptions ...client.ImageHistoryOption) ([]image.HistoryResponseItem, error) { + var tmpRet mock.Arguments + if len(imageHistoryOptions) > 0 { + tmpRet = _mock.Called(ctx, image1, imageHistoryOptions) + } else { + tmpRet = _mock.Called(ctx, image1) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for ImageHistory") + } + + var r0 []image.HistoryResponseItem + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, ...client.ImageHistoryOption) ([]image.HistoryResponseItem, error)); ok { + return returnFunc(ctx, image1, imageHistoryOptions...) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, string, ...client.ImageHistoryOption) []image.HistoryResponseItem); ok { + r0 = returnFunc(ctx, image1, imageHistoryOptions...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]image.HistoryResponseItem) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, string, ...client.ImageHistoryOption) error); ok { + r1 = returnFunc(ctx, image1, imageHistoryOptions...) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_ImageHistory_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ImageHistory' +type MockAPIClient_ImageHistory_Call struct { + *mock.Call +} + +// ImageHistory is a helper method to define mock.On call +// - ctx context.Context +// - image1 string +// - imageHistoryOptions ...client.ImageHistoryOption +func (_e *MockAPIClient_Expecter) ImageHistory(ctx any, image1 any, imageHistoryOptions ...any) *MockAPIClient_ImageHistory_Call { + return &MockAPIClient_ImageHistory_Call{Call: _e.mock.On("ImageHistory", + append([]any{ctx, image1}, imageHistoryOptions...)...)} +} + +func (_c *MockAPIClient_ImageHistory_Call) Run(run func(ctx context.Context, image1 string, imageHistoryOptions ...client.ImageHistoryOption)) *MockAPIClient_ImageHistory_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 []client.ImageHistoryOption + var variadicArgs []client.ImageHistoryOption + if len(args) > 2 { + variadicArgs = args[2].([]client.ImageHistoryOption) + } + arg2 = variadicArgs + run( + arg0, + arg1, + arg2..., + ) + }) + return _c +} + +func (_c *MockAPIClient_ImageHistory_Call) Return(historyResponseItems []image.HistoryResponseItem, err error) *MockAPIClient_ImageHistory_Call { + _c.Call.Return(historyResponseItems, err) + return _c +} + +func (_c *MockAPIClient_ImageHistory_Call) RunAndReturn(run func(ctx context.Context, image1 string, imageHistoryOptions ...client.ImageHistoryOption) ([]image.HistoryResponseItem, error)) *MockAPIClient_ImageHistory_Call { + _c.Call.Return(run) + return _c +} + +// ImageImport provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ImageImport(ctx context.Context, source image.ImportSource, ref string, options image.ImportOptions) (io.ReadCloser, error) { + ret := _mock.Called(ctx, source, ref, options) + + if len(ret) == 0 { + panic("no return value specified for ImageImport") + } + + var r0 io.ReadCloser + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, image.ImportSource, string, image.ImportOptions) (io.ReadCloser, error)); ok { + return returnFunc(ctx, source, ref, options) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, image.ImportSource, string, image.ImportOptions) io.ReadCloser); ok { + r0 = returnFunc(ctx, source, ref, options) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(io.ReadCloser) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, image.ImportSource, string, image.ImportOptions) error); ok { + r1 = returnFunc(ctx, source, ref, options) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_ImageImport_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ImageImport' +type MockAPIClient_ImageImport_Call struct { + *mock.Call +} + +// ImageImport is a helper method to define mock.On call +// - ctx context.Context +// - source image.ImportSource +// - ref string +// - options image.ImportOptions +func (_e *MockAPIClient_Expecter) ImageImport(ctx any, source any, ref any, options any) *MockAPIClient_ImageImport_Call { + return &MockAPIClient_ImageImport_Call{Call: _e.mock.On("ImageImport", ctx, source, ref, options)} +} + +func (_c *MockAPIClient_ImageImport_Call) Run(run func(ctx context.Context, source image.ImportSource, ref string, options image.ImportOptions)) *MockAPIClient_ImageImport_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 image.ImportSource + if args[1] != nil { + arg1 = args[1].(image.ImportSource) + } + var arg2 string + if args[2] != nil { + arg2 = args[2].(string) + } + var arg3 image.ImportOptions + if args[3] != nil { + arg3 = args[3].(image.ImportOptions) + } + run( + arg0, + arg1, + arg2, + arg3, + ) + }) + return _c +} + +func (_c *MockAPIClient_ImageImport_Call) Return(readCloser io.ReadCloser, err error) *MockAPIClient_ImageImport_Call { + _c.Call.Return(readCloser, err) + return _c +} + +func (_c *MockAPIClient_ImageImport_Call) RunAndReturn(run func(ctx context.Context, source image.ImportSource, ref string, options image.ImportOptions) (io.ReadCloser, error)) *MockAPIClient_ImageImport_Call { + _c.Call.Return(run) + return _c +} + +// ImageInspect provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ImageInspect(ctx context.Context, image1 string, imageInspectOptions ...client.ImageInspectOption) (image.InspectResponse, error) { + var tmpRet mock.Arguments + if len(imageInspectOptions) > 0 { + tmpRet = _mock.Called(ctx, image1, imageInspectOptions) + } else { + tmpRet = _mock.Called(ctx, image1) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for ImageInspect") + } + + var r0 image.InspectResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, ...client.ImageInspectOption) (image.InspectResponse, error)); ok { + return returnFunc(ctx, image1, imageInspectOptions...) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, string, ...client.ImageInspectOption) image.InspectResponse); ok { + r0 = returnFunc(ctx, image1, imageInspectOptions...) + } else { + r0 = ret.Get(0).(image.InspectResponse) + } + if returnFunc, ok := ret.Get(1).(func(context.Context, string, ...client.ImageInspectOption) error); ok { + r1 = returnFunc(ctx, image1, imageInspectOptions...) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_ImageInspect_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ImageInspect' +type MockAPIClient_ImageInspect_Call struct { + *mock.Call +} + +// ImageInspect is a helper method to define mock.On call +// - ctx context.Context +// - image1 string +// - imageInspectOptions ...client.ImageInspectOption +func (_e *MockAPIClient_Expecter) ImageInspect(ctx any, image1 any, imageInspectOptions ...any) *MockAPIClient_ImageInspect_Call { + return &MockAPIClient_ImageInspect_Call{Call: _e.mock.On("ImageInspect", + append([]any{ctx, image1}, imageInspectOptions...)...)} +} + +func (_c *MockAPIClient_ImageInspect_Call) Run(run func(ctx context.Context, image1 string, imageInspectOptions ...client.ImageInspectOption)) *MockAPIClient_ImageInspect_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 []client.ImageInspectOption + var variadicArgs []client.ImageInspectOption + if len(args) > 2 { + variadicArgs = args[2].([]client.ImageInspectOption) + } + arg2 = variadicArgs + run( + arg0, + arg1, + arg2..., + ) + }) + return _c +} + +func (_c *MockAPIClient_ImageInspect_Call) Return(inspectResponse image.InspectResponse, err error) *MockAPIClient_ImageInspect_Call { + _c.Call.Return(inspectResponse, err) + return _c +} + +func (_c *MockAPIClient_ImageInspect_Call) RunAndReturn(run func(ctx context.Context, image1 string, imageInspectOptions ...client.ImageInspectOption) (image.InspectResponse, error)) *MockAPIClient_ImageInspect_Call { + _c.Call.Return(run) + return _c +} + +// ImageInspectWithRaw provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ImageInspectWithRaw(ctx context.Context, image1 string) (image.InspectResponse, []byte, error) { + ret := _mock.Called(ctx, image1) + + if len(ret) == 0 { + panic("no return value specified for ImageInspectWithRaw") + } + + var r0 image.InspectResponse + var r1 []byte + var r2 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string) (image.InspectResponse, []byte, error)); ok { + return returnFunc(ctx, image1) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, string) image.InspectResponse); ok { + r0 = returnFunc(ctx, image1) + } else { + r0 = ret.Get(0).(image.InspectResponse) + } + if returnFunc, ok := ret.Get(1).(func(context.Context, string) []byte); ok { + r1 = returnFunc(ctx, image1) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).([]byte) + } + } + if returnFunc, ok := ret.Get(2).(func(context.Context, string) error); ok { + r2 = returnFunc(ctx, image1) + } else { + r2 = ret.Error(2) + } + return r0, r1, r2 +} + +// MockAPIClient_ImageInspectWithRaw_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ImageInspectWithRaw' +type MockAPIClient_ImageInspectWithRaw_Call struct { + *mock.Call +} + +// ImageInspectWithRaw is a helper method to define mock.On call +// - ctx context.Context +// - image1 string +func (_e *MockAPIClient_Expecter) ImageInspectWithRaw(ctx any, image1 any) *MockAPIClient_ImageInspectWithRaw_Call { + return &MockAPIClient_ImageInspectWithRaw_Call{Call: _e.mock.On("ImageInspectWithRaw", ctx, image1)} +} + +func (_c *MockAPIClient_ImageInspectWithRaw_Call) Run(run func(ctx context.Context, image1 string)) *MockAPIClient_ImageInspectWithRaw_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockAPIClient_ImageInspectWithRaw_Call) Return(inspectResponse image.InspectResponse, bytes []byte, err error) *MockAPIClient_ImageInspectWithRaw_Call { + _c.Call.Return(inspectResponse, bytes, err) + return _c +} + +func (_c *MockAPIClient_ImageInspectWithRaw_Call) RunAndReturn(run func(ctx context.Context, image1 string) (image.InspectResponse, []byte, error)) *MockAPIClient_ImageInspectWithRaw_Call { + _c.Call.Return(run) + return _c +} + +// ImageList provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ImageList(ctx context.Context, options image.ListOptions) ([]image.Summary, error) { + ret := _mock.Called(ctx, options) + + if len(ret) == 0 { + panic("no return value specified for ImageList") + } + + var r0 []image.Summary + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, image.ListOptions) ([]image.Summary, error)); ok { + return returnFunc(ctx, options) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, image.ListOptions) []image.Summary); ok { + r0 = returnFunc(ctx, options) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]image.Summary) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, image.ListOptions) error); ok { + r1 = returnFunc(ctx, options) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_ImageList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ImageList' +type MockAPIClient_ImageList_Call struct { + *mock.Call +} + +// ImageList is a helper method to define mock.On call +// - ctx context.Context +// - options image.ListOptions +func (_e *MockAPIClient_Expecter) ImageList(ctx any, options any) *MockAPIClient_ImageList_Call { + return &MockAPIClient_ImageList_Call{Call: _e.mock.On("ImageList", ctx, options)} +} + +func (_c *MockAPIClient_ImageList_Call) Run(run func(ctx context.Context, options image.ListOptions)) *MockAPIClient_ImageList_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 image.ListOptions + if args[1] != nil { + arg1 = args[1].(image.ListOptions) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockAPIClient_ImageList_Call) Return(summarys []image.Summary, err error) *MockAPIClient_ImageList_Call { + _c.Call.Return(summarys, err) + return _c +} + +func (_c *MockAPIClient_ImageList_Call) RunAndReturn(run func(ctx context.Context, options image.ListOptions) ([]image.Summary, error)) *MockAPIClient_ImageList_Call { + _c.Call.Return(run) + return _c +} + +// ImageLoad provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ImageLoad(ctx context.Context, input io.Reader, imageLoadOptions ...client.ImageLoadOption) (image.LoadResponse, error) { + var tmpRet mock.Arguments + if len(imageLoadOptions) > 0 { + tmpRet = _mock.Called(ctx, input, imageLoadOptions) + } else { + tmpRet = _mock.Called(ctx, input) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for ImageLoad") + } + + var r0 image.LoadResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, io.Reader, ...client.ImageLoadOption) (image.LoadResponse, error)); ok { + return returnFunc(ctx, input, imageLoadOptions...) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, io.Reader, ...client.ImageLoadOption) image.LoadResponse); ok { + r0 = returnFunc(ctx, input, imageLoadOptions...) + } else { + r0 = ret.Get(0).(image.LoadResponse) + } + if returnFunc, ok := ret.Get(1).(func(context.Context, io.Reader, ...client.ImageLoadOption) error); ok { + r1 = returnFunc(ctx, input, imageLoadOptions...) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_ImageLoad_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ImageLoad' +type MockAPIClient_ImageLoad_Call struct { + *mock.Call +} + +// ImageLoad is a helper method to define mock.On call +// - ctx context.Context +// - input io.Reader +// - imageLoadOptions ...client.ImageLoadOption +func (_e *MockAPIClient_Expecter) ImageLoad(ctx any, input any, imageLoadOptions ...any) *MockAPIClient_ImageLoad_Call { + return &MockAPIClient_ImageLoad_Call{Call: _e.mock.On("ImageLoad", + append([]any{ctx, input}, imageLoadOptions...)...)} +} + +func (_c *MockAPIClient_ImageLoad_Call) Run(run func(ctx context.Context, input io.Reader, imageLoadOptions ...client.ImageLoadOption)) *MockAPIClient_ImageLoad_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 io.Reader + if args[1] != nil { + arg1 = args[1].(io.Reader) + } + var arg2 []client.ImageLoadOption + var variadicArgs []client.ImageLoadOption + if len(args) > 2 { + variadicArgs = args[2].([]client.ImageLoadOption) + } + arg2 = variadicArgs + run( + arg0, + arg1, + arg2..., + ) + }) + return _c +} + +func (_c *MockAPIClient_ImageLoad_Call) Return(loadResponse image.LoadResponse, err error) *MockAPIClient_ImageLoad_Call { + _c.Call.Return(loadResponse, err) + return _c +} + +func (_c *MockAPIClient_ImageLoad_Call) RunAndReturn(run func(ctx context.Context, input io.Reader, imageLoadOptions ...client.ImageLoadOption) (image.LoadResponse, error)) *MockAPIClient_ImageLoad_Call { + _c.Call.Return(run) + return _c +} + +// ImagePull provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ImagePull(ctx context.Context, ref string, options image.PullOptions) (io.ReadCloser, error) { + ret := _mock.Called(ctx, ref, options) + + if len(ret) == 0 { + panic("no return value specified for ImagePull") + } + + var r0 io.ReadCloser + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, image.PullOptions) (io.ReadCloser, error)); ok { + return returnFunc(ctx, ref, options) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, string, image.PullOptions) io.ReadCloser); ok { + r0 = returnFunc(ctx, ref, options) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(io.ReadCloser) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, string, image.PullOptions) error); ok { + r1 = returnFunc(ctx, ref, options) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_ImagePull_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ImagePull' +type MockAPIClient_ImagePull_Call struct { + *mock.Call +} + +// ImagePull is a helper method to define mock.On call +// - ctx context.Context +// - ref string +// - options image.PullOptions +func (_e *MockAPIClient_Expecter) ImagePull(ctx any, ref any, options any) *MockAPIClient_ImagePull_Call { + return &MockAPIClient_ImagePull_Call{Call: _e.mock.On("ImagePull", ctx, ref, options)} +} + +func (_c *MockAPIClient_ImagePull_Call) Run(run func(ctx context.Context, ref string, options image.PullOptions)) *MockAPIClient_ImagePull_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 image.PullOptions + if args[2] != nil { + arg2 = args[2].(image.PullOptions) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockAPIClient_ImagePull_Call) Return(readCloser io.ReadCloser, err error) *MockAPIClient_ImagePull_Call { + _c.Call.Return(readCloser, err) + return _c +} + +func (_c *MockAPIClient_ImagePull_Call) RunAndReturn(run func(ctx context.Context, ref string, options image.PullOptions) (io.ReadCloser, error)) *MockAPIClient_ImagePull_Call { + _c.Call.Return(run) + return _c +} + +// ImagePush provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ImagePush(ctx context.Context, ref string, options image.PushOptions) (io.ReadCloser, error) { + ret := _mock.Called(ctx, ref, options) + + if len(ret) == 0 { + panic("no return value specified for ImagePush") + } + + var r0 io.ReadCloser + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, image.PushOptions) (io.ReadCloser, error)); ok { + return returnFunc(ctx, ref, options) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, string, image.PushOptions) io.ReadCloser); ok { + r0 = returnFunc(ctx, ref, options) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(io.ReadCloser) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, string, image.PushOptions) error); ok { + r1 = returnFunc(ctx, ref, options) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_ImagePush_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ImagePush' +type MockAPIClient_ImagePush_Call struct { + *mock.Call +} + +// ImagePush is a helper method to define mock.On call +// - ctx context.Context +// - ref string +// - options image.PushOptions +func (_e *MockAPIClient_Expecter) ImagePush(ctx any, ref any, options any) *MockAPIClient_ImagePush_Call { + return &MockAPIClient_ImagePush_Call{Call: _e.mock.On("ImagePush", ctx, ref, options)} +} + +func (_c *MockAPIClient_ImagePush_Call) Run(run func(ctx context.Context, ref string, options image.PushOptions)) *MockAPIClient_ImagePush_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 image.PushOptions + if args[2] != nil { + arg2 = args[2].(image.PushOptions) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockAPIClient_ImagePush_Call) Return(readCloser io.ReadCloser, err error) *MockAPIClient_ImagePush_Call { + _c.Call.Return(readCloser, err) + return _c +} + +func (_c *MockAPIClient_ImagePush_Call) RunAndReturn(run func(ctx context.Context, ref string, options image.PushOptions) (io.ReadCloser, error)) *MockAPIClient_ImagePush_Call { + _c.Call.Return(run) + return _c +} + +// ImageRemove provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ImageRemove(ctx context.Context, image1 string, options image.RemoveOptions) ([]image.DeleteResponse, error) { + ret := _mock.Called(ctx, image1, options) + + if len(ret) == 0 { + panic("no return value specified for ImageRemove") + } + + var r0 []image.DeleteResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, image.RemoveOptions) ([]image.DeleteResponse, error)); ok { + return returnFunc(ctx, image1, options) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, string, image.RemoveOptions) []image.DeleteResponse); ok { + r0 = returnFunc(ctx, image1, options) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]image.DeleteResponse) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, string, image.RemoveOptions) error); ok { + r1 = returnFunc(ctx, image1, options) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_ImageRemove_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ImageRemove' +type MockAPIClient_ImageRemove_Call struct { + *mock.Call +} + +// ImageRemove is a helper method to define mock.On call +// - ctx context.Context +// - image1 string +// - options image.RemoveOptions +func (_e *MockAPIClient_Expecter) ImageRemove(ctx any, image1 any, options any) *MockAPIClient_ImageRemove_Call { + return &MockAPIClient_ImageRemove_Call{Call: _e.mock.On("ImageRemove", ctx, image1, options)} +} + +func (_c *MockAPIClient_ImageRemove_Call) Run(run func(ctx context.Context, image1 string, options image.RemoveOptions)) *MockAPIClient_ImageRemove_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 image.RemoveOptions + if args[2] != nil { + arg2 = args[2].(image.RemoveOptions) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockAPIClient_ImageRemove_Call) Return(deleteResponses []image.DeleteResponse, err error) *MockAPIClient_ImageRemove_Call { + _c.Call.Return(deleteResponses, err) + return _c +} + +func (_c *MockAPIClient_ImageRemove_Call) RunAndReturn(run func(ctx context.Context, image1 string, options image.RemoveOptions) ([]image.DeleteResponse, error)) *MockAPIClient_ImageRemove_Call { + _c.Call.Return(run) + return _c +} + +// ImageSave provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ImageSave(ctx context.Context, images []string, imageSaveOptions ...client.ImageSaveOption) (io.ReadCloser, error) { + var tmpRet mock.Arguments + if len(imageSaveOptions) > 0 { + tmpRet = _mock.Called(ctx, images, imageSaveOptions) + } else { + tmpRet = _mock.Called(ctx, images) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for ImageSave") + } + + var r0 io.ReadCloser + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, []string, ...client.ImageSaveOption) (io.ReadCloser, error)); ok { + return returnFunc(ctx, images, imageSaveOptions...) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, []string, ...client.ImageSaveOption) io.ReadCloser); ok { + r0 = returnFunc(ctx, images, imageSaveOptions...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(io.ReadCloser) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, []string, ...client.ImageSaveOption) error); ok { + r1 = returnFunc(ctx, images, imageSaveOptions...) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_ImageSave_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ImageSave' +type MockAPIClient_ImageSave_Call struct { + *mock.Call +} + +// ImageSave is a helper method to define mock.On call +// - ctx context.Context +// - images []string +// - imageSaveOptions ...client.ImageSaveOption +func (_e *MockAPIClient_Expecter) ImageSave(ctx any, images any, imageSaveOptions ...any) *MockAPIClient_ImageSave_Call { + return &MockAPIClient_ImageSave_Call{Call: _e.mock.On("ImageSave", + append([]any{ctx, images}, imageSaveOptions...)...)} +} + +func (_c *MockAPIClient_ImageSave_Call) Run(run func(ctx context.Context, images []string, imageSaveOptions ...client.ImageSaveOption)) *MockAPIClient_ImageSave_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 []string + if args[1] != nil { + arg1 = args[1].([]string) + } + var arg2 []client.ImageSaveOption + var variadicArgs []client.ImageSaveOption + if len(args) > 2 { + variadicArgs = args[2].([]client.ImageSaveOption) + } + arg2 = variadicArgs + run( + arg0, + arg1, + arg2..., + ) + }) + return _c +} + +func (_c *MockAPIClient_ImageSave_Call) Return(readCloser io.ReadCloser, err error) *MockAPIClient_ImageSave_Call { + _c.Call.Return(readCloser, err) + return _c +} + +func (_c *MockAPIClient_ImageSave_Call) RunAndReturn(run func(ctx context.Context, images []string, imageSaveOptions ...client.ImageSaveOption) (io.ReadCloser, error)) *MockAPIClient_ImageSave_Call { + _c.Call.Return(run) + return _c +} + +// ImageSearch provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ImageSearch(ctx context.Context, term string, options registry.SearchOptions) ([]registry.SearchResult, error) { + ret := _mock.Called(ctx, term, options) + + if len(ret) == 0 { + panic("no return value specified for ImageSearch") + } + + var r0 []registry.SearchResult + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, registry.SearchOptions) ([]registry.SearchResult, error)); ok { + return returnFunc(ctx, term, options) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, string, registry.SearchOptions) []registry.SearchResult); ok { + r0 = returnFunc(ctx, term, options) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]registry.SearchResult) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, string, registry.SearchOptions) error); ok { + r1 = returnFunc(ctx, term, options) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_ImageSearch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ImageSearch' +type MockAPIClient_ImageSearch_Call struct { + *mock.Call +} + +// ImageSearch is a helper method to define mock.On call +// - ctx context.Context +// - term string +// - options registry.SearchOptions +func (_e *MockAPIClient_Expecter) ImageSearch(ctx any, term any, options any) *MockAPIClient_ImageSearch_Call { + return &MockAPIClient_ImageSearch_Call{Call: _e.mock.On("ImageSearch", ctx, term, options)} +} + +func (_c *MockAPIClient_ImageSearch_Call) Run(run func(ctx context.Context, term string, options registry.SearchOptions)) *MockAPIClient_ImageSearch_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 registry.SearchOptions + if args[2] != nil { + arg2 = args[2].(registry.SearchOptions) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockAPIClient_ImageSearch_Call) Return(searchResults []registry.SearchResult, err error) *MockAPIClient_ImageSearch_Call { + _c.Call.Return(searchResults, err) + return _c +} + +func (_c *MockAPIClient_ImageSearch_Call) RunAndReturn(run func(ctx context.Context, term string, options registry.SearchOptions) ([]registry.SearchResult, error)) *MockAPIClient_ImageSearch_Call { + _c.Call.Return(run) + return _c +} + +// ImageTag provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ImageTag(ctx context.Context, image1 string, ref string) error { + ret := _mock.Called(ctx, image1, ref) + + if len(ret) == 0 { + panic("no return value specified for ImageTag") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) error); ok { + r0 = returnFunc(ctx, image1, ref) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockAPIClient_ImageTag_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ImageTag' +type MockAPIClient_ImageTag_Call struct { + *mock.Call +} + +// ImageTag is a helper method to define mock.On call +// - ctx context.Context +// - image1 string +// - ref string +func (_e *MockAPIClient_Expecter) ImageTag(ctx any, image1 any, ref any) *MockAPIClient_ImageTag_Call { + return &MockAPIClient_ImageTag_Call{Call: _e.mock.On("ImageTag", ctx, image1, ref)} +} + +func (_c *MockAPIClient_ImageTag_Call) Run(run func(ctx context.Context, image1 string, ref string)) *MockAPIClient_ImageTag_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 string + if args[2] != nil { + arg2 = args[2].(string) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockAPIClient_ImageTag_Call) Return(err error) *MockAPIClient_ImageTag_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockAPIClient_ImageTag_Call) RunAndReturn(run func(ctx context.Context, image1 string, ref string) error) *MockAPIClient_ImageTag_Call { + _c.Call.Return(run) + return _c +} + +// ImagesPrune provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ImagesPrune(ctx context.Context, pruneFilter filters.Args) (image.PruneReport, error) { + ret := _mock.Called(ctx, pruneFilter) + + if len(ret) == 0 { + panic("no return value specified for ImagesPrune") + } + + var r0 image.PruneReport + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, filters.Args) (image.PruneReport, error)); ok { + return returnFunc(ctx, pruneFilter) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, filters.Args) image.PruneReport); ok { + r0 = returnFunc(ctx, pruneFilter) + } else { + r0 = ret.Get(0).(image.PruneReport) + } + if returnFunc, ok := ret.Get(1).(func(context.Context, filters.Args) error); ok { + r1 = returnFunc(ctx, pruneFilter) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_ImagesPrune_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ImagesPrune' +type MockAPIClient_ImagesPrune_Call struct { + *mock.Call +} + +// ImagesPrune is a helper method to define mock.On call +// - ctx context.Context +// - pruneFilter filters.Args +func (_e *MockAPIClient_Expecter) ImagesPrune(ctx any, pruneFilter any) *MockAPIClient_ImagesPrune_Call { + return &MockAPIClient_ImagesPrune_Call{Call: _e.mock.On("ImagesPrune", ctx, pruneFilter)} +} + +func (_c *MockAPIClient_ImagesPrune_Call) Run(run func(ctx context.Context, pruneFilter filters.Args)) *MockAPIClient_ImagesPrune_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 filters.Args + if args[1] != nil { + arg1 = args[1].(filters.Args) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockAPIClient_ImagesPrune_Call) Return(pruneReport image.PruneReport, err error) *MockAPIClient_ImagesPrune_Call { + _c.Call.Return(pruneReport, err) + return _c +} + +func (_c *MockAPIClient_ImagesPrune_Call) RunAndReturn(run func(ctx context.Context, pruneFilter filters.Args) (image.PruneReport, error)) *MockAPIClient_ImagesPrune_Call { + _c.Call.Return(run) + return _c +} + +// Info provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) Info(ctx context.Context) (system.Info, error) { + ret := _mock.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for Info") + } + + var r0 system.Info + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context) (system.Info, error)); ok { + return returnFunc(ctx) + } + if returnFunc, ok := ret.Get(0).(func(context.Context) system.Info); ok { + r0 = returnFunc(ctx) + } else { + r0 = ret.Get(0).(system.Info) + } + if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = returnFunc(ctx) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_Info_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Info' +type MockAPIClient_Info_Call struct { + *mock.Call +} + +// Info is a helper method to define mock.On call +// - ctx context.Context +func (_e *MockAPIClient_Expecter) Info(ctx any) *MockAPIClient_Info_Call { + return &MockAPIClient_Info_Call{Call: _e.mock.On("Info", ctx)} +} + +func (_c *MockAPIClient_Info_Call) Run(run func(ctx context.Context)) *MockAPIClient_Info_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockAPIClient_Info_Call) Return(info system.Info, err error) *MockAPIClient_Info_Call { + _c.Call.Return(info, err) + return _c +} + +func (_c *MockAPIClient_Info_Call) RunAndReturn(run func(ctx context.Context) (system.Info, error)) *MockAPIClient_Info_Call { + _c.Call.Return(run) + return _c +} + +// NegotiateAPIVersion provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) NegotiateAPIVersion(ctx context.Context) { + _mock.Called(ctx) + return +} + +// MockAPIClient_NegotiateAPIVersion_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NegotiateAPIVersion' +type MockAPIClient_NegotiateAPIVersion_Call struct { + *mock.Call +} + +// NegotiateAPIVersion is a helper method to define mock.On call +// - ctx context.Context +func (_e *MockAPIClient_Expecter) NegotiateAPIVersion(ctx any) *MockAPIClient_NegotiateAPIVersion_Call { + return &MockAPIClient_NegotiateAPIVersion_Call{Call: _e.mock.On("NegotiateAPIVersion", ctx)} +} + +func (_c *MockAPIClient_NegotiateAPIVersion_Call) Run(run func(ctx context.Context)) *MockAPIClient_NegotiateAPIVersion_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockAPIClient_NegotiateAPIVersion_Call) Return() *MockAPIClient_NegotiateAPIVersion_Call { + _c.Call.Return() + return _c +} + +func (_c *MockAPIClient_NegotiateAPIVersion_Call) RunAndReturn(run func(ctx context.Context)) *MockAPIClient_NegotiateAPIVersion_Call { + _c.Run(run) + return _c +} + +// NegotiateAPIVersionPing provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) NegotiateAPIVersionPing(ping types.Ping) { + _mock.Called(ping) + return +} + +// MockAPIClient_NegotiateAPIVersionPing_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NegotiateAPIVersionPing' +type MockAPIClient_NegotiateAPIVersionPing_Call struct { + *mock.Call +} + +// NegotiateAPIVersionPing is a helper method to define mock.On call +// - ping types.Ping +func (_e *MockAPIClient_Expecter) NegotiateAPIVersionPing(ping any) *MockAPIClient_NegotiateAPIVersionPing_Call { + return &MockAPIClient_NegotiateAPIVersionPing_Call{Call: _e.mock.On("NegotiateAPIVersionPing", ping)} +} + +func (_c *MockAPIClient_NegotiateAPIVersionPing_Call) Run(run func(ping types.Ping)) *MockAPIClient_NegotiateAPIVersionPing_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 types.Ping + if args[0] != nil { + arg0 = args[0].(types.Ping) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockAPIClient_NegotiateAPIVersionPing_Call) Return() *MockAPIClient_NegotiateAPIVersionPing_Call { + _c.Call.Return() + return _c +} + +func (_c *MockAPIClient_NegotiateAPIVersionPing_Call) RunAndReturn(run func(ping types.Ping)) *MockAPIClient_NegotiateAPIVersionPing_Call { + _c.Run(run) + return _c +} + +// NetworkConnect provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) NetworkConnect(ctx context.Context, network1 string, container1 string, config *network.EndpointSettings) error { + ret := _mock.Called(ctx, network1, container1, config) + + if len(ret) == 0 { + panic("no return value specified for NetworkConnect") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, *network.EndpointSettings) error); ok { + r0 = returnFunc(ctx, network1, container1, config) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockAPIClient_NetworkConnect_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NetworkConnect' +type MockAPIClient_NetworkConnect_Call struct { + *mock.Call +} + +// NetworkConnect is a helper method to define mock.On call +// - ctx context.Context +// - network1 string +// - container1 string +// - config *network.EndpointSettings +func (_e *MockAPIClient_Expecter) NetworkConnect(ctx any, network1 any, container1 any, config any) *MockAPIClient_NetworkConnect_Call { + return &MockAPIClient_NetworkConnect_Call{Call: _e.mock.On("NetworkConnect", ctx, network1, container1, config)} +} + +func (_c *MockAPIClient_NetworkConnect_Call) Run(run func(ctx context.Context, network1 string, container1 string, config *network.EndpointSettings)) *MockAPIClient_NetworkConnect_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 string + if args[2] != nil { + arg2 = args[2].(string) + } + var arg3 *network.EndpointSettings + if args[3] != nil { + arg3 = args[3].(*network.EndpointSettings) + } + run( + arg0, + arg1, + arg2, + arg3, + ) + }) + return _c +} + +func (_c *MockAPIClient_NetworkConnect_Call) Return(err error) *MockAPIClient_NetworkConnect_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockAPIClient_NetworkConnect_Call) RunAndReturn(run func(ctx context.Context, network1 string, container1 string, config *network.EndpointSettings) error) *MockAPIClient_NetworkConnect_Call { + _c.Call.Return(run) + return _c +} + +// NetworkCreate provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) NetworkCreate(ctx context.Context, name string, options network.CreateOptions) (network.CreateResponse, error) { + ret := _mock.Called(ctx, name, options) + + if len(ret) == 0 { + panic("no return value specified for NetworkCreate") + } + + var r0 network.CreateResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, network.CreateOptions) (network.CreateResponse, error)); ok { + return returnFunc(ctx, name, options) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, string, network.CreateOptions) network.CreateResponse); ok { + r0 = returnFunc(ctx, name, options) + } else { + r0 = ret.Get(0).(network.CreateResponse) + } + if returnFunc, ok := ret.Get(1).(func(context.Context, string, network.CreateOptions) error); ok { + r1 = returnFunc(ctx, name, options) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_NetworkCreate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NetworkCreate' +type MockAPIClient_NetworkCreate_Call struct { + *mock.Call +} + +// NetworkCreate is a helper method to define mock.On call +// - ctx context.Context +// - name string +// - options network.CreateOptions +func (_e *MockAPIClient_Expecter) NetworkCreate(ctx any, name any, options any) *MockAPIClient_NetworkCreate_Call { + return &MockAPIClient_NetworkCreate_Call{Call: _e.mock.On("NetworkCreate", ctx, name, options)} +} + +func (_c *MockAPIClient_NetworkCreate_Call) Run(run func(ctx context.Context, name string, options network.CreateOptions)) *MockAPIClient_NetworkCreate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 network.CreateOptions + if args[2] != nil { + arg2 = args[2].(network.CreateOptions) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockAPIClient_NetworkCreate_Call) Return(createResponse network.CreateResponse, err error) *MockAPIClient_NetworkCreate_Call { + _c.Call.Return(createResponse, err) + return _c +} + +func (_c *MockAPIClient_NetworkCreate_Call) RunAndReturn(run func(ctx context.Context, name string, options network.CreateOptions) (network.CreateResponse, error)) *MockAPIClient_NetworkCreate_Call { + _c.Call.Return(run) + return _c +} + +// NetworkDisconnect provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) NetworkDisconnect(ctx context.Context, network1 string, container1 string, force bool) error { + ret := _mock.Called(ctx, network1, container1, force) + + if len(ret) == 0 { + panic("no return value specified for NetworkDisconnect") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, bool) error); ok { + r0 = returnFunc(ctx, network1, container1, force) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockAPIClient_NetworkDisconnect_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NetworkDisconnect' +type MockAPIClient_NetworkDisconnect_Call struct { + *mock.Call +} + +// NetworkDisconnect is a helper method to define mock.On call +// - ctx context.Context +// - network1 string +// - container1 string +// - force bool +func (_e *MockAPIClient_Expecter) NetworkDisconnect(ctx any, network1 any, container1 any, force any) *MockAPIClient_NetworkDisconnect_Call { + return &MockAPIClient_NetworkDisconnect_Call{Call: _e.mock.On("NetworkDisconnect", ctx, network1, container1, force)} +} + +func (_c *MockAPIClient_NetworkDisconnect_Call) Run(run func(ctx context.Context, network1 string, container1 string, force bool)) *MockAPIClient_NetworkDisconnect_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 string + if args[2] != nil { + arg2 = args[2].(string) + } + var arg3 bool + if args[3] != nil { + arg3 = args[3].(bool) + } + run( + arg0, + arg1, + arg2, + arg3, + ) + }) + return _c +} + +func (_c *MockAPIClient_NetworkDisconnect_Call) Return(err error) *MockAPIClient_NetworkDisconnect_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockAPIClient_NetworkDisconnect_Call) RunAndReturn(run func(ctx context.Context, network1 string, container1 string, force bool) error) *MockAPIClient_NetworkDisconnect_Call { + _c.Call.Return(run) + return _c +} + +// NetworkInspect provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) NetworkInspect(ctx context.Context, network1 string, options network.InspectOptions) (network.Inspect, error) { + ret := _mock.Called(ctx, network1, options) + + if len(ret) == 0 { + panic("no return value specified for NetworkInspect") + } + + var r0 network.Inspect + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, network.InspectOptions) (network.Inspect, error)); ok { + return returnFunc(ctx, network1, options) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, string, network.InspectOptions) network.Inspect); ok { + r0 = returnFunc(ctx, network1, options) + } else { + r0 = ret.Get(0).(network.Inspect) + } + if returnFunc, ok := ret.Get(1).(func(context.Context, string, network.InspectOptions) error); ok { + r1 = returnFunc(ctx, network1, options) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_NetworkInspect_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NetworkInspect' +type MockAPIClient_NetworkInspect_Call struct { + *mock.Call +} + +// NetworkInspect is a helper method to define mock.On call +// - ctx context.Context +// - network1 string +// - options network.InspectOptions +func (_e *MockAPIClient_Expecter) NetworkInspect(ctx any, network1 any, options any) *MockAPIClient_NetworkInspect_Call { + return &MockAPIClient_NetworkInspect_Call{Call: _e.mock.On("NetworkInspect", ctx, network1, options)} +} + +func (_c *MockAPIClient_NetworkInspect_Call) Run(run func(ctx context.Context, network1 string, options network.InspectOptions)) *MockAPIClient_NetworkInspect_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 network.InspectOptions + if args[2] != nil { + arg2 = args[2].(network.InspectOptions) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockAPIClient_NetworkInspect_Call) Return(inspect network.Inspect, err error) *MockAPIClient_NetworkInspect_Call { + _c.Call.Return(inspect, err) + return _c +} + +func (_c *MockAPIClient_NetworkInspect_Call) RunAndReturn(run func(ctx context.Context, network1 string, options network.InspectOptions) (network.Inspect, error)) *MockAPIClient_NetworkInspect_Call { + _c.Call.Return(run) + return _c +} + +// NetworkInspectWithRaw provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) NetworkInspectWithRaw(ctx context.Context, network1 string, options network.InspectOptions) (network.Inspect, []byte, error) { + ret := _mock.Called(ctx, network1, options) + + if len(ret) == 0 { + panic("no return value specified for NetworkInspectWithRaw") + } + + var r0 network.Inspect + var r1 []byte + var r2 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, network.InspectOptions) (network.Inspect, []byte, error)); ok { + return returnFunc(ctx, network1, options) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, string, network.InspectOptions) network.Inspect); ok { + r0 = returnFunc(ctx, network1, options) + } else { + r0 = ret.Get(0).(network.Inspect) + } + if returnFunc, ok := ret.Get(1).(func(context.Context, string, network.InspectOptions) []byte); ok { + r1 = returnFunc(ctx, network1, options) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).([]byte) + } + } + if returnFunc, ok := ret.Get(2).(func(context.Context, string, network.InspectOptions) error); ok { + r2 = returnFunc(ctx, network1, options) + } else { + r2 = ret.Error(2) + } + return r0, r1, r2 +} + +// MockAPIClient_NetworkInspectWithRaw_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NetworkInspectWithRaw' +type MockAPIClient_NetworkInspectWithRaw_Call struct { + *mock.Call +} + +// NetworkInspectWithRaw is a helper method to define mock.On call +// - ctx context.Context +// - network1 string +// - options network.InspectOptions +func (_e *MockAPIClient_Expecter) NetworkInspectWithRaw(ctx any, network1 any, options any) *MockAPIClient_NetworkInspectWithRaw_Call { + return &MockAPIClient_NetworkInspectWithRaw_Call{Call: _e.mock.On("NetworkInspectWithRaw", ctx, network1, options)} +} + +func (_c *MockAPIClient_NetworkInspectWithRaw_Call) Run(run func(ctx context.Context, network1 string, options network.InspectOptions)) *MockAPIClient_NetworkInspectWithRaw_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 network.InspectOptions + if args[2] != nil { + arg2 = args[2].(network.InspectOptions) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockAPIClient_NetworkInspectWithRaw_Call) Return(inspect network.Inspect, bytes []byte, err error) *MockAPIClient_NetworkInspectWithRaw_Call { + _c.Call.Return(inspect, bytes, err) + return _c +} + +func (_c *MockAPIClient_NetworkInspectWithRaw_Call) RunAndReturn(run func(ctx context.Context, network1 string, options network.InspectOptions) (network.Inspect, []byte, error)) *MockAPIClient_NetworkInspectWithRaw_Call { + _c.Call.Return(run) + return _c +} + +// NetworkList provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) NetworkList(ctx context.Context, options network.ListOptions) ([]network.Summary, error) { + ret := _mock.Called(ctx, options) + + if len(ret) == 0 { + panic("no return value specified for NetworkList") + } + + var r0 []network.Summary + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, network.ListOptions) ([]network.Summary, error)); ok { + return returnFunc(ctx, options) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, network.ListOptions) []network.Summary); ok { + r0 = returnFunc(ctx, options) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]network.Summary) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, network.ListOptions) error); ok { + r1 = returnFunc(ctx, options) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_NetworkList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NetworkList' +type MockAPIClient_NetworkList_Call struct { + *mock.Call +} + +// NetworkList is a helper method to define mock.On call +// - ctx context.Context +// - options network.ListOptions +func (_e *MockAPIClient_Expecter) NetworkList(ctx any, options any) *MockAPIClient_NetworkList_Call { + return &MockAPIClient_NetworkList_Call{Call: _e.mock.On("NetworkList", ctx, options)} +} + +func (_c *MockAPIClient_NetworkList_Call) Run(run func(ctx context.Context, options network.ListOptions)) *MockAPIClient_NetworkList_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 network.ListOptions + if args[1] != nil { + arg1 = args[1].(network.ListOptions) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockAPIClient_NetworkList_Call) Return(summarys []network.Summary, err error) *MockAPIClient_NetworkList_Call { + _c.Call.Return(summarys, err) + return _c +} + +func (_c *MockAPIClient_NetworkList_Call) RunAndReturn(run func(ctx context.Context, options network.ListOptions) ([]network.Summary, error)) *MockAPIClient_NetworkList_Call { + _c.Call.Return(run) + return _c +} + +// NetworkRemove provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) NetworkRemove(ctx context.Context, network1 string) error { + ret := _mock.Called(ctx, network1) + + if len(ret) == 0 { + panic("no return value specified for NetworkRemove") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = returnFunc(ctx, network1) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockAPIClient_NetworkRemove_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NetworkRemove' +type MockAPIClient_NetworkRemove_Call struct { + *mock.Call +} + +// NetworkRemove is a helper method to define mock.On call +// - ctx context.Context +// - network1 string +func (_e *MockAPIClient_Expecter) NetworkRemove(ctx any, network1 any) *MockAPIClient_NetworkRemove_Call { + return &MockAPIClient_NetworkRemove_Call{Call: _e.mock.On("NetworkRemove", ctx, network1)} +} + +func (_c *MockAPIClient_NetworkRemove_Call) Run(run func(ctx context.Context, network1 string)) *MockAPIClient_NetworkRemove_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockAPIClient_NetworkRemove_Call) Return(err error) *MockAPIClient_NetworkRemove_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockAPIClient_NetworkRemove_Call) RunAndReturn(run func(ctx context.Context, network1 string) error) *MockAPIClient_NetworkRemove_Call { + _c.Call.Return(run) + return _c +} + +// NetworksPrune provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) NetworksPrune(ctx context.Context, pruneFilter filters.Args) (network.PruneReport, error) { + ret := _mock.Called(ctx, pruneFilter) + + if len(ret) == 0 { + panic("no return value specified for NetworksPrune") + } + + var r0 network.PruneReport + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, filters.Args) (network.PruneReport, error)); ok { + return returnFunc(ctx, pruneFilter) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, filters.Args) network.PruneReport); ok { + r0 = returnFunc(ctx, pruneFilter) + } else { + r0 = ret.Get(0).(network.PruneReport) + } + if returnFunc, ok := ret.Get(1).(func(context.Context, filters.Args) error); ok { + r1 = returnFunc(ctx, pruneFilter) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_NetworksPrune_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NetworksPrune' +type MockAPIClient_NetworksPrune_Call struct { + *mock.Call +} + +// NetworksPrune is a helper method to define mock.On call +// - ctx context.Context +// - pruneFilter filters.Args +func (_e *MockAPIClient_Expecter) NetworksPrune(ctx any, pruneFilter any) *MockAPIClient_NetworksPrune_Call { + return &MockAPIClient_NetworksPrune_Call{Call: _e.mock.On("NetworksPrune", ctx, pruneFilter)} +} + +func (_c *MockAPIClient_NetworksPrune_Call) Run(run func(ctx context.Context, pruneFilter filters.Args)) *MockAPIClient_NetworksPrune_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 filters.Args + if args[1] != nil { + arg1 = args[1].(filters.Args) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockAPIClient_NetworksPrune_Call) Return(pruneReport network.PruneReport, err error) *MockAPIClient_NetworksPrune_Call { + _c.Call.Return(pruneReport, err) + return _c +} + +func (_c *MockAPIClient_NetworksPrune_Call) RunAndReturn(run func(ctx context.Context, pruneFilter filters.Args) (network.PruneReport, error)) *MockAPIClient_NetworksPrune_Call { + _c.Call.Return(run) + return _c +} + +// NodeInspectWithRaw provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) NodeInspectWithRaw(ctx context.Context, nodeID string) (swarm.Node, []byte, error) { + ret := _mock.Called(ctx, nodeID) + + if len(ret) == 0 { + panic("no return value specified for NodeInspectWithRaw") + } + + var r0 swarm.Node + var r1 []byte + var r2 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string) (swarm.Node, []byte, error)); ok { + return returnFunc(ctx, nodeID) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, string) swarm.Node); ok { + r0 = returnFunc(ctx, nodeID) + } else { + r0 = ret.Get(0).(swarm.Node) + } + if returnFunc, ok := ret.Get(1).(func(context.Context, string) []byte); ok { + r1 = returnFunc(ctx, nodeID) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).([]byte) + } + } + if returnFunc, ok := ret.Get(2).(func(context.Context, string) error); ok { + r2 = returnFunc(ctx, nodeID) + } else { + r2 = ret.Error(2) + } + return r0, r1, r2 +} + +// MockAPIClient_NodeInspectWithRaw_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NodeInspectWithRaw' +type MockAPIClient_NodeInspectWithRaw_Call struct { + *mock.Call +} + +// NodeInspectWithRaw is a helper method to define mock.On call +// - ctx context.Context +// - nodeID string +func (_e *MockAPIClient_Expecter) NodeInspectWithRaw(ctx any, nodeID any) *MockAPIClient_NodeInspectWithRaw_Call { + return &MockAPIClient_NodeInspectWithRaw_Call{Call: _e.mock.On("NodeInspectWithRaw", ctx, nodeID)} +} + +func (_c *MockAPIClient_NodeInspectWithRaw_Call) Run(run func(ctx context.Context, nodeID string)) *MockAPIClient_NodeInspectWithRaw_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockAPIClient_NodeInspectWithRaw_Call) Return(node swarm.Node, bytes []byte, err error) *MockAPIClient_NodeInspectWithRaw_Call { + _c.Call.Return(node, bytes, err) + return _c +} + +func (_c *MockAPIClient_NodeInspectWithRaw_Call) RunAndReturn(run func(ctx context.Context, nodeID string) (swarm.Node, []byte, error)) *MockAPIClient_NodeInspectWithRaw_Call { + _c.Call.Return(run) + return _c +} + +// NodeList provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) NodeList(ctx context.Context, options swarm.NodeListOptions) ([]swarm.Node, error) { + ret := _mock.Called(ctx, options) + + if len(ret) == 0 { + panic("no return value specified for NodeList") + } + + var r0 []swarm.Node + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, swarm.NodeListOptions) ([]swarm.Node, error)); ok { + return returnFunc(ctx, options) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, swarm.NodeListOptions) []swarm.Node); ok { + r0 = returnFunc(ctx, options) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]swarm.Node) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, swarm.NodeListOptions) error); ok { + r1 = returnFunc(ctx, options) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_NodeList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NodeList' +type MockAPIClient_NodeList_Call struct { + *mock.Call +} + +// NodeList is a helper method to define mock.On call +// - ctx context.Context +// - options swarm.NodeListOptions +func (_e *MockAPIClient_Expecter) NodeList(ctx any, options any) *MockAPIClient_NodeList_Call { + return &MockAPIClient_NodeList_Call{Call: _e.mock.On("NodeList", ctx, options)} +} + +func (_c *MockAPIClient_NodeList_Call) Run(run func(ctx context.Context, options swarm.NodeListOptions)) *MockAPIClient_NodeList_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 swarm.NodeListOptions + if args[1] != nil { + arg1 = args[1].(swarm.NodeListOptions) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockAPIClient_NodeList_Call) Return(nodes []swarm.Node, err error) *MockAPIClient_NodeList_Call { + _c.Call.Return(nodes, err) + return _c +} + +func (_c *MockAPIClient_NodeList_Call) RunAndReturn(run func(ctx context.Context, options swarm.NodeListOptions) ([]swarm.Node, error)) *MockAPIClient_NodeList_Call { + _c.Call.Return(run) + return _c +} + +// NodeRemove provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) NodeRemove(ctx context.Context, nodeID string, options swarm.NodeRemoveOptions) error { + ret := _mock.Called(ctx, nodeID, options) + + if len(ret) == 0 { + panic("no return value specified for NodeRemove") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, swarm.NodeRemoveOptions) error); ok { + r0 = returnFunc(ctx, nodeID, options) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockAPIClient_NodeRemove_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NodeRemove' +type MockAPIClient_NodeRemove_Call struct { + *mock.Call +} + +// NodeRemove is a helper method to define mock.On call +// - ctx context.Context +// - nodeID string +// - options swarm.NodeRemoveOptions +func (_e *MockAPIClient_Expecter) NodeRemove(ctx any, nodeID any, options any) *MockAPIClient_NodeRemove_Call { + return &MockAPIClient_NodeRemove_Call{Call: _e.mock.On("NodeRemove", ctx, nodeID, options)} +} + +func (_c *MockAPIClient_NodeRemove_Call) Run(run func(ctx context.Context, nodeID string, options swarm.NodeRemoveOptions)) *MockAPIClient_NodeRemove_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 swarm.NodeRemoveOptions + if args[2] != nil { + arg2 = args[2].(swarm.NodeRemoveOptions) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockAPIClient_NodeRemove_Call) Return(err error) *MockAPIClient_NodeRemove_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockAPIClient_NodeRemove_Call) RunAndReturn(run func(ctx context.Context, nodeID string, options swarm.NodeRemoveOptions) error) *MockAPIClient_NodeRemove_Call { + _c.Call.Return(run) + return _c +} + +// NodeUpdate provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) NodeUpdate(ctx context.Context, nodeID string, version swarm.Version, node swarm.NodeSpec) error { + ret := _mock.Called(ctx, nodeID, version, node) + + if len(ret) == 0 { + panic("no return value specified for NodeUpdate") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, swarm.Version, swarm.NodeSpec) error); ok { + r0 = returnFunc(ctx, nodeID, version, node) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockAPIClient_NodeUpdate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NodeUpdate' +type MockAPIClient_NodeUpdate_Call struct { + *mock.Call +} + +// NodeUpdate is a helper method to define mock.On call +// - ctx context.Context +// - nodeID string +// - version swarm.Version +// - node swarm.NodeSpec +func (_e *MockAPIClient_Expecter) NodeUpdate(ctx any, nodeID any, version any, node any) *MockAPIClient_NodeUpdate_Call { + return &MockAPIClient_NodeUpdate_Call{Call: _e.mock.On("NodeUpdate", ctx, nodeID, version, node)} +} + +func (_c *MockAPIClient_NodeUpdate_Call) Run(run func(ctx context.Context, nodeID string, version swarm.Version, node swarm.NodeSpec)) *MockAPIClient_NodeUpdate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 swarm.Version + if args[2] != nil { + arg2 = args[2].(swarm.Version) + } + var arg3 swarm.NodeSpec + if args[3] != nil { + arg3 = args[3].(swarm.NodeSpec) + } + run( + arg0, + arg1, + arg2, + arg3, + ) + }) + return _c +} + +func (_c *MockAPIClient_NodeUpdate_Call) Return(err error) *MockAPIClient_NodeUpdate_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockAPIClient_NodeUpdate_Call) RunAndReturn(run func(ctx context.Context, nodeID string, version swarm.Version, node swarm.NodeSpec) error) *MockAPIClient_NodeUpdate_Call { + _c.Call.Return(run) + return _c +} + +// Ping provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) Ping(ctx context.Context) (types.Ping, error) { + ret := _mock.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for Ping") + } + + var r0 types.Ping + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context) (types.Ping, error)); ok { + return returnFunc(ctx) + } + if returnFunc, ok := ret.Get(0).(func(context.Context) types.Ping); ok { + r0 = returnFunc(ctx) + } else { + r0 = ret.Get(0).(types.Ping) + } + if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = returnFunc(ctx) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_Ping_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Ping' +type MockAPIClient_Ping_Call struct { + *mock.Call +} + +// Ping is a helper method to define mock.On call +// - ctx context.Context +func (_e *MockAPIClient_Expecter) Ping(ctx any) *MockAPIClient_Ping_Call { + return &MockAPIClient_Ping_Call{Call: _e.mock.On("Ping", ctx)} +} + +func (_c *MockAPIClient_Ping_Call) Run(run func(ctx context.Context)) *MockAPIClient_Ping_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockAPIClient_Ping_Call) Return(ping types.Ping, err error) *MockAPIClient_Ping_Call { + _c.Call.Return(ping, err) + return _c +} + +func (_c *MockAPIClient_Ping_Call) RunAndReturn(run func(ctx context.Context) (types.Ping, error)) *MockAPIClient_Ping_Call { + _c.Call.Return(run) + return _c +} + +// PluginCreate provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) PluginCreate(ctx context.Context, createContext io.Reader, options types.PluginCreateOptions) error { + ret := _mock.Called(ctx, createContext, options) + + if len(ret) == 0 { + panic("no return value specified for PluginCreate") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, io.Reader, types.PluginCreateOptions) error); ok { + r0 = returnFunc(ctx, createContext, options) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockAPIClient_PluginCreate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PluginCreate' +type MockAPIClient_PluginCreate_Call struct { + *mock.Call +} + +// PluginCreate is a helper method to define mock.On call +// - ctx context.Context +// - createContext io.Reader +// - options types.PluginCreateOptions +func (_e *MockAPIClient_Expecter) PluginCreate(ctx any, createContext any, options any) *MockAPIClient_PluginCreate_Call { + return &MockAPIClient_PluginCreate_Call{Call: _e.mock.On("PluginCreate", ctx, createContext, options)} +} + +func (_c *MockAPIClient_PluginCreate_Call) Run(run func(ctx context.Context, createContext io.Reader, options types.PluginCreateOptions)) *MockAPIClient_PluginCreate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 io.Reader + if args[1] != nil { + arg1 = args[1].(io.Reader) + } + var arg2 types.PluginCreateOptions + if args[2] != nil { + arg2 = args[2].(types.PluginCreateOptions) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockAPIClient_PluginCreate_Call) Return(err error) *MockAPIClient_PluginCreate_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockAPIClient_PluginCreate_Call) RunAndReturn(run func(ctx context.Context, createContext io.Reader, options types.PluginCreateOptions) error) *MockAPIClient_PluginCreate_Call { + _c.Call.Return(run) + return _c +} + +// PluginDisable provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) PluginDisable(ctx context.Context, name string, options types.PluginDisableOptions) error { + ret := _mock.Called(ctx, name, options) + + if len(ret) == 0 { + panic("no return value specified for PluginDisable") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, types.PluginDisableOptions) error); ok { + r0 = returnFunc(ctx, name, options) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockAPIClient_PluginDisable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PluginDisable' +type MockAPIClient_PluginDisable_Call struct { + *mock.Call +} + +// PluginDisable is a helper method to define mock.On call +// - ctx context.Context +// - name string +// - options types.PluginDisableOptions +func (_e *MockAPIClient_Expecter) PluginDisable(ctx any, name any, options any) *MockAPIClient_PluginDisable_Call { + return &MockAPIClient_PluginDisable_Call{Call: _e.mock.On("PluginDisable", ctx, name, options)} +} + +func (_c *MockAPIClient_PluginDisable_Call) Run(run func(ctx context.Context, name string, options types.PluginDisableOptions)) *MockAPIClient_PluginDisable_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 types.PluginDisableOptions + if args[2] != nil { + arg2 = args[2].(types.PluginDisableOptions) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockAPIClient_PluginDisable_Call) Return(err error) *MockAPIClient_PluginDisable_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockAPIClient_PluginDisable_Call) RunAndReturn(run func(ctx context.Context, name string, options types.PluginDisableOptions) error) *MockAPIClient_PluginDisable_Call { + _c.Call.Return(run) + return _c +} + +// PluginEnable provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) PluginEnable(ctx context.Context, name string, options types.PluginEnableOptions) error { + ret := _mock.Called(ctx, name, options) + + if len(ret) == 0 { + panic("no return value specified for PluginEnable") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, types.PluginEnableOptions) error); ok { + r0 = returnFunc(ctx, name, options) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockAPIClient_PluginEnable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PluginEnable' +type MockAPIClient_PluginEnable_Call struct { + *mock.Call +} + +// PluginEnable is a helper method to define mock.On call +// - ctx context.Context +// - name string +// - options types.PluginEnableOptions +func (_e *MockAPIClient_Expecter) PluginEnable(ctx any, name any, options any) *MockAPIClient_PluginEnable_Call { + return &MockAPIClient_PluginEnable_Call{Call: _e.mock.On("PluginEnable", ctx, name, options)} +} + +func (_c *MockAPIClient_PluginEnable_Call) Run(run func(ctx context.Context, name string, options types.PluginEnableOptions)) *MockAPIClient_PluginEnable_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 types.PluginEnableOptions + if args[2] != nil { + arg2 = args[2].(types.PluginEnableOptions) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockAPIClient_PluginEnable_Call) Return(err error) *MockAPIClient_PluginEnable_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockAPIClient_PluginEnable_Call) RunAndReturn(run func(ctx context.Context, name string, options types.PluginEnableOptions) error) *MockAPIClient_PluginEnable_Call { + _c.Call.Return(run) + return _c +} + +// PluginInspectWithRaw provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) PluginInspectWithRaw(ctx context.Context, name string) (*types.Plugin, []byte, error) { + ret := _mock.Called(ctx, name) + + if len(ret) == 0 { + panic("no return value specified for PluginInspectWithRaw") + } + + var r0 *types.Plugin + var r1 []byte + var r2 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string) (*types.Plugin, []byte, error)); ok { + return returnFunc(ctx, name) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, string) *types.Plugin); ok { + r0 = returnFunc(ctx, name) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Plugin) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, string) []byte); ok { + r1 = returnFunc(ctx, name) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).([]byte) + } + } + if returnFunc, ok := ret.Get(2).(func(context.Context, string) error); ok { + r2 = returnFunc(ctx, name) + } else { + r2 = ret.Error(2) + } + return r0, r1, r2 +} + +// MockAPIClient_PluginInspectWithRaw_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PluginInspectWithRaw' +type MockAPIClient_PluginInspectWithRaw_Call struct { + *mock.Call +} + +// PluginInspectWithRaw is a helper method to define mock.On call +// - ctx context.Context +// - name string +func (_e *MockAPIClient_Expecter) PluginInspectWithRaw(ctx any, name any) *MockAPIClient_PluginInspectWithRaw_Call { + return &MockAPIClient_PluginInspectWithRaw_Call{Call: _e.mock.On("PluginInspectWithRaw", ctx, name)} +} + +func (_c *MockAPIClient_PluginInspectWithRaw_Call) Run(run func(ctx context.Context, name string)) *MockAPIClient_PluginInspectWithRaw_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockAPIClient_PluginInspectWithRaw_Call) Return(plugin *types.Plugin, bytes []byte, err error) *MockAPIClient_PluginInspectWithRaw_Call { + _c.Call.Return(plugin, bytes, err) + return _c +} + +func (_c *MockAPIClient_PluginInspectWithRaw_Call) RunAndReturn(run func(ctx context.Context, name string) (*types.Plugin, []byte, error)) *MockAPIClient_PluginInspectWithRaw_Call { + _c.Call.Return(run) + return _c +} + +// PluginInstall provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) PluginInstall(ctx context.Context, name string, options types.PluginInstallOptions) (io.ReadCloser, error) { + ret := _mock.Called(ctx, name, options) + + if len(ret) == 0 { + panic("no return value specified for PluginInstall") + } + + var r0 io.ReadCloser + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, types.PluginInstallOptions) (io.ReadCloser, error)); ok { + return returnFunc(ctx, name, options) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, string, types.PluginInstallOptions) io.ReadCloser); ok { + r0 = returnFunc(ctx, name, options) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(io.ReadCloser) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, string, types.PluginInstallOptions) error); ok { + r1 = returnFunc(ctx, name, options) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_PluginInstall_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PluginInstall' +type MockAPIClient_PluginInstall_Call struct { + *mock.Call +} + +// PluginInstall is a helper method to define mock.On call +// - ctx context.Context +// - name string +// - options types.PluginInstallOptions +func (_e *MockAPIClient_Expecter) PluginInstall(ctx any, name any, options any) *MockAPIClient_PluginInstall_Call { + return &MockAPIClient_PluginInstall_Call{Call: _e.mock.On("PluginInstall", ctx, name, options)} +} + +func (_c *MockAPIClient_PluginInstall_Call) Run(run func(ctx context.Context, name string, options types.PluginInstallOptions)) *MockAPIClient_PluginInstall_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 types.PluginInstallOptions + if args[2] != nil { + arg2 = args[2].(types.PluginInstallOptions) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockAPIClient_PluginInstall_Call) Return(readCloser io.ReadCloser, err error) *MockAPIClient_PluginInstall_Call { + _c.Call.Return(readCloser, err) + return _c +} + +func (_c *MockAPIClient_PluginInstall_Call) RunAndReturn(run func(ctx context.Context, name string, options types.PluginInstallOptions) (io.ReadCloser, error)) *MockAPIClient_PluginInstall_Call { + _c.Call.Return(run) + return _c +} + +// PluginList provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) PluginList(ctx context.Context, filter filters.Args) (types.PluginsListResponse, error) { + ret := _mock.Called(ctx, filter) + + if len(ret) == 0 { + panic("no return value specified for PluginList") + } + + var r0 types.PluginsListResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, filters.Args) (types.PluginsListResponse, error)); ok { + return returnFunc(ctx, filter) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, filters.Args) types.PluginsListResponse); ok { + r0 = returnFunc(ctx, filter) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(types.PluginsListResponse) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, filters.Args) error); ok { + r1 = returnFunc(ctx, filter) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_PluginList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PluginList' +type MockAPIClient_PluginList_Call struct { + *mock.Call +} + +// PluginList is a helper method to define mock.On call +// - ctx context.Context +// - filter filters.Args +func (_e *MockAPIClient_Expecter) PluginList(ctx any, filter any) *MockAPIClient_PluginList_Call { + return &MockAPIClient_PluginList_Call{Call: _e.mock.On("PluginList", ctx, filter)} +} + +func (_c *MockAPIClient_PluginList_Call) Run(run func(ctx context.Context, filter filters.Args)) *MockAPIClient_PluginList_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 filters.Args + if args[1] != nil { + arg1 = args[1].(filters.Args) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockAPIClient_PluginList_Call) Return(pluginsListResponse types.PluginsListResponse, err error) *MockAPIClient_PluginList_Call { + _c.Call.Return(pluginsListResponse, err) + return _c +} + +func (_c *MockAPIClient_PluginList_Call) RunAndReturn(run func(ctx context.Context, filter filters.Args) (types.PluginsListResponse, error)) *MockAPIClient_PluginList_Call { + _c.Call.Return(run) + return _c +} + +// PluginPush provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) PluginPush(ctx context.Context, name string, registryAuth string) (io.ReadCloser, error) { + ret := _mock.Called(ctx, name, registryAuth) + + if len(ret) == 0 { + panic("no return value specified for PluginPush") + } + + var r0 io.ReadCloser + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) (io.ReadCloser, error)); ok { + return returnFunc(ctx, name, registryAuth) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) io.ReadCloser); ok { + r0 = returnFunc(ctx, name, registryAuth) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(io.ReadCloser) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, string, string) error); ok { + r1 = returnFunc(ctx, name, registryAuth) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_PluginPush_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PluginPush' +type MockAPIClient_PluginPush_Call struct { + *mock.Call +} + +// PluginPush is a helper method to define mock.On call +// - ctx context.Context +// - name string +// - registryAuth string +func (_e *MockAPIClient_Expecter) PluginPush(ctx any, name any, registryAuth any) *MockAPIClient_PluginPush_Call { + return &MockAPIClient_PluginPush_Call{Call: _e.mock.On("PluginPush", ctx, name, registryAuth)} +} + +func (_c *MockAPIClient_PluginPush_Call) Run(run func(ctx context.Context, name string, registryAuth string)) *MockAPIClient_PluginPush_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 string + if args[2] != nil { + arg2 = args[2].(string) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockAPIClient_PluginPush_Call) Return(readCloser io.ReadCloser, err error) *MockAPIClient_PluginPush_Call { + _c.Call.Return(readCloser, err) + return _c +} + +func (_c *MockAPIClient_PluginPush_Call) RunAndReturn(run func(ctx context.Context, name string, registryAuth string) (io.ReadCloser, error)) *MockAPIClient_PluginPush_Call { + _c.Call.Return(run) + return _c +} + +// PluginRemove provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) PluginRemove(ctx context.Context, name string, options types.PluginRemoveOptions) error { + ret := _mock.Called(ctx, name, options) + + if len(ret) == 0 { + panic("no return value specified for PluginRemove") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, types.PluginRemoveOptions) error); ok { + r0 = returnFunc(ctx, name, options) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockAPIClient_PluginRemove_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PluginRemove' +type MockAPIClient_PluginRemove_Call struct { + *mock.Call +} + +// PluginRemove is a helper method to define mock.On call +// - ctx context.Context +// - name string +// - options types.PluginRemoveOptions +func (_e *MockAPIClient_Expecter) PluginRemove(ctx any, name any, options any) *MockAPIClient_PluginRemove_Call { + return &MockAPIClient_PluginRemove_Call{Call: _e.mock.On("PluginRemove", ctx, name, options)} +} + +func (_c *MockAPIClient_PluginRemove_Call) Run(run func(ctx context.Context, name string, options types.PluginRemoveOptions)) *MockAPIClient_PluginRemove_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 types.PluginRemoveOptions + if args[2] != nil { + arg2 = args[2].(types.PluginRemoveOptions) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockAPIClient_PluginRemove_Call) Return(err error) *MockAPIClient_PluginRemove_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockAPIClient_PluginRemove_Call) RunAndReturn(run func(ctx context.Context, name string, options types.PluginRemoveOptions) error) *MockAPIClient_PluginRemove_Call { + _c.Call.Return(run) + return _c +} + +// PluginSet provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) PluginSet(ctx context.Context, name string, args []string) error { + ret := _mock.Called(ctx, name, args) + + if len(ret) == 0 { + panic("no return value specified for PluginSet") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, []string) error); ok { + r0 = returnFunc(ctx, name, args) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockAPIClient_PluginSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PluginSet' +type MockAPIClient_PluginSet_Call struct { + *mock.Call +} + +// PluginSet is a helper method to define mock.On call +// - ctx context.Context +// - name string +// - args []string +func (_e *MockAPIClient_Expecter) PluginSet(ctx any, name any, args any) *MockAPIClient_PluginSet_Call { + return &MockAPIClient_PluginSet_Call{Call: _e.mock.On("PluginSet", ctx, name, args)} +} + +func (_c *MockAPIClient_PluginSet_Call) Run(run func(ctx context.Context, name string, args []string)) *MockAPIClient_PluginSet_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 []string + if args[2] != nil { + arg2 = args[2].([]string) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockAPIClient_PluginSet_Call) Return(err error) *MockAPIClient_PluginSet_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockAPIClient_PluginSet_Call) RunAndReturn(run func(ctx context.Context, name string, args []string) error) *MockAPIClient_PluginSet_Call { + _c.Call.Return(run) + return _c +} + +// PluginUpgrade provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) PluginUpgrade(ctx context.Context, name string, options types.PluginInstallOptions) (io.ReadCloser, error) { + ret := _mock.Called(ctx, name, options) + + if len(ret) == 0 { + panic("no return value specified for PluginUpgrade") + } + + var r0 io.ReadCloser + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, types.PluginInstallOptions) (io.ReadCloser, error)); ok { + return returnFunc(ctx, name, options) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, string, types.PluginInstallOptions) io.ReadCloser); ok { + r0 = returnFunc(ctx, name, options) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(io.ReadCloser) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, string, types.PluginInstallOptions) error); ok { + r1 = returnFunc(ctx, name, options) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_PluginUpgrade_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PluginUpgrade' +type MockAPIClient_PluginUpgrade_Call struct { + *mock.Call +} + +// PluginUpgrade is a helper method to define mock.On call +// - ctx context.Context +// - name string +// - options types.PluginInstallOptions +func (_e *MockAPIClient_Expecter) PluginUpgrade(ctx any, name any, options any) *MockAPIClient_PluginUpgrade_Call { + return &MockAPIClient_PluginUpgrade_Call{Call: _e.mock.On("PluginUpgrade", ctx, name, options)} +} + +func (_c *MockAPIClient_PluginUpgrade_Call) Run(run func(ctx context.Context, name string, options types.PluginInstallOptions)) *MockAPIClient_PluginUpgrade_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 types.PluginInstallOptions + if args[2] != nil { + arg2 = args[2].(types.PluginInstallOptions) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockAPIClient_PluginUpgrade_Call) Return(readCloser io.ReadCloser, err error) *MockAPIClient_PluginUpgrade_Call { + _c.Call.Return(readCloser, err) + return _c +} + +func (_c *MockAPIClient_PluginUpgrade_Call) RunAndReturn(run func(ctx context.Context, name string, options types.PluginInstallOptions) (io.ReadCloser, error)) *MockAPIClient_PluginUpgrade_Call { + _c.Call.Return(run) + return _c +} + +// RegistryLogin provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) RegistryLogin(ctx context.Context, auth registry.AuthConfig) (registry.AuthenticateOKBody, error) { + ret := _mock.Called(ctx, auth) + + if len(ret) == 0 { + panic("no return value specified for RegistryLogin") + } + + var r0 registry.AuthenticateOKBody + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, registry.AuthConfig) (registry.AuthenticateOKBody, error)); ok { + return returnFunc(ctx, auth) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, registry.AuthConfig) registry.AuthenticateOKBody); ok { + r0 = returnFunc(ctx, auth) + } else { + r0 = ret.Get(0).(registry.AuthenticateOKBody) + } + if returnFunc, ok := ret.Get(1).(func(context.Context, registry.AuthConfig) error); ok { + r1 = returnFunc(ctx, auth) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_RegistryLogin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RegistryLogin' +type MockAPIClient_RegistryLogin_Call struct { + *mock.Call +} + +// RegistryLogin is a helper method to define mock.On call +// - ctx context.Context +// - auth registry.AuthConfig +func (_e *MockAPIClient_Expecter) RegistryLogin(ctx any, auth any) *MockAPIClient_RegistryLogin_Call { + return &MockAPIClient_RegistryLogin_Call{Call: _e.mock.On("RegistryLogin", ctx, auth)} +} + +func (_c *MockAPIClient_RegistryLogin_Call) Run(run func(ctx context.Context, auth registry.AuthConfig)) *MockAPIClient_RegistryLogin_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 registry.AuthConfig + if args[1] != nil { + arg1 = args[1].(registry.AuthConfig) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockAPIClient_RegistryLogin_Call) Return(authenticateOKBody registry.AuthenticateOKBody, err error) *MockAPIClient_RegistryLogin_Call { + _c.Call.Return(authenticateOKBody, err) + return _c +} + +func (_c *MockAPIClient_RegistryLogin_Call) RunAndReturn(run func(ctx context.Context, auth registry.AuthConfig) (registry.AuthenticateOKBody, error)) *MockAPIClient_RegistryLogin_Call { + _c.Call.Return(run) + return _c +} + +// SecretCreate provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) SecretCreate(ctx context.Context, secret swarm.SecretSpec) (swarm.SecretCreateResponse, error) { + ret := _mock.Called(ctx, secret) + + if len(ret) == 0 { + panic("no return value specified for SecretCreate") + } + + var r0 swarm.SecretCreateResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, swarm.SecretSpec) (swarm.SecretCreateResponse, error)); ok { + return returnFunc(ctx, secret) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, swarm.SecretSpec) swarm.SecretCreateResponse); ok { + r0 = returnFunc(ctx, secret) + } else { + r0 = ret.Get(0).(swarm.SecretCreateResponse) + } + if returnFunc, ok := ret.Get(1).(func(context.Context, swarm.SecretSpec) error); ok { + r1 = returnFunc(ctx, secret) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_SecretCreate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SecretCreate' +type MockAPIClient_SecretCreate_Call struct { + *mock.Call +} + +// SecretCreate is a helper method to define mock.On call +// - ctx context.Context +// - secret swarm.SecretSpec +func (_e *MockAPIClient_Expecter) SecretCreate(ctx any, secret any) *MockAPIClient_SecretCreate_Call { + return &MockAPIClient_SecretCreate_Call{Call: _e.mock.On("SecretCreate", ctx, secret)} +} + +func (_c *MockAPIClient_SecretCreate_Call) Run(run func(ctx context.Context, secret swarm.SecretSpec)) *MockAPIClient_SecretCreate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 swarm.SecretSpec + if args[1] != nil { + arg1 = args[1].(swarm.SecretSpec) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockAPIClient_SecretCreate_Call) Return(secretCreateResponse swarm.SecretCreateResponse, err error) *MockAPIClient_SecretCreate_Call { + _c.Call.Return(secretCreateResponse, err) + return _c +} + +func (_c *MockAPIClient_SecretCreate_Call) RunAndReturn(run func(ctx context.Context, secret swarm.SecretSpec) (swarm.SecretCreateResponse, error)) *MockAPIClient_SecretCreate_Call { + _c.Call.Return(run) + return _c +} + +// SecretInspectWithRaw provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) SecretInspectWithRaw(ctx context.Context, name string) (swarm.Secret, []byte, error) { + ret := _mock.Called(ctx, name) + + if len(ret) == 0 { + panic("no return value specified for SecretInspectWithRaw") + } + + var r0 swarm.Secret + var r1 []byte + var r2 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string) (swarm.Secret, []byte, error)); ok { + return returnFunc(ctx, name) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, string) swarm.Secret); ok { + r0 = returnFunc(ctx, name) + } else { + r0 = ret.Get(0).(swarm.Secret) + } + if returnFunc, ok := ret.Get(1).(func(context.Context, string) []byte); ok { + r1 = returnFunc(ctx, name) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).([]byte) + } + } + if returnFunc, ok := ret.Get(2).(func(context.Context, string) error); ok { + r2 = returnFunc(ctx, name) + } else { + r2 = ret.Error(2) + } + return r0, r1, r2 +} + +// MockAPIClient_SecretInspectWithRaw_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SecretInspectWithRaw' +type MockAPIClient_SecretInspectWithRaw_Call struct { + *mock.Call +} + +// SecretInspectWithRaw is a helper method to define mock.On call +// - ctx context.Context +// - name string +func (_e *MockAPIClient_Expecter) SecretInspectWithRaw(ctx any, name any) *MockAPIClient_SecretInspectWithRaw_Call { + return &MockAPIClient_SecretInspectWithRaw_Call{Call: _e.mock.On("SecretInspectWithRaw", ctx, name)} +} + +func (_c *MockAPIClient_SecretInspectWithRaw_Call) Run(run func(ctx context.Context, name string)) *MockAPIClient_SecretInspectWithRaw_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockAPIClient_SecretInspectWithRaw_Call) Return(secret swarm.Secret, bytes []byte, err error) *MockAPIClient_SecretInspectWithRaw_Call { + _c.Call.Return(secret, bytes, err) + return _c +} + +func (_c *MockAPIClient_SecretInspectWithRaw_Call) RunAndReturn(run func(ctx context.Context, name string) (swarm.Secret, []byte, error)) *MockAPIClient_SecretInspectWithRaw_Call { + _c.Call.Return(run) + return _c +} + +// SecretList provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) SecretList(ctx context.Context, options swarm.SecretListOptions) ([]swarm.Secret, error) { + ret := _mock.Called(ctx, options) + + if len(ret) == 0 { + panic("no return value specified for SecretList") + } + + var r0 []swarm.Secret + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, swarm.SecretListOptions) ([]swarm.Secret, error)); ok { + return returnFunc(ctx, options) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, swarm.SecretListOptions) []swarm.Secret); ok { + r0 = returnFunc(ctx, options) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]swarm.Secret) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, swarm.SecretListOptions) error); ok { + r1 = returnFunc(ctx, options) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_SecretList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SecretList' +type MockAPIClient_SecretList_Call struct { + *mock.Call +} + +// SecretList is a helper method to define mock.On call +// - ctx context.Context +// - options swarm.SecretListOptions +func (_e *MockAPIClient_Expecter) SecretList(ctx any, options any) *MockAPIClient_SecretList_Call { + return &MockAPIClient_SecretList_Call{Call: _e.mock.On("SecretList", ctx, options)} +} + +func (_c *MockAPIClient_SecretList_Call) Run(run func(ctx context.Context, options swarm.SecretListOptions)) *MockAPIClient_SecretList_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 swarm.SecretListOptions + if args[1] != nil { + arg1 = args[1].(swarm.SecretListOptions) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockAPIClient_SecretList_Call) Return(secrets []swarm.Secret, err error) *MockAPIClient_SecretList_Call { + _c.Call.Return(secrets, err) + return _c +} + +func (_c *MockAPIClient_SecretList_Call) RunAndReturn(run func(ctx context.Context, options swarm.SecretListOptions) ([]swarm.Secret, error)) *MockAPIClient_SecretList_Call { + _c.Call.Return(run) + return _c +} + +// SecretRemove provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) SecretRemove(ctx context.Context, id string) error { + ret := _mock.Called(ctx, id) + + if len(ret) == 0 { + panic("no return value specified for SecretRemove") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = returnFunc(ctx, id) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockAPIClient_SecretRemove_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SecretRemove' +type MockAPIClient_SecretRemove_Call struct { + *mock.Call +} + +// SecretRemove is a helper method to define mock.On call +// - ctx context.Context +// - id string +func (_e *MockAPIClient_Expecter) SecretRemove(ctx any, id any) *MockAPIClient_SecretRemove_Call { + return &MockAPIClient_SecretRemove_Call{Call: _e.mock.On("SecretRemove", ctx, id)} +} + +func (_c *MockAPIClient_SecretRemove_Call) Run(run func(ctx context.Context, id string)) *MockAPIClient_SecretRemove_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockAPIClient_SecretRemove_Call) Return(err error) *MockAPIClient_SecretRemove_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockAPIClient_SecretRemove_Call) RunAndReturn(run func(ctx context.Context, id string) error) *MockAPIClient_SecretRemove_Call { + _c.Call.Return(run) + return _c +} + +// SecretUpdate provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) SecretUpdate(ctx context.Context, id string, version swarm.Version, secret swarm.SecretSpec) error { + ret := _mock.Called(ctx, id, version, secret) + + if len(ret) == 0 { + panic("no return value specified for SecretUpdate") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, swarm.Version, swarm.SecretSpec) error); ok { + r0 = returnFunc(ctx, id, version, secret) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockAPIClient_SecretUpdate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SecretUpdate' +type MockAPIClient_SecretUpdate_Call struct { + *mock.Call +} + +// SecretUpdate is a helper method to define mock.On call +// - ctx context.Context +// - id string +// - version swarm.Version +// - secret swarm.SecretSpec +func (_e *MockAPIClient_Expecter) SecretUpdate(ctx any, id any, version any, secret any) *MockAPIClient_SecretUpdate_Call { + return &MockAPIClient_SecretUpdate_Call{Call: _e.mock.On("SecretUpdate", ctx, id, version, secret)} +} + +func (_c *MockAPIClient_SecretUpdate_Call) Run(run func(ctx context.Context, id string, version swarm.Version, secret swarm.SecretSpec)) *MockAPIClient_SecretUpdate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 swarm.Version + if args[2] != nil { + arg2 = args[2].(swarm.Version) + } + var arg3 swarm.SecretSpec + if args[3] != nil { + arg3 = args[3].(swarm.SecretSpec) + } + run( + arg0, + arg1, + arg2, + arg3, + ) + }) + return _c +} + +func (_c *MockAPIClient_SecretUpdate_Call) Return(err error) *MockAPIClient_SecretUpdate_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockAPIClient_SecretUpdate_Call) RunAndReturn(run func(ctx context.Context, id string, version swarm.Version, secret swarm.SecretSpec) error) *MockAPIClient_SecretUpdate_Call { + _c.Call.Return(run) + return _c +} + +// ServerVersion provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ServerVersion(ctx context.Context) (types.Version, error) { + ret := _mock.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for ServerVersion") + } + + var r0 types.Version + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context) (types.Version, error)); ok { + return returnFunc(ctx) + } + if returnFunc, ok := ret.Get(0).(func(context.Context) types.Version); ok { + r0 = returnFunc(ctx) + } else { + r0 = ret.Get(0).(types.Version) + } + if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = returnFunc(ctx) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_ServerVersion_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ServerVersion' +type MockAPIClient_ServerVersion_Call struct { + *mock.Call +} + +// ServerVersion is a helper method to define mock.On call +// - ctx context.Context +func (_e *MockAPIClient_Expecter) ServerVersion(ctx any) *MockAPIClient_ServerVersion_Call { + return &MockAPIClient_ServerVersion_Call{Call: _e.mock.On("ServerVersion", ctx)} +} + +func (_c *MockAPIClient_ServerVersion_Call) Run(run func(ctx context.Context)) *MockAPIClient_ServerVersion_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockAPIClient_ServerVersion_Call) Return(version types.Version, err error) *MockAPIClient_ServerVersion_Call { + _c.Call.Return(version, err) + return _c +} + +func (_c *MockAPIClient_ServerVersion_Call) RunAndReturn(run func(ctx context.Context) (types.Version, error)) *MockAPIClient_ServerVersion_Call { + _c.Call.Return(run) + return _c +} + +// ServiceCreate provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ServiceCreate(ctx context.Context, service swarm.ServiceSpec, options swarm.ServiceCreateOptions) (swarm.ServiceCreateResponse, error) { + ret := _mock.Called(ctx, service, options) + + if len(ret) == 0 { + panic("no return value specified for ServiceCreate") + } + + var r0 swarm.ServiceCreateResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, swarm.ServiceSpec, swarm.ServiceCreateOptions) (swarm.ServiceCreateResponse, error)); ok { + return returnFunc(ctx, service, options) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, swarm.ServiceSpec, swarm.ServiceCreateOptions) swarm.ServiceCreateResponse); ok { + r0 = returnFunc(ctx, service, options) + } else { + r0 = ret.Get(0).(swarm.ServiceCreateResponse) + } + if returnFunc, ok := ret.Get(1).(func(context.Context, swarm.ServiceSpec, swarm.ServiceCreateOptions) error); ok { + r1 = returnFunc(ctx, service, options) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_ServiceCreate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ServiceCreate' +type MockAPIClient_ServiceCreate_Call struct { + *mock.Call +} + +// ServiceCreate is a helper method to define mock.On call +// - ctx context.Context +// - service swarm.ServiceSpec +// - options swarm.ServiceCreateOptions +func (_e *MockAPIClient_Expecter) ServiceCreate(ctx any, service any, options any) *MockAPIClient_ServiceCreate_Call { + return &MockAPIClient_ServiceCreate_Call{Call: _e.mock.On("ServiceCreate", ctx, service, options)} +} + +func (_c *MockAPIClient_ServiceCreate_Call) Run(run func(ctx context.Context, service swarm.ServiceSpec, options swarm.ServiceCreateOptions)) *MockAPIClient_ServiceCreate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 swarm.ServiceSpec + if args[1] != nil { + arg1 = args[1].(swarm.ServiceSpec) + } + var arg2 swarm.ServiceCreateOptions + if args[2] != nil { + arg2 = args[2].(swarm.ServiceCreateOptions) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockAPIClient_ServiceCreate_Call) Return(serviceCreateResponse swarm.ServiceCreateResponse, err error) *MockAPIClient_ServiceCreate_Call { + _c.Call.Return(serviceCreateResponse, err) + return _c +} + +func (_c *MockAPIClient_ServiceCreate_Call) RunAndReturn(run func(ctx context.Context, service swarm.ServiceSpec, options swarm.ServiceCreateOptions) (swarm.ServiceCreateResponse, error)) *MockAPIClient_ServiceCreate_Call { + _c.Call.Return(run) + return _c +} + +// ServiceInspectWithRaw provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ServiceInspectWithRaw(ctx context.Context, serviceID string, options swarm.ServiceInspectOptions) (swarm.Service, []byte, error) { + ret := _mock.Called(ctx, serviceID, options) + + if len(ret) == 0 { + panic("no return value specified for ServiceInspectWithRaw") + } + + var r0 swarm.Service + var r1 []byte + var r2 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, swarm.ServiceInspectOptions) (swarm.Service, []byte, error)); ok { + return returnFunc(ctx, serviceID, options) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, string, swarm.ServiceInspectOptions) swarm.Service); ok { + r0 = returnFunc(ctx, serviceID, options) + } else { + r0 = ret.Get(0).(swarm.Service) + } + if returnFunc, ok := ret.Get(1).(func(context.Context, string, swarm.ServiceInspectOptions) []byte); ok { + r1 = returnFunc(ctx, serviceID, options) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).([]byte) + } + } + if returnFunc, ok := ret.Get(2).(func(context.Context, string, swarm.ServiceInspectOptions) error); ok { + r2 = returnFunc(ctx, serviceID, options) + } else { + r2 = ret.Error(2) + } + return r0, r1, r2 +} + +// MockAPIClient_ServiceInspectWithRaw_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ServiceInspectWithRaw' +type MockAPIClient_ServiceInspectWithRaw_Call struct { + *mock.Call +} + +// ServiceInspectWithRaw is a helper method to define mock.On call +// - ctx context.Context +// - serviceID string +// - options swarm.ServiceInspectOptions +func (_e *MockAPIClient_Expecter) ServiceInspectWithRaw(ctx any, serviceID any, options any) *MockAPIClient_ServiceInspectWithRaw_Call { + return &MockAPIClient_ServiceInspectWithRaw_Call{Call: _e.mock.On("ServiceInspectWithRaw", ctx, serviceID, options)} +} + +func (_c *MockAPIClient_ServiceInspectWithRaw_Call) Run(run func(ctx context.Context, serviceID string, options swarm.ServiceInspectOptions)) *MockAPIClient_ServiceInspectWithRaw_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 swarm.ServiceInspectOptions + if args[2] != nil { + arg2 = args[2].(swarm.ServiceInspectOptions) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockAPIClient_ServiceInspectWithRaw_Call) Return(service swarm.Service, bytes []byte, err error) *MockAPIClient_ServiceInspectWithRaw_Call { + _c.Call.Return(service, bytes, err) + return _c +} + +func (_c *MockAPIClient_ServiceInspectWithRaw_Call) RunAndReturn(run func(ctx context.Context, serviceID string, options swarm.ServiceInspectOptions) (swarm.Service, []byte, error)) *MockAPIClient_ServiceInspectWithRaw_Call { + _c.Call.Return(run) + return _c +} + +// ServiceList provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ServiceList(ctx context.Context, options swarm.ServiceListOptions) ([]swarm.Service, error) { + ret := _mock.Called(ctx, options) + + if len(ret) == 0 { + panic("no return value specified for ServiceList") + } + + var r0 []swarm.Service + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, swarm.ServiceListOptions) ([]swarm.Service, error)); ok { + return returnFunc(ctx, options) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, swarm.ServiceListOptions) []swarm.Service); ok { + r0 = returnFunc(ctx, options) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]swarm.Service) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, swarm.ServiceListOptions) error); ok { + r1 = returnFunc(ctx, options) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_ServiceList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ServiceList' +type MockAPIClient_ServiceList_Call struct { + *mock.Call +} + +// ServiceList is a helper method to define mock.On call +// - ctx context.Context +// - options swarm.ServiceListOptions +func (_e *MockAPIClient_Expecter) ServiceList(ctx any, options any) *MockAPIClient_ServiceList_Call { + return &MockAPIClient_ServiceList_Call{Call: _e.mock.On("ServiceList", ctx, options)} +} + +func (_c *MockAPIClient_ServiceList_Call) Run(run func(ctx context.Context, options swarm.ServiceListOptions)) *MockAPIClient_ServiceList_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 swarm.ServiceListOptions + if args[1] != nil { + arg1 = args[1].(swarm.ServiceListOptions) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockAPIClient_ServiceList_Call) Return(services []swarm.Service, err error) *MockAPIClient_ServiceList_Call { + _c.Call.Return(services, err) + return _c +} + +func (_c *MockAPIClient_ServiceList_Call) RunAndReturn(run func(ctx context.Context, options swarm.ServiceListOptions) ([]swarm.Service, error)) *MockAPIClient_ServiceList_Call { + _c.Call.Return(run) + return _c +} + +// ServiceLogs provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ServiceLogs(ctx context.Context, serviceID string, options container.LogsOptions) (io.ReadCloser, error) { + ret := _mock.Called(ctx, serviceID, options) + + if len(ret) == 0 { + panic("no return value specified for ServiceLogs") + } + + var r0 io.ReadCloser + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, container.LogsOptions) (io.ReadCloser, error)); ok { + return returnFunc(ctx, serviceID, options) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, string, container.LogsOptions) io.ReadCloser); ok { + r0 = returnFunc(ctx, serviceID, options) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(io.ReadCloser) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, string, container.LogsOptions) error); ok { + r1 = returnFunc(ctx, serviceID, options) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_ServiceLogs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ServiceLogs' +type MockAPIClient_ServiceLogs_Call struct { + *mock.Call +} + +// ServiceLogs is a helper method to define mock.On call +// - ctx context.Context +// - serviceID string +// - options container.LogsOptions +func (_e *MockAPIClient_Expecter) ServiceLogs(ctx any, serviceID any, options any) *MockAPIClient_ServiceLogs_Call { + return &MockAPIClient_ServiceLogs_Call{Call: _e.mock.On("ServiceLogs", ctx, serviceID, options)} +} + +func (_c *MockAPIClient_ServiceLogs_Call) Run(run func(ctx context.Context, serviceID string, options container.LogsOptions)) *MockAPIClient_ServiceLogs_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 container.LogsOptions + if args[2] != nil { + arg2 = args[2].(container.LogsOptions) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockAPIClient_ServiceLogs_Call) Return(readCloser io.ReadCloser, err error) *MockAPIClient_ServiceLogs_Call { + _c.Call.Return(readCloser, err) + return _c +} + +func (_c *MockAPIClient_ServiceLogs_Call) RunAndReturn(run func(ctx context.Context, serviceID string, options container.LogsOptions) (io.ReadCloser, error)) *MockAPIClient_ServiceLogs_Call { + _c.Call.Return(run) + return _c +} + +// ServiceRemove provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ServiceRemove(ctx context.Context, serviceID string) error { + ret := _mock.Called(ctx, serviceID) + + if len(ret) == 0 { + panic("no return value specified for ServiceRemove") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = returnFunc(ctx, serviceID) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockAPIClient_ServiceRemove_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ServiceRemove' +type MockAPIClient_ServiceRemove_Call struct { + *mock.Call +} + +// ServiceRemove is a helper method to define mock.On call +// - ctx context.Context +// - serviceID string +func (_e *MockAPIClient_Expecter) ServiceRemove(ctx any, serviceID any) *MockAPIClient_ServiceRemove_Call { + return &MockAPIClient_ServiceRemove_Call{Call: _e.mock.On("ServiceRemove", ctx, serviceID)} +} + +func (_c *MockAPIClient_ServiceRemove_Call) Run(run func(ctx context.Context, serviceID string)) *MockAPIClient_ServiceRemove_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockAPIClient_ServiceRemove_Call) Return(err error) *MockAPIClient_ServiceRemove_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockAPIClient_ServiceRemove_Call) RunAndReturn(run func(ctx context.Context, serviceID string) error) *MockAPIClient_ServiceRemove_Call { + _c.Call.Return(run) + return _c +} + +// ServiceUpdate provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) ServiceUpdate(ctx context.Context, serviceID string, version swarm.Version, service swarm.ServiceSpec, options swarm.ServiceUpdateOptions) (swarm.ServiceUpdateResponse, error) { + ret := _mock.Called(ctx, serviceID, version, service, options) + + if len(ret) == 0 { + panic("no return value specified for ServiceUpdate") + } + + var r0 swarm.ServiceUpdateResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, swarm.Version, swarm.ServiceSpec, swarm.ServiceUpdateOptions) (swarm.ServiceUpdateResponse, error)); ok { + return returnFunc(ctx, serviceID, version, service, options) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, string, swarm.Version, swarm.ServiceSpec, swarm.ServiceUpdateOptions) swarm.ServiceUpdateResponse); ok { + r0 = returnFunc(ctx, serviceID, version, service, options) + } else { + r0 = ret.Get(0).(swarm.ServiceUpdateResponse) + } + if returnFunc, ok := ret.Get(1).(func(context.Context, string, swarm.Version, swarm.ServiceSpec, swarm.ServiceUpdateOptions) error); ok { + r1 = returnFunc(ctx, serviceID, version, service, options) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_ServiceUpdate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ServiceUpdate' +type MockAPIClient_ServiceUpdate_Call struct { + *mock.Call +} + +// ServiceUpdate is a helper method to define mock.On call +// - ctx context.Context +// - serviceID string +// - version swarm.Version +// - service swarm.ServiceSpec +// - options swarm.ServiceUpdateOptions +func (_e *MockAPIClient_Expecter) ServiceUpdate(ctx any, serviceID any, version any, service any, options any) *MockAPIClient_ServiceUpdate_Call { + return &MockAPIClient_ServiceUpdate_Call{Call: _e.mock.On("ServiceUpdate", ctx, serviceID, version, service, options)} +} + +func (_c *MockAPIClient_ServiceUpdate_Call) Run(run func(ctx context.Context, serviceID string, version swarm.Version, service swarm.ServiceSpec, options swarm.ServiceUpdateOptions)) *MockAPIClient_ServiceUpdate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 swarm.Version + if args[2] != nil { + arg2 = args[2].(swarm.Version) + } + var arg3 swarm.ServiceSpec + if args[3] != nil { + arg3 = args[3].(swarm.ServiceSpec) + } + var arg4 swarm.ServiceUpdateOptions + if args[4] != nil { + arg4 = args[4].(swarm.ServiceUpdateOptions) + } + run( + arg0, + arg1, + arg2, + arg3, + arg4, + ) + }) + return _c +} + +func (_c *MockAPIClient_ServiceUpdate_Call) Return(serviceUpdateResponse swarm.ServiceUpdateResponse, err error) *MockAPIClient_ServiceUpdate_Call { + _c.Call.Return(serviceUpdateResponse, err) + return _c +} + +func (_c *MockAPIClient_ServiceUpdate_Call) RunAndReturn(run func(ctx context.Context, serviceID string, version swarm.Version, service swarm.ServiceSpec, options swarm.ServiceUpdateOptions) (swarm.ServiceUpdateResponse, error)) *MockAPIClient_ServiceUpdate_Call { + _c.Call.Return(run) + return _c +} + +// SwarmGetUnlockKey provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) SwarmGetUnlockKey(ctx context.Context) (swarm.UnlockKeyResponse, error) { + ret := _mock.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for SwarmGetUnlockKey") + } + + var r0 swarm.UnlockKeyResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context) (swarm.UnlockKeyResponse, error)); ok { + return returnFunc(ctx) + } + if returnFunc, ok := ret.Get(0).(func(context.Context) swarm.UnlockKeyResponse); ok { + r0 = returnFunc(ctx) + } else { + r0 = ret.Get(0).(swarm.UnlockKeyResponse) + } + if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = returnFunc(ctx) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_SwarmGetUnlockKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SwarmGetUnlockKey' +type MockAPIClient_SwarmGetUnlockKey_Call struct { + *mock.Call +} + +// SwarmGetUnlockKey is a helper method to define mock.On call +// - ctx context.Context +func (_e *MockAPIClient_Expecter) SwarmGetUnlockKey(ctx any) *MockAPIClient_SwarmGetUnlockKey_Call { + return &MockAPIClient_SwarmGetUnlockKey_Call{Call: _e.mock.On("SwarmGetUnlockKey", ctx)} +} + +func (_c *MockAPIClient_SwarmGetUnlockKey_Call) Run(run func(ctx context.Context)) *MockAPIClient_SwarmGetUnlockKey_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockAPIClient_SwarmGetUnlockKey_Call) Return(unlockKeyResponse swarm.UnlockKeyResponse, err error) *MockAPIClient_SwarmGetUnlockKey_Call { + _c.Call.Return(unlockKeyResponse, err) + return _c +} + +func (_c *MockAPIClient_SwarmGetUnlockKey_Call) RunAndReturn(run func(ctx context.Context) (swarm.UnlockKeyResponse, error)) *MockAPIClient_SwarmGetUnlockKey_Call { + _c.Call.Return(run) + return _c +} + +// SwarmInit provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) SwarmInit(ctx context.Context, req swarm.InitRequest) (string, error) { + ret := _mock.Called(ctx, req) + + if len(ret) == 0 { + panic("no return value specified for SwarmInit") + } + + var r0 string + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, swarm.InitRequest) (string, error)); ok { + return returnFunc(ctx, req) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, swarm.InitRequest) string); ok { + r0 = returnFunc(ctx, req) + } else { + r0 = ret.Get(0).(string) + } + if returnFunc, ok := ret.Get(1).(func(context.Context, swarm.InitRequest) error); ok { + r1 = returnFunc(ctx, req) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_SwarmInit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SwarmInit' +type MockAPIClient_SwarmInit_Call struct { + *mock.Call +} + +// SwarmInit is a helper method to define mock.On call +// - ctx context.Context +// - req swarm.InitRequest +func (_e *MockAPIClient_Expecter) SwarmInit(ctx any, req any) *MockAPIClient_SwarmInit_Call { + return &MockAPIClient_SwarmInit_Call{Call: _e.mock.On("SwarmInit", ctx, req)} +} + +func (_c *MockAPIClient_SwarmInit_Call) Run(run func(ctx context.Context, req swarm.InitRequest)) *MockAPIClient_SwarmInit_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 swarm.InitRequest + if args[1] != nil { + arg1 = args[1].(swarm.InitRequest) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockAPIClient_SwarmInit_Call) Return(s string, err error) *MockAPIClient_SwarmInit_Call { + _c.Call.Return(s, err) + return _c +} + +func (_c *MockAPIClient_SwarmInit_Call) RunAndReturn(run func(ctx context.Context, req swarm.InitRequest) (string, error)) *MockAPIClient_SwarmInit_Call { + _c.Call.Return(run) + return _c +} + +// SwarmInspect provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) SwarmInspect(ctx context.Context) (swarm.Swarm, error) { + ret := _mock.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for SwarmInspect") + } + + var r0 swarm.Swarm + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context) (swarm.Swarm, error)); ok { + return returnFunc(ctx) + } + if returnFunc, ok := ret.Get(0).(func(context.Context) swarm.Swarm); ok { + r0 = returnFunc(ctx) + } else { + r0 = ret.Get(0).(swarm.Swarm) + } + if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = returnFunc(ctx) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_SwarmInspect_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SwarmInspect' +type MockAPIClient_SwarmInspect_Call struct { + *mock.Call +} + +// SwarmInspect is a helper method to define mock.On call +// - ctx context.Context +func (_e *MockAPIClient_Expecter) SwarmInspect(ctx any) *MockAPIClient_SwarmInspect_Call { + return &MockAPIClient_SwarmInspect_Call{Call: _e.mock.On("SwarmInspect", ctx)} +} + +func (_c *MockAPIClient_SwarmInspect_Call) Run(run func(ctx context.Context)) *MockAPIClient_SwarmInspect_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockAPIClient_SwarmInspect_Call) Return(swarm1 swarm.Swarm, err error) *MockAPIClient_SwarmInspect_Call { + _c.Call.Return(swarm1, err) + return _c +} + +func (_c *MockAPIClient_SwarmInspect_Call) RunAndReturn(run func(ctx context.Context) (swarm.Swarm, error)) *MockAPIClient_SwarmInspect_Call { + _c.Call.Return(run) + return _c +} + +// SwarmJoin provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) SwarmJoin(ctx context.Context, req swarm.JoinRequest) error { + ret := _mock.Called(ctx, req) + + if len(ret) == 0 { + panic("no return value specified for SwarmJoin") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, swarm.JoinRequest) error); ok { + r0 = returnFunc(ctx, req) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockAPIClient_SwarmJoin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SwarmJoin' +type MockAPIClient_SwarmJoin_Call struct { + *mock.Call +} + +// SwarmJoin is a helper method to define mock.On call +// - ctx context.Context +// - req swarm.JoinRequest +func (_e *MockAPIClient_Expecter) SwarmJoin(ctx any, req any) *MockAPIClient_SwarmJoin_Call { + return &MockAPIClient_SwarmJoin_Call{Call: _e.mock.On("SwarmJoin", ctx, req)} +} + +func (_c *MockAPIClient_SwarmJoin_Call) Run(run func(ctx context.Context, req swarm.JoinRequest)) *MockAPIClient_SwarmJoin_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 swarm.JoinRequest + if args[1] != nil { + arg1 = args[1].(swarm.JoinRequest) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockAPIClient_SwarmJoin_Call) Return(err error) *MockAPIClient_SwarmJoin_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockAPIClient_SwarmJoin_Call) RunAndReturn(run func(ctx context.Context, req swarm.JoinRequest) error) *MockAPIClient_SwarmJoin_Call { + _c.Call.Return(run) + return _c +} + +// SwarmLeave provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) SwarmLeave(ctx context.Context, force bool) error { + ret := _mock.Called(ctx, force) + + if len(ret) == 0 { + panic("no return value specified for SwarmLeave") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, bool) error); ok { + r0 = returnFunc(ctx, force) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockAPIClient_SwarmLeave_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SwarmLeave' +type MockAPIClient_SwarmLeave_Call struct { + *mock.Call +} + +// SwarmLeave is a helper method to define mock.On call +// - ctx context.Context +// - force bool +func (_e *MockAPIClient_Expecter) SwarmLeave(ctx any, force any) *MockAPIClient_SwarmLeave_Call { + return &MockAPIClient_SwarmLeave_Call{Call: _e.mock.On("SwarmLeave", ctx, force)} +} + +func (_c *MockAPIClient_SwarmLeave_Call) Run(run func(ctx context.Context, force bool)) *MockAPIClient_SwarmLeave_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 bool + if args[1] != nil { + arg1 = args[1].(bool) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockAPIClient_SwarmLeave_Call) Return(err error) *MockAPIClient_SwarmLeave_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockAPIClient_SwarmLeave_Call) RunAndReturn(run func(ctx context.Context, force bool) error) *MockAPIClient_SwarmLeave_Call { + _c.Call.Return(run) + return _c +} + +// SwarmUnlock provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) SwarmUnlock(ctx context.Context, req swarm.UnlockRequest) error { + ret := _mock.Called(ctx, req) + + if len(ret) == 0 { + panic("no return value specified for SwarmUnlock") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, swarm.UnlockRequest) error); ok { + r0 = returnFunc(ctx, req) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockAPIClient_SwarmUnlock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SwarmUnlock' +type MockAPIClient_SwarmUnlock_Call struct { + *mock.Call +} + +// SwarmUnlock is a helper method to define mock.On call +// - ctx context.Context +// - req swarm.UnlockRequest +func (_e *MockAPIClient_Expecter) SwarmUnlock(ctx any, req any) *MockAPIClient_SwarmUnlock_Call { + return &MockAPIClient_SwarmUnlock_Call{Call: _e.mock.On("SwarmUnlock", ctx, req)} +} + +func (_c *MockAPIClient_SwarmUnlock_Call) Run(run func(ctx context.Context, req swarm.UnlockRequest)) *MockAPIClient_SwarmUnlock_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 swarm.UnlockRequest + if args[1] != nil { + arg1 = args[1].(swarm.UnlockRequest) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockAPIClient_SwarmUnlock_Call) Return(err error) *MockAPIClient_SwarmUnlock_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockAPIClient_SwarmUnlock_Call) RunAndReturn(run func(ctx context.Context, req swarm.UnlockRequest) error) *MockAPIClient_SwarmUnlock_Call { + _c.Call.Return(run) + return _c +} + +// SwarmUpdate provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) SwarmUpdate(ctx context.Context, version swarm.Version, swarm1 swarm.Spec, flags swarm.UpdateFlags) error { + ret := _mock.Called(ctx, version, swarm1, flags) + + if len(ret) == 0 { + panic("no return value specified for SwarmUpdate") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, swarm.Version, swarm.Spec, swarm.UpdateFlags) error); ok { + r0 = returnFunc(ctx, version, swarm1, flags) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockAPIClient_SwarmUpdate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SwarmUpdate' +type MockAPIClient_SwarmUpdate_Call struct { + *mock.Call +} + +// SwarmUpdate is a helper method to define mock.On call +// - ctx context.Context +// - version swarm.Version +// - swarm1 swarm.Spec +// - flags swarm.UpdateFlags +func (_e *MockAPIClient_Expecter) SwarmUpdate(ctx any, version any, swarm1 any, flags any) *MockAPIClient_SwarmUpdate_Call { + return &MockAPIClient_SwarmUpdate_Call{Call: _e.mock.On("SwarmUpdate", ctx, version, swarm1, flags)} +} + +func (_c *MockAPIClient_SwarmUpdate_Call) Run(run func(ctx context.Context, version swarm.Version, swarm1 swarm.Spec, flags swarm.UpdateFlags)) *MockAPIClient_SwarmUpdate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 swarm.Version + if args[1] != nil { + arg1 = args[1].(swarm.Version) + } + var arg2 swarm.Spec + if args[2] != nil { + arg2 = args[2].(swarm.Spec) + } + var arg3 swarm.UpdateFlags + if args[3] != nil { + arg3 = args[3].(swarm.UpdateFlags) + } + run( + arg0, + arg1, + arg2, + arg3, + ) + }) + return _c +} + +func (_c *MockAPIClient_SwarmUpdate_Call) Return(err error) *MockAPIClient_SwarmUpdate_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockAPIClient_SwarmUpdate_Call) RunAndReturn(run func(ctx context.Context, version swarm.Version, swarm1 swarm.Spec, flags swarm.UpdateFlags) error) *MockAPIClient_SwarmUpdate_Call { + _c.Call.Return(run) + return _c +} + +// TaskInspectWithRaw provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) TaskInspectWithRaw(ctx context.Context, taskID string) (swarm.Task, []byte, error) { + ret := _mock.Called(ctx, taskID) + + if len(ret) == 0 { + panic("no return value specified for TaskInspectWithRaw") + } + + var r0 swarm.Task + var r1 []byte + var r2 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string) (swarm.Task, []byte, error)); ok { + return returnFunc(ctx, taskID) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, string) swarm.Task); ok { + r0 = returnFunc(ctx, taskID) + } else { + r0 = ret.Get(0).(swarm.Task) + } + if returnFunc, ok := ret.Get(1).(func(context.Context, string) []byte); ok { + r1 = returnFunc(ctx, taskID) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).([]byte) + } + } + if returnFunc, ok := ret.Get(2).(func(context.Context, string) error); ok { + r2 = returnFunc(ctx, taskID) + } else { + r2 = ret.Error(2) + } + return r0, r1, r2 +} + +// MockAPIClient_TaskInspectWithRaw_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TaskInspectWithRaw' +type MockAPIClient_TaskInspectWithRaw_Call struct { + *mock.Call +} + +// TaskInspectWithRaw is a helper method to define mock.On call +// - ctx context.Context +// - taskID string +func (_e *MockAPIClient_Expecter) TaskInspectWithRaw(ctx any, taskID any) *MockAPIClient_TaskInspectWithRaw_Call { + return &MockAPIClient_TaskInspectWithRaw_Call{Call: _e.mock.On("TaskInspectWithRaw", ctx, taskID)} +} + +func (_c *MockAPIClient_TaskInspectWithRaw_Call) Run(run func(ctx context.Context, taskID string)) *MockAPIClient_TaskInspectWithRaw_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockAPIClient_TaskInspectWithRaw_Call) Return(task swarm.Task, bytes []byte, err error) *MockAPIClient_TaskInspectWithRaw_Call { + _c.Call.Return(task, bytes, err) + return _c +} + +func (_c *MockAPIClient_TaskInspectWithRaw_Call) RunAndReturn(run func(ctx context.Context, taskID string) (swarm.Task, []byte, error)) *MockAPIClient_TaskInspectWithRaw_Call { + _c.Call.Return(run) + return _c +} + +// TaskList provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) TaskList(ctx context.Context, options swarm.TaskListOptions) ([]swarm.Task, error) { + ret := _mock.Called(ctx, options) + + if len(ret) == 0 { + panic("no return value specified for TaskList") + } + + var r0 []swarm.Task + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, swarm.TaskListOptions) ([]swarm.Task, error)); ok { + return returnFunc(ctx, options) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, swarm.TaskListOptions) []swarm.Task); ok { + r0 = returnFunc(ctx, options) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]swarm.Task) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, swarm.TaskListOptions) error); ok { + r1 = returnFunc(ctx, options) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_TaskList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TaskList' +type MockAPIClient_TaskList_Call struct { + *mock.Call +} + +// TaskList is a helper method to define mock.On call +// - ctx context.Context +// - options swarm.TaskListOptions +func (_e *MockAPIClient_Expecter) TaskList(ctx any, options any) *MockAPIClient_TaskList_Call { + return &MockAPIClient_TaskList_Call{Call: _e.mock.On("TaskList", ctx, options)} +} + +func (_c *MockAPIClient_TaskList_Call) Run(run func(ctx context.Context, options swarm.TaskListOptions)) *MockAPIClient_TaskList_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 swarm.TaskListOptions + if args[1] != nil { + arg1 = args[1].(swarm.TaskListOptions) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockAPIClient_TaskList_Call) Return(tasks []swarm.Task, err error) *MockAPIClient_TaskList_Call { + _c.Call.Return(tasks, err) + return _c +} + +func (_c *MockAPIClient_TaskList_Call) RunAndReturn(run func(ctx context.Context, options swarm.TaskListOptions) ([]swarm.Task, error)) *MockAPIClient_TaskList_Call { + _c.Call.Return(run) + return _c +} + +// TaskLogs provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) TaskLogs(ctx context.Context, taskID string, options container.LogsOptions) (io.ReadCloser, error) { + ret := _mock.Called(ctx, taskID, options) + + if len(ret) == 0 { + panic("no return value specified for TaskLogs") + } + + var r0 io.ReadCloser + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, container.LogsOptions) (io.ReadCloser, error)); ok { + return returnFunc(ctx, taskID, options) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, string, container.LogsOptions) io.ReadCloser); ok { + r0 = returnFunc(ctx, taskID, options) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(io.ReadCloser) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, string, container.LogsOptions) error); ok { + r1 = returnFunc(ctx, taskID, options) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_TaskLogs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TaskLogs' +type MockAPIClient_TaskLogs_Call struct { + *mock.Call +} + +// TaskLogs is a helper method to define mock.On call +// - ctx context.Context +// - taskID string +// - options container.LogsOptions +func (_e *MockAPIClient_Expecter) TaskLogs(ctx any, taskID any, options any) *MockAPIClient_TaskLogs_Call { + return &MockAPIClient_TaskLogs_Call{Call: _e.mock.On("TaskLogs", ctx, taskID, options)} +} + +func (_c *MockAPIClient_TaskLogs_Call) Run(run func(ctx context.Context, taskID string, options container.LogsOptions)) *MockAPIClient_TaskLogs_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 container.LogsOptions + if args[2] != nil { + arg2 = args[2].(container.LogsOptions) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockAPIClient_TaskLogs_Call) Return(readCloser io.ReadCloser, err error) *MockAPIClient_TaskLogs_Call { + _c.Call.Return(readCloser, err) + return _c +} + +func (_c *MockAPIClient_TaskLogs_Call) RunAndReturn(run func(ctx context.Context, taskID string, options container.LogsOptions) (io.ReadCloser, error)) *MockAPIClient_TaskLogs_Call { + _c.Call.Return(run) + return _c +} + +// VolumeCreate provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) VolumeCreate(ctx context.Context, options volume.CreateOptions) (volume.Volume, error) { + ret := _mock.Called(ctx, options) + + if len(ret) == 0 { + panic("no return value specified for VolumeCreate") + } + + var r0 volume.Volume + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, volume.CreateOptions) (volume.Volume, error)); ok { + return returnFunc(ctx, options) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, volume.CreateOptions) volume.Volume); ok { + r0 = returnFunc(ctx, options) + } else { + r0 = ret.Get(0).(volume.Volume) + } + if returnFunc, ok := ret.Get(1).(func(context.Context, volume.CreateOptions) error); ok { + r1 = returnFunc(ctx, options) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_VolumeCreate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'VolumeCreate' +type MockAPIClient_VolumeCreate_Call struct { + *mock.Call +} + +// VolumeCreate is a helper method to define mock.On call +// - ctx context.Context +// - options volume.CreateOptions +func (_e *MockAPIClient_Expecter) VolumeCreate(ctx any, options any) *MockAPIClient_VolumeCreate_Call { + return &MockAPIClient_VolumeCreate_Call{Call: _e.mock.On("VolumeCreate", ctx, options)} +} + +func (_c *MockAPIClient_VolumeCreate_Call) Run(run func(ctx context.Context, options volume.CreateOptions)) *MockAPIClient_VolumeCreate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 volume.CreateOptions + if args[1] != nil { + arg1 = args[1].(volume.CreateOptions) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockAPIClient_VolumeCreate_Call) Return(volume1 volume.Volume, err error) *MockAPIClient_VolumeCreate_Call { + _c.Call.Return(volume1, err) + return _c +} + +func (_c *MockAPIClient_VolumeCreate_Call) RunAndReturn(run func(ctx context.Context, options volume.CreateOptions) (volume.Volume, error)) *MockAPIClient_VolumeCreate_Call { + _c.Call.Return(run) + return _c +} + +// VolumeInspect provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) VolumeInspect(ctx context.Context, volumeID string) (volume.Volume, error) { + ret := _mock.Called(ctx, volumeID) + + if len(ret) == 0 { + panic("no return value specified for VolumeInspect") + } + + var r0 volume.Volume + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string) (volume.Volume, error)); ok { + return returnFunc(ctx, volumeID) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, string) volume.Volume); ok { + r0 = returnFunc(ctx, volumeID) + } else { + r0 = ret.Get(0).(volume.Volume) + } + if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = returnFunc(ctx, volumeID) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_VolumeInspect_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'VolumeInspect' +type MockAPIClient_VolumeInspect_Call struct { + *mock.Call +} + +// VolumeInspect is a helper method to define mock.On call +// - ctx context.Context +// - volumeID string +func (_e *MockAPIClient_Expecter) VolumeInspect(ctx any, volumeID any) *MockAPIClient_VolumeInspect_Call { + return &MockAPIClient_VolumeInspect_Call{Call: _e.mock.On("VolumeInspect", ctx, volumeID)} +} + +func (_c *MockAPIClient_VolumeInspect_Call) Run(run func(ctx context.Context, volumeID string)) *MockAPIClient_VolumeInspect_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockAPIClient_VolumeInspect_Call) Return(volume1 volume.Volume, err error) *MockAPIClient_VolumeInspect_Call { + _c.Call.Return(volume1, err) + return _c +} + +func (_c *MockAPIClient_VolumeInspect_Call) RunAndReturn(run func(ctx context.Context, volumeID string) (volume.Volume, error)) *MockAPIClient_VolumeInspect_Call { + _c.Call.Return(run) + return _c +} + +// VolumeInspectWithRaw provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) VolumeInspectWithRaw(ctx context.Context, volumeID string) (volume.Volume, []byte, error) { + ret := _mock.Called(ctx, volumeID) + + if len(ret) == 0 { + panic("no return value specified for VolumeInspectWithRaw") + } + + var r0 volume.Volume + var r1 []byte + var r2 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string) (volume.Volume, []byte, error)); ok { + return returnFunc(ctx, volumeID) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, string) volume.Volume); ok { + r0 = returnFunc(ctx, volumeID) + } else { + r0 = ret.Get(0).(volume.Volume) + } + if returnFunc, ok := ret.Get(1).(func(context.Context, string) []byte); ok { + r1 = returnFunc(ctx, volumeID) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).([]byte) + } + } + if returnFunc, ok := ret.Get(2).(func(context.Context, string) error); ok { + r2 = returnFunc(ctx, volumeID) + } else { + r2 = ret.Error(2) + } + return r0, r1, r2 +} + +// MockAPIClient_VolumeInspectWithRaw_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'VolumeInspectWithRaw' +type MockAPIClient_VolumeInspectWithRaw_Call struct { + *mock.Call +} + +// VolumeInspectWithRaw is a helper method to define mock.On call +// - ctx context.Context +// - volumeID string +func (_e *MockAPIClient_Expecter) VolumeInspectWithRaw(ctx any, volumeID any) *MockAPIClient_VolumeInspectWithRaw_Call { + return &MockAPIClient_VolumeInspectWithRaw_Call{Call: _e.mock.On("VolumeInspectWithRaw", ctx, volumeID)} +} + +func (_c *MockAPIClient_VolumeInspectWithRaw_Call) Run(run func(ctx context.Context, volumeID string)) *MockAPIClient_VolumeInspectWithRaw_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockAPIClient_VolumeInspectWithRaw_Call) Return(volume1 volume.Volume, bytes []byte, err error) *MockAPIClient_VolumeInspectWithRaw_Call { + _c.Call.Return(volume1, bytes, err) + return _c +} + +func (_c *MockAPIClient_VolumeInspectWithRaw_Call) RunAndReturn(run func(ctx context.Context, volumeID string) (volume.Volume, []byte, error)) *MockAPIClient_VolumeInspectWithRaw_Call { + _c.Call.Return(run) + return _c +} + +// VolumeList provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) VolumeList(ctx context.Context, options volume.ListOptions) (volume.ListResponse, error) { + ret := _mock.Called(ctx, options) + + if len(ret) == 0 { + panic("no return value specified for VolumeList") + } + + var r0 volume.ListResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, volume.ListOptions) (volume.ListResponse, error)); ok { + return returnFunc(ctx, options) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, volume.ListOptions) volume.ListResponse); ok { + r0 = returnFunc(ctx, options) + } else { + r0 = ret.Get(0).(volume.ListResponse) + } + if returnFunc, ok := ret.Get(1).(func(context.Context, volume.ListOptions) error); ok { + r1 = returnFunc(ctx, options) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_VolumeList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'VolumeList' +type MockAPIClient_VolumeList_Call struct { + *mock.Call +} + +// VolumeList is a helper method to define mock.On call +// - ctx context.Context +// - options volume.ListOptions +func (_e *MockAPIClient_Expecter) VolumeList(ctx any, options any) *MockAPIClient_VolumeList_Call { + return &MockAPIClient_VolumeList_Call{Call: _e.mock.On("VolumeList", ctx, options)} +} + +func (_c *MockAPIClient_VolumeList_Call) Run(run func(ctx context.Context, options volume.ListOptions)) *MockAPIClient_VolumeList_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 volume.ListOptions + if args[1] != nil { + arg1 = args[1].(volume.ListOptions) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockAPIClient_VolumeList_Call) Return(listResponse volume.ListResponse, err error) *MockAPIClient_VolumeList_Call { + _c.Call.Return(listResponse, err) + return _c +} + +func (_c *MockAPIClient_VolumeList_Call) RunAndReturn(run func(ctx context.Context, options volume.ListOptions) (volume.ListResponse, error)) *MockAPIClient_VolumeList_Call { + _c.Call.Return(run) + return _c +} + +// VolumeRemove provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) VolumeRemove(ctx context.Context, volumeID string, force bool) error { + ret := _mock.Called(ctx, volumeID, force) + + if len(ret) == 0 { + panic("no return value specified for VolumeRemove") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, bool) error); ok { + r0 = returnFunc(ctx, volumeID, force) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockAPIClient_VolumeRemove_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'VolumeRemove' +type MockAPIClient_VolumeRemove_Call struct { + *mock.Call +} + +// VolumeRemove is a helper method to define mock.On call +// - ctx context.Context +// - volumeID string +// - force bool +func (_e *MockAPIClient_Expecter) VolumeRemove(ctx any, volumeID any, force any) *MockAPIClient_VolumeRemove_Call { + return &MockAPIClient_VolumeRemove_Call{Call: _e.mock.On("VolumeRemove", ctx, volumeID, force)} +} + +func (_c *MockAPIClient_VolumeRemove_Call) Run(run func(ctx context.Context, volumeID string, force bool)) *MockAPIClient_VolumeRemove_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 bool + if args[2] != nil { + arg2 = args[2].(bool) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockAPIClient_VolumeRemove_Call) Return(err error) *MockAPIClient_VolumeRemove_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockAPIClient_VolumeRemove_Call) RunAndReturn(run func(ctx context.Context, volumeID string, force bool) error) *MockAPIClient_VolumeRemove_Call { + _c.Call.Return(run) + return _c +} + +// VolumeUpdate provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) VolumeUpdate(ctx context.Context, volumeID string, version swarm.Version, options volume.UpdateOptions) error { + ret := _mock.Called(ctx, volumeID, version, options) + + if len(ret) == 0 { + panic("no return value specified for VolumeUpdate") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, swarm.Version, volume.UpdateOptions) error); ok { + r0 = returnFunc(ctx, volumeID, version, options) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockAPIClient_VolumeUpdate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'VolumeUpdate' +type MockAPIClient_VolumeUpdate_Call struct { + *mock.Call +} + +// VolumeUpdate is a helper method to define mock.On call +// - ctx context.Context +// - volumeID string +// - version swarm.Version +// - options volume.UpdateOptions +func (_e *MockAPIClient_Expecter) VolumeUpdate(ctx any, volumeID any, version any, options any) *MockAPIClient_VolumeUpdate_Call { + return &MockAPIClient_VolumeUpdate_Call{Call: _e.mock.On("VolumeUpdate", ctx, volumeID, version, options)} +} + +func (_c *MockAPIClient_VolumeUpdate_Call) Run(run func(ctx context.Context, volumeID string, version swarm.Version, options volume.UpdateOptions)) *MockAPIClient_VolumeUpdate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 swarm.Version + if args[2] != nil { + arg2 = args[2].(swarm.Version) + } + var arg3 volume.UpdateOptions + if args[3] != nil { + arg3 = args[3].(volume.UpdateOptions) + } + run( + arg0, + arg1, + arg2, + arg3, + ) + }) + return _c +} + +func (_c *MockAPIClient_VolumeUpdate_Call) Return(err error) *MockAPIClient_VolumeUpdate_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockAPIClient_VolumeUpdate_Call) RunAndReturn(run func(ctx context.Context, volumeID string, version swarm.Version, options volume.UpdateOptions) error) *MockAPIClient_VolumeUpdate_Call { + _c.Call.Return(run) + return _c +} + +// VolumesPrune provides a mock function for the type MockAPIClient +func (_mock *MockAPIClient) VolumesPrune(ctx context.Context, pruneFilter filters.Args) (volume.PruneReport, error) { + ret := _mock.Called(ctx, pruneFilter) + + if len(ret) == 0 { + panic("no return value specified for VolumesPrune") + } + + var r0 volume.PruneReport + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, filters.Args) (volume.PruneReport, error)); ok { + return returnFunc(ctx, pruneFilter) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, filters.Args) volume.PruneReport); ok { + r0 = returnFunc(ctx, pruneFilter) + } else { + r0 = ret.Get(0).(volume.PruneReport) + } + if returnFunc, ok := ret.Get(1).(func(context.Context, filters.Args) error); ok { + r1 = returnFunc(ctx, pruneFilter) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockAPIClient_VolumesPrune_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'VolumesPrune' +type MockAPIClient_VolumesPrune_Call struct { + *mock.Call +} + +// VolumesPrune is a helper method to define mock.On call +// - ctx context.Context +// - pruneFilter filters.Args +func (_e *MockAPIClient_Expecter) VolumesPrune(ctx any, pruneFilter any) *MockAPIClient_VolumesPrune_Call { + return &MockAPIClient_VolumesPrune_Call{Call: _e.mock.On("VolumesPrune", ctx, pruneFilter)} +} + +func (_c *MockAPIClient_VolumesPrune_Call) Run(run func(ctx context.Context, pruneFilter filters.Args)) *MockAPIClient_VolumesPrune_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 filters.Args + if args[1] != nil { + arg1 = args[1].(filters.Args) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockAPIClient_VolumesPrune_Call) Return(pruneReport volume.PruneReport, err error) *MockAPIClient_VolumesPrune_Call { + _c.Call.Return(pruneReport, err) + return _c +} + +func (_c *MockAPIClient_VolumesPrune_Call) RunAndReturn(run func(ctx context.Context, pruneFilter filters.Args) (volume.PruneReport, error)) *MockAPIClient_VolumesPrune_Call { + _c.Call.Return(run) + return _c +} diff --git a/internal/machine/docker/server.go b/internal/machine/docker/server.go index 10bff2c1..6108528f 100644 --- a/internal/machine/docker/server.go +++ b/internal/machine/docker/server.go @@ -56,7 +56,7 @@ var fullDockerIDRegex = regexp.MustCompile(`^[a-f0-9]{64}$`) // Server implements the gRPC Docker service that proxies requests to the Docker daemon. type Server struct { pb.UnimplementedDockerServer - client *client.Client + client client.APIClient service *Service db *sqlx.DB // internalDNSIP is a function that returns the IP address of the internal DNS server. It may return an empty @@ -349,6 +349,41 @@ func (s *Server) InspectImage(ctx context.Context, req *pb.InspectImageRequest) }, nil } +// RemoveImage removes an image while protecting names used by containers, even when force is requested. +func (s *Server) RemoveImage(ctx context.Context, req *pb.RemoveImageRequest) (*pb.RemoveImageResponse, error) { + opts := image.RemoveOptions{Force: req.Force, PruneChildren: req.PruneChildren} + for _, platform := range req.Platforms { + opts.Platforms = append(opts.Platforms, ocispec.Platform{ + Architecture: platform.Architecture, + OS: platform.Os, + OSVersion: platform.OsVersion, + OSFeatures: platform.OsFeatures, + Variant: platform.Variant, + }) + } + + removals, err := s.service.RemoveImage(ctx, req.Id, opts) + if err != nil { + switch { + case errdefs.IsNotFound(err): + return nil, status.Error(codes.NotFound, err.Error()) + case errdefs.IsConflict(err): + return nil, status.Error(codes.FailedPrecondition, err.Error()) + case errdefs.IsInvalidArgument(err): + return nil, status.Error(codes.InvalidArgument, err.Error()) + default: + return nil, status.Error(codes.Internal, err.Error()) + } + } + + result := &pb.MachineImageRemoval{} + for _, removal := range removals { + result.Results = append(result.Results, &pb.ImageRemoval{Deleted: removal.Deleted, Untagged: removal.Untagged}) + } + + return &pb.RemoveImageResponse{Messages: []*pb.MachineImageRemoval{result}}, nil +} + // InspectRemoteImage returns the image metadata for an image in a remote registry using the machine's Docker auth // credentials if necessary. func (s *Server) InspectRemoteImage( diff --git a/internal/machine/docker/service.go b/internal/machine/docker/service.go index e20f95a9..d4e5cd94 100644 --- a/internal/machine/docker/service.go +++ b/internal/machine/docker/service.go @@ -31,13 +31,13 @@ import ( // from the machine database. type Service struct { // Client is a Docker client for managing Docker resources. - Client *client.Client + Client client.APIClient // db is a connection to the machine database. db *sqlx.DB } // NewService creates a new Docker service instance. -func NewService(client *client.Client, db *sqlx.DB) *Service { +func NewService(client client.APIClient, db *sqlx.DB) *Service { return &Service{ Client: client, db: db, diff --git a/mise.lock b/mise.lock index 014f5c96..e63f6998 100644 --- a/mise.lock +++ b/mise.lock @@ -1,36 +1,43 @@ # @generated - this file is auto-generated by `mise lock` https://mise.jdx.dev/dev-tools/mise-lock.html [[tools."aqua:vektra/mockery"]] -version = "3.5.3" +version = "3.8.1" backend = "aqua:vektra/mockery" [tools."aqua:vektra/mockery"."platforms.linux-arm64"] -checksum = "sha256:ec02ca72b7ad1ff5a1de5503a27d3b1b3f230d722eb35c5b92e43e295a8e1290" -url = "https://github.com/vektra/mockery/releases/download/v3.5.3/mockery_3.5.3_Linux_arm64.tar.gz" +checksum = "sha256:d1f481f3a6e9868dd3ad65da265238ee109ab3a5dd7508958d5811953696f452" +url = "https://github.com/vektra/mockery/releases/download/v3.8.1/mockery_3.8.1_Linux_arm64.tar.gz" +url_api = "https://api.github.com/repos/vektra/mockery/releases/assets/632915757" [tools."aqua:vektra/mockery"."platforms.linux-arm64-musl"] -checksum = "sha256:ec02ca72b7ad1ff5a1de5503a27d3b1b3f230d722eb35c5b92e43e295a8e1290" -url = "https://github.com/vektra/mockery/releases/download/v3.5.3/mockery_3.5.3_Linux_arm64.tar.gz" +checksum = "sha256:d1f481f3a6e9868dd3ad65da265238ee109ab3a5dd7508958d5811953696f452" +url = "https://github.com/vektra/mockery/releases/download/v3.8.1/mockery_3.8.1_Linux_arm64.tar.gz" +url_api = "https://api.github.com/repos/vektra/mockery/releases/assets/632915757" [tools."aqua:vektra/mockery"."platforms.linux-x64"] -checksum = "sha256:ebce416b0175338525246c376885a1579ca6cd4d4015140ba0c70e6b5339a39c" -url = "https://github.com/vektra/mockery/releases/download/v3.5.3/mockery_3.5.3_Linux_x86_64.tar.gz" +checksum = "sha256:953c7d38b58dd6398b1c595f27caf8bbf27e9b733b49c404d2e124e86d2ae72a" +url = "https://github.com/vektra/mockery/releases/download/v3.8.1/mockery_3.8.1_Linux_x86_64.tar.gz" +url_api = "https://api.github.com/repos/vektra/mockery/releases/assets/632915756" [tools."aqua:vektra/mockery"."platforms.linux-x64-musl"] -checksum = "sha256:ebce416b0175338525246c376885a1579ca6cd4d4015140ba0c70e6b5339a39c" -url = "https://github.com/vektra/mockery/releases/download/v3.5.3/mockery_3.5.3_Linux_x86_64.tar.gz" +checksum = "sha256:953c7d38b58dd6398b1c595f27caf8bbf27e9b733b49c404d2e124e86d2ae72a" +url = "https://github.com/vektra/mockery/releases/download/v3.8.1/mockery_3.8.1_Linux_x86_64.tar.gz" +url_api = "https://api.github.com/repos/vektra/mockery/releases/assets/632915756" [tools."aqua:vektra/mockery"."platforms.macos-arm64"] -checksum = "sha256:a3a94b14c7414e148f2252199ffc4a0108d311358f3d336cbe05bb73cb203704" -url = "https://github.com/vektra/mockery/releases/download/v3.5.3/mockery_3.5.3_Darwin_arm64.tar.gz" +checksum = "sha256:303a794484243906b37da0c37056f974bf94278c2e10d7b1372e6bd53a2d5034" +url = "https://github.com/vektra/mockery/releases/download/v3.8.1/mockery_3.8.1_Darwin_arm64.tar.gz" +url_api = "https://api.github.com/repos/vektra/mockery/releases/assets/632915806" [tools."aqua:vektra/mockery"."platforms.macos-x64"] -checksum = "sha256:8bd2b3e4722e476400395920fb5bbd68be4ea22ec12cddf1e424c40610fda863" -url = "https://github.com/vektra/mockery/releases/download/v3.5.3/mockery_3.5.3_Darwin_x86_64.tar.gz" +checksum = "sha256:6882331344e946268b304dce042b01371a0213a896536413be8abe49d532ca6f" +url = "https://github.com/vektra/mockery/releases/download/v3.8.1/mockery_3.8.1_Darwin_x86_64.tar.gz" +url_api = "https://api.github.com/repos/vektra/mockery/releases/assets/632915746" [tools."aqua:vektra/mockery"."platforms.windows-x64"] -checksum = "sha256:3b4264066db615a56a8b59abda992f6db82b8cd7666937ed9dd8f4a4bfc424a0" -url = "https://github.com/vektra/mockery/releases/download/v3.5.3/mockery_3.5.3_Windows_x86_64.tar.gz" +checksum = "sha256:7a7458756e9d7bce5f9936b7a63394000f3affa751b9740e65350c4bdcb627dc" +url = "https://github.com/vektra/mockery/releases/download/v3.8.1/mockery_3.8.1_Windows_x86_64.tar.gz" +url_api = "https://api.github.com/repos/vektra/mockery/releases/assets/632915759" [[tools.go]] version = "1.26.1" @@ -71,32 +78,44 @@ backend = "aqua:golangci/golangci-lint" [tools.golangci-lint."platforms.linux-arm64"] checksum = "sha256:c3c83c7ed003e881991af21361c487151abd37969927ed9062cd0b48f3cd1d8d" url = "https://github.com/golangci/golangci-lint/releases/download/v2.11.2/golangci-lint-2.11.2-linux-arm64.tar.gz" +url_api = "https://api.github.com/repos/golangci/golangci-lint/releases/assets/369099658" +provenance = "github-attestations" [tools.golangci-lint."platforms.linux-arm64-musl"] checksum = "sha256:c3c83c7ed003e881991af21361c487151abd37969927ed9062cd0b48f3cd1d8d" url = "https://github.com/golangci/golangci-lint/releases/download/v2.11.2/golangci-lint-2.11.2-linux-arm64.tar.gz" +url_api = "https://api.github.com/repos/golangci/golangci-lint/releases/assets/369099658" +provenance = "github-attestations" [tools.golangci-lint."platforms.linux-x64"] checksum = "sha256:852741ea769f4543ab4b6cf86b313cb7173f2e8d2d39f00eb0cd5ef5d4d5eda9" url = "https://github.com/golangci/golangci-lint/releases/download/v2.11.2/golangci-lint-2.11.2-linux-amd64.tar.gz" +url_api = "https://api.github.com/repos/golangci/golangci-lint/releases/assets/369099674" provenance = "github-attestations" [tools.golangci-lint."platforms.linux-x64-musl"] checksum = "sha256:852741ea769f4543ab4b6cf86b313cb7173f2e8d2d39f00eb0cd5ef5d4d5eda9" url = "https://github.com/golangci/golangci-lint/releases/download/v2.11.2/golangci-lint-2.11.2-linux-amd64.tar.gz" +url_api = "https://api.github.com/repos/golangci/golangci-lint/releases/assets/369099674" +provenance = "github-attestations" [tools.golangci-lint."platforms.macos-arm64"] checksum = "sha256:11e9549b955bae4bfb71aa3b5c2762e446e2d3f975fe963d6d767b8f745d9344" url = "https://github.com/golangci/golangci-lint/releases/download/v2.11.2/golangci-lint-2.11.2-darwin-arm64.tar.gz" +url_api = "https://api.github.com/repos/golangci/golangci-lint/releases/assets/369099671" provenance = "github-attestations" [tools.golangci-lint."platforms.macos-x64"] checksum = "sha256:1dbbbe745eadba9cf012d49bd0b8c9290cbcb50dbf2cf9611f75a715b46ae3af" url = "https://github.com/golangci/golangci-lint/releases/download/v2.11.2/golangci-lint-2.11.2-darwin-amd64.tar.gz" +url_api = "https://api.github.com/repos/golangci/golangci-lint/releases/assets/369099653" +provenance = "github-attestations" [tools.golangci-lint."platforms.windows-x64"] checksum = "sha256:60e50178253d276d1c808ef00845eddcabca63b7d69d86a6dbaa41e88bc843f3" url = "https://github.com/golangci/golangci-lint/releases/download/v2.11.2/golangci-lint-2.11.2-windows-amd64.zip" +url_api = "https://api.github.com/repos/golangci/golangci-lint/releases/assets/369099651" +provenance = "github-attestations" [[tools.goreleaser]] version = "2.15.2" @@ -105,37 +124,44 @@ backend = "aqua:goreleaser/goreleaser" [tools.goreleaser."platforms.linux-arm64"] checksum = "sha256:5db66761a98f6693161e49e1a95d28d2673a892ba60cb4a5e16736cafd41c4c9" url = "https://github.com/goreleaser/goreleaser/releases/download/v2.15.2/goreleaser_Linux_arm64.tar.gz" -provenance = "cosign" +url_api = "https://api.github.com/repos/goreleaser/goreleaser/releases/assets/385702105" +provenance = "github-attestations" [tools.goreleaser."platforms.linux-arm64-musl"] checksum = "sha256:5db66761a98f6693161e49e1a95d28d2673a892ba60cb4a5e16736cafd41c4c9" url = "https://github.com/goreleaser/goreleaser/releases/download/v2.15.2/goreleaser_Linux_arm64.tar.gz" -provenance = "cosign" +url_api = "https://api.github.com/repos/goreleaser/goreleaser/releases/assets/385702105" +provenance = "github-attestations" [tools.goreleaser."platforms.linux-x64"] checksum = "sha256:0ebdbf0353aba566b969dde746cc4e4806f96c27aa2f3971b229a9df7611fedc" url = "https://github.com/goreleaser/goreleaser/releases/download/v2.15.2/goreleaser_Linux_x86_64.tar.gz" +url_api = "https://api.github.com/repos/goreleaser/goreleaser/releases/assets/385702106" provenance = "github-attestations" [tools.goreleaser."platforms.linux-x64-musl"] checksum = "sha256:0ebdbf0353aba566b969dde746cc4e4806f96c27aa2f3971b229a9df7611fedc" url = "https://github.com/goreleaser/goreleaser/releases/download/v2.15.2/goreleaser_Linux_x86_64.tar.gz" -provenance = "cosign" +url_api = "https://api.github.com/repos/goreleaser/goreleaser/releases/assets/385702106" +provenance = "github-attestations" [tools.goreleaser."platforms.macos-arm64"] checksum = "sha256:0e6bd67688ac949780bf1166813a91f89856898ef4c40d7d46c2c74ebaa4b9ee" url = "https://github.com/goreleaser/goreleaser/releases/download/v2.15.2/goreleaser_Darwin_all.tar.gz" +url_api = "https://api.github.com/repos/goreleaser/goreleaser/releases/assets/385702148" provenance = "github-attestations" [tools.goreleaser."platforms.macos-x64"] checksum = "sha256:0e6bd67688ac949780bf1166813a91f89856898ef4c40d7d46c2c74ebaa4b9ee" url = "https://github.com/goreleaser/goreleaser/releases/download/v2.15.2/goreleaser_Darwin_all.tar.gz" -provenance = "cosign" +url_api = "https://api.github.com/repos/goreleaser/goreleaser/releases/assets/385702148" +provenance = "github-attestations" [tools.goreleaser."platforms.windows-x64"] checksum = "sha256:7459832946dbe122c144f8d7f87484d8572ca005b779310aa6bb03346e8de17a" url = "https://github.com/goreleaser/goreleaser/releases/download/v2.15.2/goreleaser_Windows_x86_64.zip" -provenance = "cosign" +url_api = "https://api.github.com/repos/goreleaser/goreleaser/releases/assets/385702135" +provenance = "github-attestations" [[tools.node]] version = "22.20.0" @@ -146,16 +172,17 @@ checksum = "sha256:4181609e03dcb9880e7e5bf956061ecc0503c77a480c6631d868cb1f65a2c url = "https://nodejs.org/dist/v22.20.0/node-v22.20.0-linux-arm64.tar.gz" [tools.node."platforms.linux-arm64-musl"] -checksum = "sha256:4181609e03dcb9880e7e5bf956061ecc0503c77a480c6631d868cb1f65a2c7dd" -url = "https://nodejs.org/dist/v22.20.0/node-v22.20.0-linux-arm64.tar.gz" +checksum = "sha256:79a087c1e23fc97d173ad6676df5b1a4e1a02daf1acca05ee25662747c5d492c" +url = "https://nodejs.org/dist/v22.20.0/node-v22.20.0.tar.gz" +install = "source" [tools.node."platforms.linux-x64"] checksum = "sha256:eeaccb0378b79406f2208e8b37a62479c70595e20be6b659125eb77dd1ab2a29" url = "https://nodejs.org/dist/v22.20.0/node-v22.20.0-linux-x64.tar.gz" [tools.node."platforms.linux-x64-musl"] -checksum = "sha256:eeaccb0378b79406f2208e8b37a62479c70595e20be6b659125eb77dd1ab2a29" -url = "https://nodejs.org/dist/v22.20.0/node-v22.20.0-linux-x64.tar.gz" +checksum = "sha256:461aafed5eb607357479c6de5df978515d74daf7e0169e972e61c8390c035f1a" +url = "https://unofficial-builds.nodejs.org/download/release/v22.20.0/node-v22.20.0-linux-x64-musl.tar.gz" [tools.node."platforms.macos-arm64"] checksum = "sha256:cc04a76a09f79290194c0646f48fec40354d88969bec467789a5d55dd097f949" @@ -173,9 +200,34 @@ url = "https://nodejs.org/dist/v22.20.0/node-v22.20.0-win-x64.zip" version = "27.3" backend = "aqua:protocolbuffers/protobuf/protoc" +[tools.protoc."platforms.linux-arm64"] +url = "https://github.com/protocolbuffers/protobuf/releases/download/v27.3/protoc-27.3-linux-aarch_64.zip" +url_api = "https://api.github.com/repos/protocolbuffers/protobuf/releases/assets/183006374" + +[tools.protoc."platforms.linux-arm64-musl"] +url = "https://github.com/protocolbuffers/protobuf/releases/download/v27.3/protoc-27.3-linux-aarch_64.zip" +url_api = "https://api.github.com/repos/protocolbuffers/protobuf/releases/assets/183006374" + [tools.protoc."platforms.linux-x64"] checksum = "blake3:8c2938accf7061164ea3968529a47ced1db4824ca553857f6903c68ae4347739" url = "https://github.com/protocolbuffers/protobuf/releases/download/v27.3/protoc-27.3-linux-x86_64.zip" +url_api = "https://api.github.com/repos/protocolbuffers/protobuf/releases/assets/183006380" + +[tools.protoc."platforms.linux-x64-musl"] +url = "https://github.com/protocolbuffers/protobuf/releases/download/v27.3/protoc-27.3-linux-x86_64.zip" +url_api = "https://api.github.com/repos/protocolbuffers/protobuf/releases/assets/183006380" + +[tools.protoc."platforms.macos-arm64"] +url = "https://github.com/protocolbuffers/protobuf/releases/download/v27.3/protoc-27.3-osx-aarch_64.zip" +url_api = "https://api.github.com/repos/protocolbuffers/protobuf/releases/assets/183006383" + +[tools.protoc."platforms.macos-x64"] +url = "https://github.com/protocolbuffers/protobuf/releases/download/v27.3/protoc-27.3-osx-x86_64.zip" +url_api = "https://api.github.com/repos/protocolbuffers/protobuf/releases/assets/183006381" + +[tools.protoc."platforms.windows-x64"] +url = "https://github.com/protocolbuffers/protobuf/releases/download/v27.3/protoc-27.3-win64.zip" +url_api = "https://api.github.com/repos/protocolbuffers/protobuf/releases/assets/183006385" [[tools.protoc-gen-go]] version = "1.34.2" @@ -183,30 +235,62 @@ backend = "aqua:protocolbuffers/protobuf-go/protoc-gen-go" [tools.protoc-gen-go."platforms.linux-arm64"] url = "https://github.com/protocolbuffers/protobuf-go/releases/download/v1.34.2/protoc-gen-go.v1.34.2.linux.arm64.tar.gz" +url_api = "https://api.github.com/repos/protocolbuffers/protobuf-go/releases/assets/173109690" [tools.protoc-gen-go."platforms.linux-arm64-musl"] url = "https://github.com/protocolbuffers/protobuf-go/releases/download/v1.34.2/protoc-gen-go.v1.34.2.linux.arm64.tar.gz" +url_api = "https://api.github.com/repos/protocolbuffers/protobuf-go/releases/assets/173109690" [tools.protoc-gen-go."platforms.linux-x64"] checksum = "blake3:f765e393e0f0b25070c13848d88f5e6303e66090132afa1b753e981507a4174e" url = "https://github.com/protocolbuffers/protobuf-go/releases/download/v1.34.2/protoc-gen-go.v1.34.2.linux.amd64.tar.gz" +url_api = "https://api.github.com/repos/protocolbuffers/protobuf-go/releases/assets/173109692" [tools.protoc-gen-go."platforms.linux-x64-musl"] url = "https://github.com/protocolbuffers/protobuf-go/releases/download/v1.34.2/protoc-gen-go.v1.34.2.linux.amd64.tar.gz" +url_api = "https://api.github.com/repos/protocolbuffers/protobuf-go/releases/assets/173109692" [tools.protoc-gen-go."platforms.macos-arm64"] url = "https://github.com/protocolbuffers/protobuf-go/releases/download/v1.34.2/protoc-gen-go.v1.34.2.darwin.arm64.tar.gz" +url_api = "https://api.github.com/repos/protocolbuffers/protobuf-go/releases/assets/173109697" [tools.protoc-gen-go."platforms.macos-x64"] url = "https://github.com/protocolbuffers/protobuf-go/releases/download/v1.34.2/protoc-gen-go.v1.34.2.darwin.amd64.tar.gz" +url_api = "https://api.github.com/repos/protocolbuffers/protobuf-go/releases/assets/173109698" [tools.protoc-gen-go."platforms.windows-x64"] url = "https://github.com/protocolbuffers/protobuf-go/releases/download/v1.34.2/protoc-gen-go.v1.34.2.windows.amd64.zip" +url_api = "https://api.github.com/repos/protocolbuffers/protobuf-go/releases/assets/173109685" [[tools.protoc-gen-go-grpc]] version = "1.5.1" backend = "aqua:grpc/grpc-go/protoc-gen-go-grpc" +[tools.protoc-gen-go-grpc."platforms.linux-arm64"] +url = "https://github.com/grpc/grpc-go/releases/download/cmd/protoc-gen-go-grpc/v1.5.1/protoc-gen-go-grpc.v1.5.1.linux.arm64.tar.gz" +url_api = "https://api.github.com/repos/grpc/grpc-go/releases/assets/182572238" + +[tools.protoc-gen-go-grpc."platforms.linux-arm64-musl"] +url = "https://github.com/grpc/grpc-go/releases/download/cmd/protoc-gen-go-grpc/v1.5.1/protoc-gen-go-grpc.v1.5.1.linux.arm64.tar.gz" +url_api = "https://api.github.com/repos/grpc/grpc-go/releases/assets/182572238" + [tools.protoc-gen-go-grpc."platforms.linux-x64"] checksum = "blake3:197739132f0408f017d0c83773ac1ace85c0572473fdd658ec6e4ccbf20e0552" url = "https://github.com/grpc/grpc-go/releases/download/cmd/protoc-gen-go-grpc/v1.5.1/protoc-gen-go-grpc.v1.5.1.linux.amd64.tar.gz" +url_api = "https://api.github.com/repos/grpc/grpc-go/releases/assets/182572229" + +[tools.protoc-gen-go-grpc."platforms.linux-x64-musl"] +url = "https://github.com/grpc/grpc-go/releases/download/cmd/protoc-gen-go-grpc/v1.5.1/protoc-gen-go-grpc.v1.5.1.linux.amd64.tar.gz" +url_api = "https://api.github.com/repos/grpc/grpc-go/releases/assets/182572229" + +[tools.protoc-gen-go-grpc."platforms.macos-arm64"] +url = "https://github.com/grpc/grpc-go/releases/download/cmd/protoc-gen-go-grpc/v1.5.1/protoc-gen-go-grpc.v1.5.1.darwin.arm64.tar.gz" +url_api = "https://api.github.com/repos/grpc/grpc-go/releases/assets/182572243" + +[tools.protoc-gen-go-grpc."platforms.macos-x64"] +url = "https://github.com/grpc/grpc-go/releases/download/cmd/protoc-gen-go-grpc/v1.5.1/protoc-gen-go-grpc.v1.5.1.darwin.amd64.tar.gz" +url_api = "https://api.github.com/repos/grpc/grpc-go/releases/assets/182572208" + +[tools.protoc-gen-go-grpc."platforms.windows-x64"] +url = "https://github.com/grpc/grpc-go/releases/download/cmd/protoc-gen-go-grpc/v1.5.1/protoc-gen-go-grpc.v1.5.1.windows.amd64.tar.gz" +url_api = "https://api.github.com/repos/grpc/grpc-go/releases/assets/182572216" diff --git a/mise.toml b/mise.toml index 643d0f45..4e8f64c7 100644 --- a/mise.toml +++ b/mise.toml @@ -2,7 +2,7 @@ experimental = true [tools] -"aqua:vektra/mockery" = "3.5.3" +"aqua:vektra/mockery" = "3.8.1" go = "1.26.1" golangci-lint = "2.11.2" goreleaser = "2.15.2" @@ -40,6 +40,10 @@ outputs = ["uncloudd-linux-arm64"] description = "Update mise.lock with hashes for all platforms" run = "mise lock --platform linux-x64,macos-arm64" +[tasks.mocks] +description = "Regenerate Go test mocks" +run = "mockery" + [tasks.proto] description = "Regenerate gRPC API code from .proto files" run = """ diff --git a/pkg/api/client.go b/pkg/api/client.go index 8276dcf5..7f439396 100644 --- a/pkg/api/client.go +++ b/pkg/api/client.go @@ -42,6 +42,8 @@ type DNSClient interface { type ImageClient interface { InspectImage(ctx context.Context, id string) ([]MachineImage, error) InspectRemoteImage(ctx context.Context, id string) ([]MachineRemoteImage, error) + ListImages(ctx context.Context, filter ImageFilter) ([]MachineImages, error) + RemoveImage(ctx context.Context, image string, opts RemoveImageOptions) ([]MachineImageRemoval, error) } type LogsClient interface { diff --git a/pkg/api/image.go b/pkg/api/image.go index 89105868..8e5509e2 100644 --- a/pkg/api/image.go +++ b/pkg/api/image.go @@ -32,26 +32,16 @@ type ImageFilter struct { Name string } -// ImageReferences returns the image tag and named digest references, sorted and without duplicates. -// References use familiar names such as "alpine:latest" and "alpine@sha256:...". -// Bare digests and invalid references are excluded. It returns nil if there are no named references. -func ImageReferences(img image.Summary) []string { - var refs []string - for _, names := range [][]string{img.RepoTags, img.RepoDigests} { - for _, name := range names { - ref, err := reference.ParseAnyReference(name) - if err != nil { - continue - } - // RepoDigests can contain bare digests. Keep only references with a repository name. - if named, ok := ref.(reference.Named); ok { - refs = append(refs, reference.FamiliarString(named)) - } - } - } +// RemoveImageOptions defines options for removing an image from cluster machines. +type RemoveImageOptions struct { + // Machines selects machines to remove the image from (names or IDs). If empty, all cluster machines are selected. + Machines []string +} - slices.Sort(refs) - return slices.Compact(refs) +// MachineImageRemoval contains the outcome of removing an image on one machine. +type MachineImageRemoval struct { + Metadata *pb.Metadata + Results []image.DeleteResponse } // MachineRemoteImage represents an image in a remote registry fetched by a particular machine. diff --git a/pkg/client/image.go b/pkg/client/image.go index e6e83496..300275b5 100644 --- a/pkg/client/image.go +++ b/pkg/client/image.go @@ -23,9 +23,11 @@ import ( "github.com/docker/docker/api/types/image" dockerclient "github.com/docker/docker/client" "github.com/docker/docker/pkg/jsonmessage" + "github.com/docker/docker/pkg/stringid" "github.com/docker/go-connections/nat" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/psviderski/uncloud/api/pb" + cliprogress "github.com/psviderski/uncloud/internal/cli/progress" "github.com/psviderski/uncloud/internal/cli/tui" "github.com/psviderski/uncloud/internal/docker" "github.com/psviderski/uncloud/internal/machine/constants" @@ -34,6 +36,8 @@ import ( "github.com/psviderski/uncloud/internal/secret" "github.com/psviderski/uncloud/pkg/api" netproxy "golang.org/x/net/proxy" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" ) // This is the container image used to run socat proxy containers. @@ -104,6 +108,80 @@ func (cli *Client) ListImages(ctx context.Context, filter api.ImageFilter) ([]ap return machineImages, nil } +// RemoveImage removes one exact image name or ID on the selected machines with protection of used references. +// Results include the outcome of removing an image on each machine. +// +// An absent image on some machines is normal if removal succeeds on at least one machine. If every selected machine +// reports NotFound, the returned error is api.ErrNotFound. Other machine failures are combined, with successful +// results still returned. +func (cli *Client) RemoveImage( + ctx context.Context, imageNameOrID string, opts api.RemoveImageOptions, +) ([]api.MachineImageRemoval, error) { + if strings.TrimSpace(imageNameOrID) == "" { + return nil, errors.New("image name or ID is required") + } + + resp, err := cli.Docker.GRPCClient.RemoveImage(ProxyMachinesContext(ctx, opts.Machines), + &pb.RemoveImageRequest{Id: imageNameOrID, PruneChildren: true}) + if err != nil { + return nil, err + } + + pw := progress.ContextWriter(ctx) + var results []api.MachineImageRemoval + var errs []error + notFoundCount := 0 + for _, msg := range resp.Messages { + result := api.MachineImageRemoval{Metadata: msg.Metadata} + for _, removal := range msg.Results { + result.Results = append(result.Results, image.DeleteResponse{ + Deleted: removal.Deleted, + Untagged: removal.Untagged, + }) + } + results = append(results, result) + + eventID := cliprogress.ImageEventID(imageNameOrID, msg.Metadata.MachineName) + if err = result.Metadata.Err(); err != nil { + event := progress.NewEvent(eventID, progress.Done, "Not found") + if status.Code(err) == codes.NotFound { + notFoundCount++ + } else { + errs = append(errs, fmt.Errorf("machine '%s': %w", msg.Metadata.MachineName, err)) + event.Status = progress.Error + event.StatusText = status.Convert(err).Message() + } + pw.Event(event) + continue + } + + // An unnamed image can return Deleted without Untagged. Use the requested name or ID as its row fallback. + deleted := false + for _, removal := range result.Results { + if removal.Untagged != "" { + eventID = cliprogress.ImageEventID(removal.Untagged, msg.Metadata.MachineName) + pw.Event(progress.NewEvent(eventID, progress.Done, "Untagged")) + } + if removal.Deleted != "" && !deleted { + // Docker reports the deletion of the selected image before any pruned parents or released layers. + // Only that first deletion updates the last untagged row marking the image as Removed. + deleted = true + pw.Event(progress.NewEvent(eventID, progress.Done, + fmt.Sprintf("Removed (%s)", stringid.TruncateID(removal.Deleted)))) + } + } + } + + if err = errors.Join(errs...); err != nil { + return results, err + } + if notFoundCount == len(results) { + return results, api.ErrNotFound + } + + return results, nil +} + // TODO: move PushImageOptions to api package and include PushImage in ImageClient interface. type PushImageOptions struct { // AllMachines pushes the image to all machines in the cluster. Takes precedence over Machines field. diff --git a/test/e2e/service_test.go b/test/e2e/service_test.go index 1664d363..4f4c4993 100644 --- a/test/e2e/service_test.go +++ b/test/e2e/service_test.go @@ -14,6 +14,7 @@ import ( "time" "github.com/docker/docker/api/types/container" + "github.com/docker/docker/api/types/image" "github.com/docker/docker/api/types/mount" "github.com/docker/docker/api/types/volume" "github.com/docker/go-units" @@ -1265,10 +1266,10 @@ myapp.example.com { "Containers should be on machines where the volume exists") }) - t.Run("list images for replicated service", func(t *testing.T) { + t.Run("image lifecycle for replicated service", func(t *testing.T) { t.Parallel() - serviceName := "test-list-images-replicated" + serviceName := "test-image-lifecycle-replicated" uniqueImage := "portainer/pause:3.9" // Unique image not used by other tests. t.Cleanup(func() { err := cli.RemoveService(ctx, serviceName) @@ -1301,39 +1302,59 @@ myapp.example.com { machinesWithContainers := serviceMachines(svc) assert.Len(t, machinesWithContainers.ToSlice(), 2, "Containers should be on 2 different machines") - var machineWithoutContainer string - for _, m := range c.Machines { - if !machinesWithContainers.Contains(m.ID) { - machineWithoutContainer = m.ID - break - } - } - assert.NotEmpty(t, machineWithoutContainer, "Should have found a machine without container") - - machineImages, err := cli.ListImages(ctx, api.ImageFilter{}) + machineImages, err := cli.ListImages(ctx, api.ImageFilter{Name: uniqueImage}) require.NoError(t, err) - assert.Len(t, machineImages, 3, "Should get images from all 3 machines") + require.Len(t, machineImages, len(c.Machines)) for _, mi := range machineImages { - // Checking only DockerImages because the machines in ucind cluster don't use the containerd image store. + require.NoError(t, mi.Metadata.Err()) if !machinesWithContainers.Contains(mi.Metadata.MachineId) { - // This is the machine without service containers, it should not have the unique image. - for _, img := range mi.Images { - assert.NotContains(t, img.RepoTags, uniqueImage) - } + assert.Empty(t, mi.Images) continue } - // Check if the unique image is present on the machine where a service container is running. - hasImage := false - for _, img := range mi.Images { - if slices.Contains(img.RepoTags, uniqueImage) { - hasImage = true - break - } + require.Len(t, mi.Images, 1) + assert.Contains(t, mi.Images[0].RepoTags, uniqueImage) + } + + // The used tag must remain on both machines while their service containers exist. + results, err := cli.RemoveImage(ctx, uniqueImage, api.RemoveImageOptions{Machines: spec.Placement.Machines}) + require.Error(t, err) + assert.ErrorContains(t, err, "used by container") + require.Len(t, results, 2) + for _, result := range results { + assert.Equal(t, codes.FailedPrecondition, status.Code(result.Metadata.Err())) + } + + require.NoError(t, cli.RemoveService(ctx, serviceName)) + + // Broadcast removal after deleting the containers. Absence on the third machine is not an overall error. + results, err = cli.RemoveImage(ctx, uniqueImage, api.RemoveImageOptions{}) + require.NoError(t, err) + require.Len(t, results, len(c.Machines)) + for _, result := range results { + if !machinesWithContainers.Contains(result.Metadata.MachineId) { + assert.Equal(t, codes.NotFound, status.Code(result.Metadata.Err())) + continue } - assert.True(t, hasImage, "Machine %s with container should have image %s", - mi.Metadata.MachineId, uniqueImage) + require.NoError(t, result.Metadata.Err()) + assert.Contains(t, result.Results, image.DeleteResponse{Untagged: uniqueImage}) + } + + results, err = cli.RemoveImage(ctx, uniqueImage, api.RemoveImageOptions{}) + require.ErrorIs(t, err, api.ErrNotFound) + require.Len(t, results, len(c.Machines)) + for _, result := range results { + assert.Equal(t, codes.NotFound, status.Code(result.Metadata.Err())) + assert.Empty(t, result.Results) + } + + machineImages, err = cli.ListImages(ctx, api.ImageFilter{Name: uniqueImage}) + require.NoError(t, err) + require.Len(t, machineImages, len(c.Machines)) + for _, mi := range machineImages { + require.NoError(t, mi.Metadata.Err()) + assert.Empty(t, mi.Images) } })