summaryrefslogtreecommitdiff
path: root/pkg/util/utils.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/util/utils.go')
-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
+}