diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-06-15 12:37:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-15 12:37:54 +0200 |
commit | b82c4e938458eaa0b9fd1b90a586541d87bffc93 (patch) | |
tree | a01fb87e19d9cd52976c12f1804e36ad786b9439 /libpod/runtime.go | |
parent | 878be6d50518a94176385bd2bc3ebd9faa75fe4e (diff) | |
parent | 7baa6b62666cbcced481703c3da9b86e613d1e8f (diff) | |
download | podman-b82c4e938458eaa0b9fd1b90a586541d87bffc93.tar.gz podman-b82c4e938458eaa0b9fd1b90a586541d87bffc93.tar.bz2 podman-b82c4e938458eaa0b9fd1b90a586541d87bffc93.zip |
Merge pull request #3278 from llchan/improve-prefix-handling
Improve DESTDIR/PREFIX/ETCDIR handling
Diffstat (limited to 'libpod/runtime.go')
-rw-r--r-- | libpod/runtime.go | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/libpod/runtime.go b/libpod/runtime.go index 24bb5f61c..2c50fce85 100644 --- a/libpod/runtime.go +++ b/libpod/runtime.go @@ -42,11 +42,20 @@ const ( SQLiteStateStore RuntimeStateStore = iota // BoltDBStateStore is a state backed by a BoltDB database BoltDBStateStore RuntimeStateStore = iota +) + +var ( + // InstallPrefix is the prefix where podman will be installed. + // It can be overridden at build time. + installPrefix = "/usr/local" + // EtcDir is the sysconfdir where podman should look for system config files. + // It can be overridden at build time. + etcDir = "/etc" // SeccompDefaultPath defines the default seccomp path - SeccompDefaultPath = "/usr/share/containers/seccomp.json" + SeccompDefaultPath = installPrefix + "/share/containers/seccomp.json" // SeccompOverridePath if this exists it overrides the default seccomp path - SeccompOverridePath = "/etc/crio/seccomp.json" + SeccompOverridePath = etcDir + "/crio/seccomp.json" // ConfigPath is the path to the libpod configuration file // This file is loaded to replace the builtin default config before @@ -54,11 +63,11 @@ const ( // If it is not present, the builtin default config is used instead // This path can be overridden when the runtime is created by using // NewRuntimeFromConfig() instead of NewRuntime() - ConfigPath = "/usr/share/containers/libpod.conf" + ConfigPath = installPrefix + "/share/containers/libpod.conf" // OverrideConfigPath is the path to an override for the default libpod // configuration file. If OverrideConfigPath exists, it will be used in // place of the configuration file pointed to by ConfigPath. - OverrideConfigPath = "/etc/containers/libpod.conf" + OverrideConfigPath = etcDir + "/containers/libpod.conf" // DefaultInfraImage to use for infra container DefaultInfraImage = "k8s.gcr.io/pause:3.1" @@ -300,7 +309,7 @@ func defaultRuntimeConfig() (RuntimeConfig, error) { TmpDir: "", MaxLogSize: -1, NoPivotRoot: false, - CNIConfigDir: "/etc/cni/net.d/", + CNIConfigDir: etcDir + "/cni/net.d/", CNIPluginDir: []string{"/usr/libexec/cni", "/usr/lib/cni", "/usr/local/lib/cni", "/opt/cni/bin"}, InfraCommand: DefaultInfraCommand, InfraImage: DefaultInfraImage, |