mirror of
https://github.com/containers/podman.git
synced 2025-10-18 11:42:55 +08:00
Vendor c/common
Signed-off-by: Ashley Cui <acui@redhat.com>
This commit is contained in:
28
vendor/github.com/containers/common/pkg/config/config.go
generated
vendored
28
vendor/github.com/containers/common/pkg/config/config.go
generated
vendored
@ -1100,34 +1100,6 @@ func Reload() (*Config, error) {
|
||||
return New(&Options{SetDefault: true})
|
||||
}
|
||||
|
||||
func (c *Config) ActiveDestination() (uri, identity string, machine bool, err error) {
|
||||
if uri, found := os.LookupEnv("CONTAINER_HOST"); found {
|
||||
if v, found := os.LookupEnv("CONTAINER_SSHKEY"); found {
|
||||
identity = v
|
||||
}
|
||||
return uri, identity, false, nil
|
||||
}
|
||||
connEnv := os.Getenv("CONTAINER_CONNECTION")
|
||||
switch {
|
||||
case connEnv != "":
|
||||
d, found := c.Engine.ServiceDestinations[connEnv]
|
||||
if !found {
|
||||
return "", "", false, fmt.Errorf("environment variable CONTAINER_CONNECTION=%q service destination not found", connEnv)
|
||||
}
|
||||
return d.URI, d.Identity, d.IsMachine, nil
|
||||
|
||||
case c.Engine.ActiveService != "":
|
||||
d, found := c.Engine.ServiceDestinations[c.Engine.ActiveService]
|
||||
if !found {
|
||||
return "", "", false, fmt.Errorf("%q service destination not found", c.Engine.ActiveService)
|
||||
}
|
||||
return d.URI, d.Identity, d.IsMachine, nil
|
||||
case c.Engine.RemoteURI != "":
|
||||
return c.Engine.RemoteURI, c.Engine.RemoteIdentity, false, nil
|
||||
}
|
||||
return "", "", false, errors.New("no service destination configured")
|
||||
}
|
||||
|
||||
var (
|
||||
bindirFailed = false
|
||||
bindirCached = ""
|
||||
|
7
vendor/github.com/containers/common/pkg/config/default.go
generated
vendored
7
vendor/github.com/containers/common/pkg/config/default.go
generated
vendored
@ -6,6 +6,7 @@ import (
|
||||
"net"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
|
||||
nettypes "github.com/containers/common/libnetwork/types"
|
||||
@ -250,8 +251,12 @@ func defaultSecretConfig() SecretConfig {
|
||||
|
||||
// defaultMachineConfig returns the default machine configuration.
|
||||
func defaultMachineConfig() MachineConfig {
|
||||
cpus := runtime.NumCPU() / 2
|
||||
if cpus == 0 {
|
||||
cpus = 1
|
||||
}
|
||||
return MachineConfig{
|
||||
CPUs: 1,
|
||||
CPUs: uint64(cpus),
|
||||
DiskSize: 100,
|
||||
Image: getDefaultMachineImage(),
|
||||
Memory: 2048,
|
||||
|
Reference in New Issue
Block a user