mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2025-02-21 03:37:40 +00:00
skip error when bundleDir not exist
This commit is contained in:
parent
52f52d5376
commit
350c8893fb
@ -18,7 +18,6 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
@ -157,17 +156,9 @@ func isBundleFlag(arg string) bool {
|
|||||||
// getOCISpecFilePath returns the expected path to the OCI specification file for the given
|
// getOCISpecFilePath returns the expected path to the OCI specification file for the given
|
||||||
// bundle directory or the current working directory if not specified.
|
// bundle directory or the current working directory if not specified.
|
||||||
func getOCISpecFilePath(bundleDir string) (string, error) {
|
func getOCISpecFilePath(bundleDir string) (string, error) {
|
||||||
if bundleDir == "" {
|
|
||||||
logger.Infof("Bundle directory path is empty, using working directory.")
|
|
||||||
workingDirectory, err := os.Getwd()
|
|
||||||
if err != nil {
|
|
||||||
return "", fmt.Errorf("error getting working directory: %v", err)
|
|
||||||
}
|
|
||||||
bundleDir = workingDirectory
|
|
||||||
}
|
|
||||||
|
|
||||||
logger.Infof("Using bundle directory: %v", bundleDir)
|
logger.Infof("Using bundle directory: %v", bundleDir)
|
||||||
|
|
||||||
|
// if bundleDir not specified, use "config.json" directly as cwd will always be the bundle path
|
||||||
OCISpecFilePath := filepath.Join(bundleDir, ociSpecFileName)
|
OCISpecFilePath := filepath.Join(bundleDir, ociSpecFileName)
|
||||||
|
|
||||||
logger.Infof("Using OCI specification file path: %v", OCISpecFilePath)
|
logger.Infof("Using OCI specification file path: %v", OCISpecFilePath)
|
||||||
|
Loading…
Reference in New Issue
Block a user