Merge pull request #25146 from baude/nolibkrunonintel

error with libkrun on intel-based machines
This commit is contained in:
openshift-merge-bot[bot] 2025-01-29 08:22:53 +00:00 committed by GitHub
commit 3857bffb8e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 3 deletions

View File

@ -8,6 +8,7 @@ import (
"os"
"path/filepath"
"regexp"
"runtime"
"strings"
"sync"
"time"
@ -15,6 +16,7 @@ import (
"github.com/containers/podman/v5/cmd/podman/registry"
"github.com/containers/podman/v5/cmd/podman/validate"
"github.com/containers/podman/v5/libpod/events"
"github.com/containers/podman/v5/pkg/machine/define"
"github.com/containers/podman/v5/pkg/machine/env"
provider2 "github.com/containers/podman/v5/pkg/machine/provider"
"github.com/containers/podman/v5/pkg/machine/vmconfigs"
@ -57,6 +59,9 @@ func machinePreRunE(c *cobra.Command, args []string) error {
if err != nil {
return err
}
if provider.VMType() == define.LibKrun && runtime.GOARCH == "amd64" {
return errors.New("libkrun is not supported on Intel based machines. Please revert to the applehv provider")
}
return rootlessOnly(c, args)
}

View File

@ -43,10 +43,11 @@ func Get() (vmconfigs.VMProvider, error) {
}
func GetAll() []vmconfigs.VMProvider {
return []vmconfigs.VMProvider{
new(applehv.AppleHVStubber),
new(libkrun.LibKrunStubber),
configs := []vmconfigs.VMProvider{new(applehv.AppleHVStubber)}
if runtime.GOARCH == "arm64" {
configs = append(configs, new(libkrun.LibKrunStubber))
}
return configs
}
// SupportedProviders returns the providers that are supported on the host operating system