Vendor in latest containers/(common,image,storage)

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
Daniel J Walsh
2022-11-11 14:39:57 -05:00
parent c75b05996d
commit 5df00c6f79
39 changed files with 989 additions and 520 deletions

View File

@@ -116,6 +116,11 @@ func (n *netavarkNetwork) networkCreate(newNetwork *types.Network, defaultNet bo
}
// rust only support "true" or "false" while go can parse 1 and 0 as well so we need to change it
newNetwork.Options[types.IsolateOption] = strconv.FormatBool(val)
case types.MetricOption:
_, err := strconv.ParseUint(value, 10, 32)
if err != nil {
return nil, err
}
default:
return nil, fmt.Errorf("unsupported bridge network option %s", key)
}

View File

@@ -40,6 +40,7 @@ const (
MTUOption = "mtu"
ModeOption = "mode"
IsolateOption = "isolate"
MetricOption = "metric"
)
type NetworkBackend string

View File

@@ -358,6 +358,9 @@ type EngineConfig struct {
// OCIRuntimes are the set of configured OCI runtimes (default is runc).
OCIRuntimes map[string][]string `toml:"runtimes,omitempty"`
// PlatformToOCIRuntime requests specific OCI runtime for a specified platform of image.
PlatformToOCIRuntime map[string]string `toml:"platform_to_oci_runtime,omitempty"`
// PodExitPolicy determines the behaviour when the last container of a pod exits.
PodExitPolicy PodExitPolicy `toml:"pod_exit_policy,omitempty"`
@@ -619,6 +622,16 @@ type Destination struct {
IsMachine bool `toml:"is_machine,omitempty"`
}
// Consumes container image's os and arch and returns if any dedicated runtime was
// configured otherwise returns default runtime.
func (c *EngineConfig) ImagePlatformToRuntime(os string, arch string) string {
platformString := os + "/" + arch
if val, ok := c.PlatformToOCIRuntime[platformString]; ok {
return val
}
return c.OCIRuntime
}
// NewConfig creates a new Config. It starts with an empty config and, if
// specified, merges the config at `userConfigPath` path. Depending if we're
// running as root or rootless, we then merge the system configuration followed

View File

@@ -10,6 +10,10 @@ const (
// DefaultContainersConfig holds the default containers config path
DefaultContainersConfig = "/usr/share/" + _configPath
// DefaultSignaturePolicyPath is the default value for the
// policy.json file.
DefaultSignaturePolicyPath = "/etc/containers/policy.json"
)
// podman remote clients on darwin cannot use unshare.isRootless() to determine the configuration file locations.

View File

@@ -10,6 +10,10 @@ const (
// DefaultContainersConfig holds the default containers config path
DefaultContainersConfig = "/usr/local/share/" + _configPath
// DefaultSignaturePolicyPath is the default value for the
// policy.json file.
DefaultSignaturePolicyPath = "/usr/local/etc/containers/policy.json"
)
// podman remote clients on freebsd cannot use unshare.isRootless() to determine the configuration file locations.

View File

@@ -13,6 +13,10 @@ const (
// DefaultContainersConfig holds the default containers config path
DefaultContainersConfig = "/usr/share/" + _configPath
// DefaultSignaturePolicyPath is the default value for the
// policy.json file.
DefaultSignaturePolicyPath = "/etc/containers/policy.json"
)
func selinuxEnabled() bool {

View File

@@ -8,6 +8,10 @@ const (
// DefaultContainersConfig holds the default containers config path
DefaultContainersConfig = "/usr/share/" + _configPath
// DefaultSignaturePolicyPath is the default value for the
// policy.json file.
DefaultSignaturePolicyPath = "/etc/containers/policy.json"
)
// podman remote clients on windows cannot use unshare.isRootless() to determine the configuration file locations.

View File

@@ -263,6 +263,11 @@ default_sysctls = [
# If it is empty or commented out, no volumes will be added
#
#volumes = []
#
#[engine.platform_to_oci_runtime]
#"wasi/wasm" = ["crun-wasm"]
#"wasi/wasm32" = ["crun-wasm"]
#"wasi/wasm64" = ["crun-wasm"]
[secrets]
#driver = "file"

View File

@@ -149,9 +149,6 @@ const (
DefaultPidsLimit = 2048
// DefaultPullPolicy pulls the image if it does not exist locally.
DefaultPullPolicy = "missing"
// DefaultSignaturePolicyPath is the default value for the
// policy.json file.
DefaultSignaturePolicyPath = "/etc/containers/policy.json"
// DefaultSubnet is the subnet that will be used for the default
// network.
DefaultSubnet = "10.88.0.0/16"
@@ -332,6 +329,15 @@ func defaultConfigFromMemory() (*EngineConfig, error) {
"/bin/crun",
"/run/current-system/sw/bin/crun",
},
"crun-wasm": {
"/usr/bin/crun-wasm",
"/usr/sbin/crun-wasm",
"/usr/local/bin/crun-wasm",
"/usr/local/sbin/crun-wasm",
"/sbin/crun-wasm",
"/bin/crun-wasm",
"/run/current-system/sw/bin/crun-wasm",
},
"runc": {
"/usr/bin/runc",
"/usr/sbin/runc",
@@ -378,6 +384,11 @@ func defaultConfigFromMemory() (*EngineConfig, error) {
"/usr/local/bin/ocijail",
},
}
c.PlatformToOCIRuntime = map[string]string{
"wasi/wasm": "crun-wasm",
"wasi/wasm32": "crun-wasm",
"wasi/wasm64": "crun-wasm",
}
// Needs to be called after populating c.OCIRuntimes.
c.OCIRuntime = c.findRuntime()