From c10bd6ad576a5dd1f7ededa9df6361003cd5ebd1 Mon Sep 17 00:00:00 2001 From: Peter Amstutz Date: Tue, 25 Oct 2022 11:58:30 -0400 Subject: [PATCH] 18842: Fix syntax errors & error handling Arvados-DCO-1.1-Signed-off-by: Peter Amstutz --- lib/crunchrun/crunchrun.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/crunchrun/crunchrun.go b/lib/crunchrun/crunchrun.go index 67454cd0ff..7d57d732de 100644 --- a/lib/crunchrun/crunchrun.go +++ b/lib/crunchrun/crunchrun.go @@ -428,10 +428,12 @@ func (runner *ContainerRunner) SetupMounts() (map[string]bindmount, error) { } if runner.Container.RuntimeConstraints.KeepCacheDisk > 0 { - keepcachedir, err = runner.MkTempDir(runner.parentTemp, "keepcache") + keepcachedir, err := runner.MkTempDir(runner.parentTemp, "keepcache") + if err != nil { + return nil, fmt.Errorf("while creating keep cache temp dir: %v", err) + } arvMountCmd = append(arvMountCmd, "--disk-cache", "--disk-cache-dir", keepcachedir, "--file-cache", fmt.Sprintf("%d", runner.Container.RuntimeConstraints.KeepCacheDisk)) - } - else if runner.Container.RuntimeConstraints.KeepCacheRAM > 0 { + } else if runner.Container.RuntimeConstraints.KeepCacheRAM > 0 { arvMountCmd = append(arvMountCmd, "--file-cache", fmt.Sprintf("%d", runner.Container.RuntimeConstraints.KeepCacheRAM)) } -- 2.30.2