From dfa159cba16be7ecf0ca73764f9b57e0d5f3f38c Mon Sep 17 00:00:00 2001 From: Timofey Kirillov Date: Thu, 17 Feb 2022 20:41:51 +0300 Subject: [PATCH] fix(host-cleanup): host cleanup not working without --docker-server-storage-path option Signed-off-by: Timofey Kirillov --- pkg/host_cleaning/host_cleanup.go | 2 +- pkg/host_cleaning/local_docker_server.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/host_cleaning/host_cleanup.go b/pkg/host_cleaning/host_cleanup.go index cd31eaabcd..ede2ffb168 100644 --- a/pkg/host_cleaning/host_cleanup.go +++ b/pkg/host_cleaning/host_cleanup.go @@ -80,7 +80,7 @@ func RunAutoHostCleanup(ctx context.Context, options AutoHostCleanupOptions) err if options.AllowedLocalCacheVolumeUsageMarginPercentage != nil { args = append(args, "--allowed-docker-storage-volume-usage-margin", fmt.Sprintf("%d", *options.AllowedLocalCacheVolumeUsageMarginPercentage)) } - if options.DockerServerStoragePath != nil { + if options.DockerServerStoragePath != nil && *options.DockerServerStoragePath != "" { args = append(args, "--docker-server-storage-path", *options.DockerServerStoragePath) } diff --git a/pkg/host_cleaning/local_docker_server.go b/pkg/host_cleaning/local_docker_server.go index f3b1ceab02..6dfeab38e4 100644 --- a/pkg/host_cleaning/local_docker_server.go +++ b/pkg/host_cleaning/local_docker_server.go @@ -60,7 +60,7 @@ func GetLocalDockerServerStoragePath(ctx context.Context) (string, error) { func getDockerServerStoragePath(ctx context.Context, dockerServerStoragePathOption *string) (string, error) { var dockerServerStoragePath string - if dockerServerStoragePathOption != nil { + if dockerServerStoragePathOption != nil && *dockerServerStoragePathOption != "" { dockerServerStoragePath = *dockerServerStoragePathOption } else { path, err := GetLocalDockerServerStoragePath(ctx)