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)