File tree Expand file tree Collapse file tree 1 file changed +1
-12
lines changed
bib/cmd/bootc-image-builder Expand file tree Collapse file tree 1 file changed +1
-12
lines changed Original file line number Diff line number Diff line change 88 "io/fs"
99 "log"
1010 "os"
11- "os/exec"
1211 "path/filepath"
1312 "runtime/debug"
1413 "strconv"
4746 osStderr = os .Stderr
4847)
4948
50- func inContainerOrUnknown () bool {
51- // no systemd-detect-virt, err on the side of container
52- if _ , err := exec .LookPath ("systemd-detect-virt" ); err != nil {
53- return true
54- }
55- // exit code "0" means the container is detected
56- err := exec .Command ("systemd-detect-virt" , "-c" , "-q" ).Run ()
57- return err == nil
58- }
59-
6049func saveManifest (ms manifest.OSBuildManifest , fpath string ) (err error ) {
6150 b , err := json .MarshalIndent (ms , "" , " " )
6251 if err != nil {
@@ -278,7 +267,7 @@ func cmdBuild(cmd *cobra.Command, args []string) error {
278267 return fmt .Errorf ("cannot validate the setup: %w" , err )
279268 }
280269 logrus .Debug ("Ensuring environment setup" )
281- switch inContainerOrUnknown () {
270+ switch setup . IsContainer () {
282271 case false :
283272 fmt .Fprintf (os .Stderr , "WARNING: running outside a container, this is an unsupported configuration\n " )
284273 case true :
You can’t perform that action at this time.
0 commit comments