summaryrefslogtreecommitdiff
path: root/pkg/util
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2020-04-16 21:54:31 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2020-04-20 16:11:36 -0400
commite62d08177024ab237d543d6f19c79631defece33 (patch)
tree286951e72a8dd6c23c4b2a41513d18f43a930647 /pkg/util
parent5928e8fe80e1f013049f1a980a4c945ee35570c3 (diff)
downloadpodman-e62d08177024ab237d543d6f19c79631defece33.tar.gz
podman-e62d08177024ab237d543d6f19c79631defece33.tar.bz2
podman-e62d08177024ab237d543d6f19c79631defece33.zip
Update podman to use containers.conf
Add more default options parsing Switch to using --time as opposed to --timeout to better match Docker. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'pkg/util')
-rw-r--r--pkg/util/utils.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/pkg/util/utils.go b/pkg/util/utils.go
index babf7dfc9..55e775d7a 100644
--- a/pkg/util/utils.go
+++ b/pkg/util/utils.go
@@ -13,6 +13,7 @@ import (
"time"
"github.com/BurntSushi/toml"
+ "github.com/containers/common/pkg/config"
"github.com/containers/image/v5/types"
"github.com/containers/libpod/pkg/errorhandling"
"github.com/containers/libpod/pkg/namespaces"
@@ -27,6 +28,17 @@ import (
"golang.org/x/crypto/ssh/terminal"
)
+var containerConfig *config.Config
+
+func init() {
+ var err error
+ containerConfig, err = config.Default()
+ if err != nil {
+ logrus.Error(err)
+ os.Exit(1)
+ }
+}
+
// Helper function to determine the username/password passed
// in the creds string. It could be either or both.
func parseCreds(creds string) (string, string) {
@@ -669,3 +681,7 @@ func swapSELinuxLabel(cLabel, processLabel string) (string, error) {
dcon["type"] = scon["type"]
return dcon.Get(), nil
}
+
+func DefaultContainerConfig() *config.Config {
+ return containerConfig
+}