From fc9f7e3590492e3236e886a533974a786be47124 Mon Sep 17 00:00:00 2001 From: Liu Hua Date: Thu, 16 May 2019 16:19:34 -0700 Subject: tiny fix: avoid panicing when OpenSpec failed Signed-off-by: Liu Hua Change-Id: I11a4620394a10a7d92036b0341e0c21ad50bd122 PiperOrigin-RevId: 248621810 --- runsc/specutils/specutils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runsc/specutils/specutils.go b/runsc/specutils/specutils.go index c72207fb4..2888f55db 100644 --- a/runsc/specutils/specutils.go +++ b/runsc/specutils/specutils.go @@ -149,7 +149,7 @@ func OpenSpec(bundleDir string) (*os.File, error) { func ReadSpec(bundleDir string) (*specs.Spec, error) { specFile, err := OpenSpec(bundleDir) if err != nil { - return nil, fmt.Errorf("error opening spec file %q: %v", specFile.Name(), err) + return nil, fmt.Errorf("error opening spec file %q: %v", filepath.Join(bundleDir, "config.json"), err) } defer specFile.Close() return ReadSpecFromFile(bundleDir, specFile) -- cgit v1.2.3