mirror of
https://github.com/containers/podman.git
synced 2025-12-01 18:49:18 +08:00
Vendor in latest containers/common
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
18
vendor/github.com/containers/common/pkg/machine/machine.go
generated
vendored
18
vendor/github.com/containers/common/pkg/machine/machine.go
generated
vendored
@@ -4,9 +4,6 @@ import (
|
||||
"os"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/containers/common/pkg/config"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
type Marker struct {
|
||||
@@ -29,9 +26,7 @@ var (
|
||||
|
||||
func loadMachineMarker(file string) {
|
||||
var kind string
|
||||
|
||||
// Support deprecated config value for compatibility
|
||||
enabled := isLegacyConfigSet()
|
||||
enabled := false
|
||||
|
||||
if content, err := os.ReadFile(file); err == nil {
|
||||
enabled = true
|
||||
@@ -41,17 +36,6 @@ func loadMachineMarker(file string) {
|
||||
marker = &Marker{enabled, kind}
|
||||
}
|
||||
|
||||
func isLegacyConfigSet() bool {
|
||||
config, err := config.Default()
|
||||
if err != nil {
|
||||
logrus.Warnf("could not obtain container configuration")
|
||||
return false
|
||||
}
|
||||
|
||||
//nolint:staticcheck //lint:ignore SA1019 deprecated call
|
||||
return config.Engine.MachineEnabled
|
||||
}
|
||||
|
||||
func IsPodmanMachine() bool {
|
||||
return GetMachineMarker().Enabled
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user