From e9982ed4e50af906e482e6d5d1e9e31b4d6858d9 Mon Sep 17 00:00:00 2001 From: Laurent Luce Date: Fri, 1 Dec 2023 22:19:06 -0500 Subject: [PATCH] Connect and disconnect the reverse proxy to/from the enclave network. --- .../docker_kurtosis_backend.go | 16 ++ ...cker_kurtosis_backend_enclave_functions.go | 41 ++++- .../network_reverse_proxy.go | 106 ++++++++++++ .../kubernetes_kurtosis_backend.go | 18 ++ .../metrics_reporting_kurtosis_backend.go | 13 ++ .../lib/backend_interface/kurtosis_backend.go | 8 + .../mock_kurtosis_backend.go | 154 +++++++++++++++++- 7 files changed, 352 insertions(+), 4 deletions(-) create mode 100644 container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/reverse_proxy_functions/network_reverse_proxy.go diff --git a/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/docker_kurtosis_backend.go b/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/docker_kurtosis_backend.go index 506b25d8e0..0642430ee6 100644 --- a/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/docker_kurtosis_backend.go +++ b/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/docker_kurtosis_backend.go @@ -509,6 +509,22 @@ func (backend *DockerKurtosisBackend) DestroyReverseProxy(ctx context.Context) e return nil } +func (backend *DockerKurtosisBackend) ConnectReverseProxyToNetwork(ctx context.Context, networkId string) error { + if err := reverse_proxy_functions.ConnectReverseProxyToNetwork(ctx, backend.dockerManager, networkId); err != nil { + return stacktrace.Propagate(err, "An error occurred connecting the reverse proxy to the network with ID '%v'", networkId) + } + + return nil +} + +func (backend *DockerKurtosisBackend) DisconnectReverseProxyFromNetwork(ctx context.Context, networkId string) error { + if err := reverse_proxy_functions.DisconnectReverseProxyFromNetwork(ctx, backend.dockerManager, networkId); err != nil { + return stacktrace.Propagate(err, "An error occurred disconnecting the reverse proxy from the network with ID '%v'", networkId) + } + + return nil +} + func (backend *DockerKurtosisBackend) GetAvailableCPUAndMemory(ctx context.Context) (compute_resources.MemoryInMegaBytes, compute_resources.CpuMilliCores, bool, error) { availableMemory, availableCpu, err := backend.dockerManager.GetAvailableCPUAndMemory(ctx) if err != nil { diff --git a/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/docker_kurtosis_backend_enclave_functions.go b/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/docker_kurtosis_backend_enclave_functions.go index 54aabf1a93..f676005123 100644 --- a/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/docker_kurtosis_backend_enclave_functions.go +++ b/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/docker_kurtosis_backend_enclave_functions.go @@ -3,8 +3,12 @@ package docker_kurtosis_backend import ( "context" "encoding/json" + "strings" + "time" + "github.com/docker/docker/api/types/volume" "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/consts" + "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/reverse_proxy_functions" "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/shared_helpers" "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/docker_manager" "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/docker_manager/types" @@ -14,8 +18,6 @@ import ( "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/enclave" "github.com/kurtosis-tech/stacktrace" "github.com/sirupsen/logrus" - "strings" - "time" ) const ( @@ -162,9 +164,23 @@ func (backend *DockerKurtosisBackend) CreateEnclave(ctx context.Context, enclave } }() + if err := backend.ConnectReverseProxyToNetwork(ctx, networkId); err != nil { + return nil, stacktrace.Propagate(err, "An error occurred connecting the reverse proxy to the enclave network with ID '%v'", networkId) + } + shouldDisconnectReverseProxyFromNetwork := true + defer func() { + if shouldDisconnectReverseProxyFromNetwork { + err = backend.DisconnectReverseProxyFromNetwork(ctx, networkId) + if err != nil { + logrus.Errorf("Couldn't disconnect the reverse proxy from the enclave network with ID '%v'", networkId) + } + } + }() + shouldDeleteLogsCollector = false shouldDeleteNetwork = false shouldDeleteVolume = false + shouldDisconnectReverseProxyFromNetwork = false return newEnclave, nil } @@ -374,15 +390,34 @@ func (backend *DockerKurtosisBackend) DestroyEnclaves( erroredEnclaveUuids[enclaveUuid] = volumeRemovalErr } + // Disconnect the reverse proxy from the networks + networksToDisconnect := map[enclave.EnclaveUUID]string{} + for enclaveUuid := range successfulVolumeRemovalEnclaveUuids { + networkInfo, found := matchingNetworkInfo[enclaveUuid] + if !found { + return nil, nil, stacktrace.NewError("Would have attempted to disconnect enclave network '%v' that didn't match the filters", enclaveUuid) + } + networksToDisconnect[enclaveUuid] = networkInfo.dockerNetwork.GetId() + } + + successfulDisconnectReverseProxyFromNetworkEnclaveUuids, erroredDisconnectReverseProxyFromNetworkEnclaveUuids, err := reverse_proxy_functions.DisconnectReverseProxyFromEnclaveNetworks(ctx, backend.dockerManager, networksToDisconnect) + if err != nil { + return nil, nil, stacktrace.Propagate(err, "An error occurred disconnecting the reverse proxy from the networks for enclaves whose volumes were successfully destroyed: %+v", successfulVolumeRemovalEnclaveUuids) + } + for enclaveUuid, networkDisconnectErr := range erroredDisconnectReverseProxyFromNetworkEnclaveUuids { + erroredEnclaveUuids[enclaveUuid] = networkDisconnectErr + } + // Remove the networks networksToDestroy := map[enclave.EnclaveUUID]string{} - for enclaveUuid := range successfulVolumeRemovalEnclaveUuids { + for enclaveUuid := range successfulDisconnectReverseProxyFromNetworkEnclaveUuids { networkInfo, found := matchingNetworkInfo[enclaveUuid] if !found { return nil, nil, stacktrace.NewError("Would have attempted to destroy enclave '%v' that didn't match the filters", enclaveUuid) } networksToDestroy[enclaveUuid] = networkInfo.dockerNetwork.GetId() } + successfulNetworkRemovalEnclaveUuids, erroredNetworkRemovalEnclaveUuids, err := destroyEnclaveNetworks(ctx, backend.dockerManager, networksToDestroy) if err != nil { return nil, nil, stacktrace.Propagate(err, "An error occurred destroying the networks for enclaves whose volumes were successfully destroyed: %+v", successfulVolumeRemovalEnclaveUuids) diff --git a/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/reverse_proxy_functions/network_reverse_proxy.go b/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/reverse_proxy_functions/network_reverse_proxy.go new file mode 100644 index 0000000000..e3261de577 --- /dev/null +++ b/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/reverse_proxy_functions/network_reverse_proxy.go @@ -0,0 +1,106 @@ +package reverse_proxy_functions + +import ( + "context" + "net" + + "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/docker_manager" + "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/docker_operation_parallelizer" + "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/enclave" + "github.com/kurtosis-tech/stacktrace" + "github.com/sirupsen/logrus" +) + +const ( + emptyAliasForLogsCollector = "" +) + +var ( + autoAssignIpAddressToLogsCollector net.IP = nil +) + +func ConnectReverseProxyToNetwork(ctx context.Context, dockerManager *docker_manager.DockerManager, networkId string) error { + _, maybeReverseProxyContainerId, err := getReverseProxyObjectAndContainerId(ctx, dockerManager) + if err != nil { + logrus.Warnf("Attempted to connect reverse proxy to a network but no reverse proxy container was found.") + return nil + } + + if maybeReverseProxyContainerId == "" { + return nil + } + + if err = dockerManager.ConnectContainerToNetwork(ctx, networkId, maybeReverseProxyContainerId, autoAssignIpAddressToLogsCollector, emptyAliasForLogsCollector); err != nil { + return stacktrace.Propagate(err, "An error occurred while connecting container '%v' to the enclave network '%v'", maybeReverseProxyContainerId, networkId) + } + + return nil +} + +func DisconnectReverseProxyFromNetwork(ctx context.Context, dockerManager *docker_manager.DockerManager, networkId string) error { + _, maybeReverseProxyContainerId, err := getReverseProxyObjectAndContainerId(ctx, dockerManager) + if err != nil { + logrus.Warnf("Attempted to disconnect reverse proxy from a network but no reverse proxy container was found.") + return nil + } + + if maybeReverseProxyContainerId == "" { + return nil + } + + if err = dockerManager.DisconnectContainerFromNetwork(ctx, maybeReverseProxyContainerId, networkId); err != nil { + return stacktrace.Propagate(err, "An error occurred while disconnecting container '%v' from the enclave network '%v'", maybeReverseProxyContainerId, networkId) + } + + return nil +} + +func DisconnectReverseProxyFromEnclaveNetworks( + ctx context.Context, + dockerManager *docker_manager.DockerManager, + enclaveNetworkIds map[enclave.EnclaveUUID]string, +) ( + map[enclave.EnclaveUUID]bool, + map[enclave.EnclaveUUID]error, + error, +) { + networkIdsToRemove := map[string]bool{} + enclaveUuidsForNetworkIds := map[string]enclave.EnclaveUUID{} + for enclaveUuid, networkId := range enclaveNetworkIds { + networkIdsToRemove[networkId] = true + enclaveUuidsForNetworkIds[networkId] = enclaveUuid + } + + var disconnectNetworkOperation docker_operation_parallelizer.DockerOperation = func(ctx context.Context, dockerManager *docker_manager.DockerManager, dockerObjectId string) error { + if err := DisconnectReverseProxyFromNetwork(ctx, dockerManager, dockerObjectId); err != nil { + return stacktrace.Propagate(err, "An error occurred disconnecting the reverse proxy from the enclave network with ID '%v'", dockerObjectId) + } + return nil + } + + successfulNetworkIds, erroredNetworkIds := docker_operation_parallelizer.RunDockerOperationInParallel( + ctx, + networkIdsToRemove, + dockerManager, + disconnectNetworkOperation, + ) + + successfulEnclaveUuids := map[enclave.EnclaveUUID]bool{} + for networkId := range successfulNetworkIds { + enclaveUuid, found := enclaveUuidsForNetworkIds[networkId] + if !found { + return nil, nil, stacktrace.NewError("The reverse proxy was successfully disconnected from the Docker network '%v', but wasn't requested to be disconnected", networkId) + } + successfulEnclaveUuids[enclaveUuid] = true + } + + erroredEnclaveUuids := map[enclave.EnclaveUUID]error{} + for networkId, networkRemovalErr := range erroredNetworkIds { + enclaveUuid, found := enclaveUuidsForNetworkIds[networkId] + if !found { + return nil, nil, stacktrace.NewError("Docker network '%v' had the following error during disconnect, but wasn't requested to be disconnected:\n%v", networkId, networkRemovalErr) + } + erroredEnclaveUuids[enclaveUuid] = networkRemovalErr + } + return successfulEnclaveUuids, erroredEnclaveUuids, nil +} diff --git a/container-engine-lib/lib/backend_impls/kubernetes/kubernetes_kurtosis_backend/kubernetes_kurtosis_backend.go b/container-engine-lib/lib/backend_impls/kubernetes/kubernetes_kurtosis_backend/kubernetes_kurtosis_backend.go index 21f839f42f..ee58651bfd 100644 --- a/container-engine-lib/lib/backend_impls/kubernetes/kubernetes_kurtosis_backend/kubernetes_kurtosis_backend.go +++ b/container-engine-lib/lib/backend_impls/kubernetes/kubernetes_kurtosis_backend/kubernetes_kurtosis_backend.go @@ -18,6 +18,7 @@ import ( "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/image_download_mode" "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/logs_aggregator" "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/logs_collector" + "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/reverse_proxy" "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/service" "github.com/kurtosis-tech/stacktrace" "github.com/sirupsen/logrus" @@ -459,6 +460,23 @@ func (backend *KubernetesKurtosisBackend) DestroyLogsCollectorForEnclave(ctx con return stacktrace.NewError("Destroy the logs collector for enclave isn't yet implemented on Kubernetes") } +func (backend *KubernetesKurtosisBackend) GetReverseProxy( + ctx context.Context, +) (*reverse_proxy.ReverseProxy, error) { + // TODO IMPLEMENT + return nil, stacktrace.NewError("Getting the reverse proxy isn't yet implemented on Kubernetes") +} + +func (backend *KubernetesKurtosisBackend) CreateReverseProxy(ctx context.Context) (*reverse_proxy.ReverseProxy, error) { + // TODO IMPLEMENT + return nil, stacktrace.NewError("Creating the reverse proxy isn't yet implemented on Kubernetes") +} + +func (backend *KubernetesKurtosisBackend) DestroyReverseProxy(ctx context.Context) error { + // TODO IMPLEMENT + return stacktrace.NewError("Destroying the reverse proxy isn't yet implemented on Kubernetes") +} + // ==================================================================================================== // // Private Helper Functions diff --git a/container-engine-lib/lib/backend_impls/metrics_reporting/metrics_reporting_kurtosis_backend.go b/container-engine-lib/lib/backend_impls/metrics_reporting/metrics_reporting_kurtosis_backend.go index a41bb4b2c6..b55546a999 100644 --- a/container-engine-lib/lib/backend_impls/metrics_reporting/metrics_reporting_kurtosis_backend.go +++ b/container-engine-lib/lib/backend_impls/metrics_reporting/metrics_reporting_kurtosis_backend.go @@ -14,6 +14,7 @@ import ( "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/image_download_mode" "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/logs_aggregator" "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/logs_collector" + "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/reverse_proxy" "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/service" "github.com/kurtosis-tech/stacktrace" ) @@ -438,6 +439,18 @@ func (backend *MetricsReportingKurtosisBackend) DestroyLogsCollectorForEnclave(c return nil } +func (backend *MetricsReportingKurtosisBackend) CreateReverseProxy(ctx context.Context) (*reverse_proxy.ReverseProxy, error) { + return backend.underlying.CreateReverseProxy(ctx) +} + +func (backend *MetricsReportingKurtosisBackend) GetReverseProxy(ctx context.Context) (*reverse_proxy.ReverseProxy, error) { + return backend.underlying.GetReverseProxy(ctx) +} + +func (backend *MetricsReportingKurtosisBackend) DestroyReverseProxy(ctx context.Context) error { + return backend.underlying.DestroyReverseProxy(ctx) +} + func (backend *MetricsReportingKurtosisBackend) GetAvailableCPUAndMemory(ctx context.Context) (compute_resources.MemoryInMegaBytes, compute_resources.CpuMilliCores, bool, error) { availableMemory, availableCpu, isResourceInformationComplete, err := backend.underlying.GetAvailableCPUAndMemory(ctx) if err != nil { diff --git a/container-engine-lib/lib/backend_interface/kurtosis_backend.go b/container-engine-lib/lib/backend_interface/kurtosis_backend.go index ab6fc98e47..a0a1be1889 100644 --- a/container-engine-lib/lib/backend_interface/kurtosis_backend.go +++ b/container-engine-lib/lib/backend_interface/kurtosis_backend.go @@ -13,6 +13,7 @@ import ( "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/image_download_mode" "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/logs_aggregator" "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/logs_collector" + "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/reverse_proxy" "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/service" ) @@ -337,6 +338,13 @@ type KurtosisBackend interface { // Destroy the logs collector for enclave with UUID DestroyLogsCollectorForEnclave(ctx context.Context, enclaveUuid enclave.EnclaveUUID) error + CreateReverseProxy(ctx context.Context) (*reverse_proxy.ReverseProxy, error) + + // Returns nil if logs aggregator was not found + GetReverseProxy(ctx context.Context) (*reverse_proxy.ReverseProxy, error) + + DestroyReverseProxy(ctx context.Context) error + // GetAvailableCPUAndMemory - gets available memory in megabytes and cpu in millicores, the boolean indicates whether the information is complete GetAvailableCPUAndMemory(ctx context.Context) (compute_resources.MemoryInMegaBytes, compute_resources.CpuMilliCores, bool, error) } diff --git a/container-engine-lib/lib/backend_interface/mock_kurtosis_backend.go b/container-engine-lib/lib/backend_interface/mock_kurtosis_backend.go index 29fd97ae02..bd0bdf1f05 100644 --- a/container-engine-lib/lib/backend_interface/mock_kurtosis_backend.go +++ b/container-engine-lib/lib/backend_interface/mock_kurtosis_backend.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.22.1. DO NOT EDIT. +// Code generated by mockery v2.26.1. DO NOT EDIT. package backend_interface @@ -24,6 +24,8 @@ import ( mock "github.com/stretchr/testify/mock" + reverse_proxy "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/reverse_proxy" + service "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/service" time "time" @@ -373,6 +375,60 @@ func (_c *MockKurtosisBackend_CreateLogsCollectorForEnclave_Call) RunAndReturn(r return _c } +// CreateReverseProxy provides a mock function with given fields: ctx +func (_m *MockKurtosisBackend) CreateReverseProxy(ctx context.Context) (*reverse_proxy.ReverseProxy, error) { + ret := _m.Called(ctx) + + var r0 *reverse_proxy.ReverseProxy + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*reverse_proxy.ReverseProxy, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) *reverse_proxy.ReverseProxy); ok { + r0 = rf(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*reverse_proxy.ReverseProxy) + } + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockKurtosisBackend_CreateReverseProxy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateReverseProxy' +type MockKurtosisBackend_CreateReverseProxy_Call struct { + *mock.Call +} + +// CreateReverseProxy is a helper method to define mock.On call +// - ctx context.Context +func (_e *MockKurtosisBackend_Expecter) CreateReverseProxy(ctx interface{}) *MockKurtosisBackend_CreateReverseProxy_Call { + return &MockKurtosisBackend_CreateReverseProxy_Call{Call: _e.mock.On("CreateReverseProxy", ctx)} +} + +func (_c *MockKurtosisBackend_CreateReverseProxy_Call) Run(run func(ctx context.Context)) *MockKurtosisBackend_CreateReverseProxy_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *MockKurtosisBackend_CreateReverseProxy_Call) Return(_a0 *reverse_proxy.ReverseProxy, _a1 error) *MockKurtosisBackend_CreateReverseProxy_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockKurtosisBackend_CreateReverseProxy_Call) RunAndReturn(run func(context.Context) (*reverse_proxy.ReverseProxy, error)) *MockKurtosisBackend_CreateReverseProxy_Call { + _c.Call.Return(run) + return _c +} + // DestroyAPIContainers provides a mock function with given fields: ctx, filters func (_m *MockKurtosisBackend) DestroyAPIContainers(ctx context.Context, filters *api_container.APIContainerFilters) (map[enclave.EnclaveUUID]bool, map[enclave.EnclaveUUID]error, error) { ret := _m.Called(ctx, filters) @@ -650,6 +706,48 @@ func (_c *MockKurtosisBackend_DestroyLogsCollectorForEnclave_Call) RunAndReturn( return _c } +// DestroyReverseProxy provides a mock function with given fields: ctx +func (_m *MockKurtosisBackend) DestroyReverseProxy(ctx context.Context) error { + ret := _m.Called(ctx) + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context) error); ok { + r0 = rf(ctx) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockKurtosisBackend_DestroyReverseProxy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DestroyReverseProxy' +type MockKurtosisBackend_DestroyReverseProxy_Call struct { + *mock.Call +} + +// DestroyReverseProxy is a helper method to define mock.On call +// - ctx context.Context +func (_e *MockKurtosisBackend_Expecter) DestroyReverseProxy(ctx interface{}) *MockKurtosisBackend_DestroyReverseProxy_Call { + return &MockKurtosisBackend_DestroyReverseProxy_Call{Call: _e.mock.On("DestroyReverseProxy", ctx)} +} + +func (_c *MockKurtosisBackend_DestroyReverseProxy_Call) Run(run func(ctx context.Context)) *MockKurtosisBackend_DestroyReverseProxy_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *MockKurtosisBackend_DestroyReverseProxy_Call) Return(_a0 error) *MockKurtosisBackend_DestroyReverseProxy_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockKurtosisBackend_DestroyReverseProxy_Call) RunAndReturn(run func(context.Context) error) *MockKurtosisBackend_DestroyReverseProxy_Call { + _c.Call.Return(run) + return _c +} + // DestroyUserServices provides a mock function with given fields: ctx, enclaveUuid, filters func (_m *MockKurtosisBackend) DestroyUserServices(ctx context.Context, enclaveUuid enclave.EnclaveUUID, filters *service.ServiceFilters) (map[service.ServiceUUID]bool, map[service.ServiceUUID]error, error) { ret := _m.Called(ctx, enclaveUuid, filters) @@ -1246,6 +1344,60 @@ func (_c *MockKurtosisBackend_GetLogsCollectorForEnclave_Call) RunAndReturn(run return _c } +// GetReverseProxy provides a mock function with given fields: ctx +func (_m *MockKurtosisBackend) GetReverseProxy(ctx context.Context) (*reverse_proxy.ReverseProxy, error) { + ret := _m.Called(ctx) + + var r0 *reverse_proxy.ReverseProxy + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*reverse_proxy.ReverseProxy, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) *reverse_proxy.ReverseProxy); ok { + r0 = rf(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*reverse_proxy.ReverseProxy) + } + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockKurtosisBackend_GetReverseProxy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetReverseProxy' +type MockKurtosisBackend_GetReverseProxy_Call struct { + *mock.Call +} + +// GetReverseProxy is a helper method to define mock.On call +// - ctx context.Context +func (_e *MockKurtosisBackend_Expecter) GetReverseProxy(ctx interface{}) *MockKurtosisBackend_GetReverseProxy_Call { + return &MockKurtosisBackend_GetReverseProxy_Call{Call: _e.mock.On("GetReverseProxy", ctx)} +} + +func (_c *MockKurtosisBackend_GetReverseProxy_Call) Run(run func(ctx context.Context)) *MockKurtosisBackend_GetReverseProxy_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *MockKurtosisBackend_GetReverseProxy_Call) Return(_a0 *reverse_proxy.ReverseProxy, _a1 error) *MockKurtosisBackend_GetReverseProxy_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockKurtosisBackend_GetReverseProxy_Call) RunAndReturn(run func(context.Context) (*reverse_proxy.ReverseProxy, error)) *MockKurtosisBackend_GetReverseProxy_Call { + _c.Call.Return(run) + return _c +} + // GetShellOnUserService provides a mock function with given fields: ctx, enclaveUuid, serviceUuid func (_m *MockKurtosisBackend) GetShellOnUserService(ctx context.Context, enclaveUuid enclave.EnclaveUUID, serviceUuid service.ServiceUUID) error { ret := _m.Called(ctx, enclaveUuid, serviceUuid)