Additional help test when container.RunDir already exists
- Closes #1389 Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
@@ -53,6 +53,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
- Correctly extract smbios asset key during Grub boot. #1291
|
||||
- Refactor of `wwinit/init` to more properly address rootfs options. #1098
|
||||
|
||||
### Added
|
||||
|
||||
- Additional help test when container.RunDir already exists. #1389
|
||||
|
||||
## v4.5.7, 2024-09-11
|
||||
|
||||
### Added
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
package exec
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"os/exec"
|
||||
@@ -42,7 +41,7 @@ func runContainedCmd(cmd *cobra.Command, containerName string, args []string) (e
|
||||
runDir := container.RunDir(containerName)
|
||||
if err := os.Mkdir(runDir, 0750); err != nil {
|
||||
if _, existerr := os.Stat(runDir); !os.IsNotExist(existerr) {
|
||||
return errors.New("run directory already exists: another container command may already be running")
|
||||
return fmt.Errorf("run directory already exists: another container command may already be running (otherwise, remove %s)", runDir)
|
||||
} else {
|
||||
return fmt.Errorf("unable to create run directory: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user