From eaf423ebde4cb3dc16c4ec68c1b7d383ab564a2d Mon Sep 17 00:00:00 2001 From: Laurent Luce Date: Wed, 6 Dec 2023 15:24:38 -0800 Subject: [PATCH] Linting. --- .../backend_creator/backend_creator.go | 9 +++++---- .../docker_kurtosis_backend/docker_kurtosis_backend.go | 2 +- .../engine_functions/stop_engines.go | 3 ++- .../reverse_proxy_functions/network_reverse_proxy.go | 2 +- .../docker/docker_manager/docker_manager.go | 2 +- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/backend_creator/backend_creator.go b/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/backend_creator/backend_creator.go index 519c46a1a2..e664e23542 100644 --- a/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/backend_creator/backend_creator.go +++ b/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/backend_creator/backend_creator.go @@ -3,6 +3,10 @@ package backend_creator import ( "context" "fmt" + "net" + "os" + "path" + "github.com/docker/docker/client" "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend" "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/logs_collector_functions" @@ -19,9 +23,6 @@ import ( "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/database_accessors/enclave_db/service_registration" "github.com/kurtosis-tech/stacktrace" "github.com/sirupsen/logrus" - "net" - "os" - "path" ) const ( @@ -253,7 +254,7 @@ func getDockerKurtosisBackend( network.GetGatewayIp(): true, apiContainerIp.String(): true, logsCollectorObj.GetEnclaveNetworkIpAddress().String(): true, - reverseProxyEnclaveNetworkIpAddress.String(): true, + reverseProxyEnclaveNetworkIpAddress.String(): true, } freeIpAddrProvider, err := free_ip_addr_tracker.GetOrCreateNewFreeIpAddrTracker( 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 3ff2bca9c2..a040ede0b3 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 @@ -475,7 +475,7 @@ func (backend *DockerKurtosisBackend) DestroyLogsCollectorForEnclave(ctx context } func (backend *DockerKurtosisBackend) CreateReverseProxy(ctx context.Context) (*reverse_proxy.ReverseProxy, error) { - reverseProxyContainer := traefik.NewTraefikReverseProxyContainer() //Declaring the implementation + reverseProxyContainer := traefik.NewTraefikReverseProxyContainer() reverseProxy, _, err := reverse_proxy_functions.CreateReverseProxy( ctx, diff --git a/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/engine_functions/stop_engines.go b/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/engine_functions/stop_engines.go index 9ffbe75852..b6050fbc7b 100644 --- a/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/engine_functions/stop_engines.go +++ b/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/engine_functions/stop_engines.go @@ -2,6 +2,7 @@ package engine_functions import ( "context" + "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/logs_aggregator_functions" "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_manager" @@ -72,7 +73,7 @@ func StopEngines( if err := logs_aggregator_functions.DestroyLogsAggregator(ctx, dockerManager); err != nil { return nil, nil, stacktrace.Propagate(err, "An error occurred removing the logging components.") } - + // Stop reverse proxy if err := reverse_proxy_functions.DestroyReverseProxy(ctx, dockerManager); err != nil { return nil, nil, stacktrace.Propagate(err, "An error occurred removing the reverse proxy.") 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 index f638d86959..3659f4af35 100644 --- 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 @@ -69,6 +69,6 @@ func ConnectReverseProxyToEnclaveNetworks(ctx context.Context, dockerManager *do return stacktrace.Propagate(err, "An error occurred connecting the reverse proxy to the enclave network with id '%v'", enclaveNetwork.GetId()) } } - + return nil } diff --git a/container-engine-lib/lib/backend_impls/docker/docker_manager/docker_manager.go b/container-engine-lib/lib/backend_impls/docker/docker_manager/docker_manager.go index 20fec381c3..cf668f2abb 100644 --- a/container-engine-lib/lib/backend_impls/docker/docker_manager/docker_manager.go +++ b/container-engine-lib/lib/backend_impls/docker/docker_manager/docker_manager.go @@ -791,7 +791,7 @@ func (manager *DockerManager) GetContainerIps(ctx context.Context, containerId s } allNetworkInfo := resp.NetworkSettings.Networks for _, networkInfo := range allNetworkInfo { - containerIps[networkInfo.NetworkID]= networkInfo.IPAddress + containerIps[networkInfo.NetworkID] = networkInfo.IPAddress } return containerIps, nil }