summaryrefslogtreecommitdiff
path: root/libpod/util.go
diff options
context:
space:
mode:
authorSuraj Deshmukh <surajd.service@gmail.com>2017-11-24 23:01:46 +0530
committerAtomic Bot <atomic-devel@projectatomic.io>2017-11-28 14:30:12 +0000
commit7eb4772694ed9b522fe688d8bd12a56ab3be751f (patch)
tree9e3686ca8536a2e93c472afa344ea5e6a446f552 /libpod/util.go
parentd43f7867282f04d3003c44ee96eb2324c6d2a0aa (diff)
downloadpodman-7eb4772694ed9b522fe688d8bd12a56ab3be751f.tar.gz
podman-7eb4772694ed9b522fe688d8bd12a56ab3be751f.tar.bz2
podman-7eb4772694ed9b522fe688d8bd12a56ab3be751f.zip
remove unused functions and variables
Signed-off-by: Suraj Deshmukh <surajd.service@gmail.com> Closes: #71 Approved by: rhatdan
Diffstat (limited to 'libpod/util.go')
-rw-r--r--libpod/util.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/libpod/util.go b/libpod/util.go
index c8cbfa2fc..61089b525 100644
--- a/libpod/util.go
+++ b/libpod/util.go
@@ -6,6 +6,9 @@ import (
"path/filepath"
"strings"
"time"
+
+ "github.com/containers/image/signature"
+ "github.com/containers/image/types"
)
// Runtime API constants
@@ -55,3 +58,21 @@ func FuncTimer(funcName string) {
func hasTransport(image string) bool {
return strings.Contains(image, "://")
}
+
+// CopyStringStringMap deep copies a map[string]string and returns the result
+func CopyStringStringMap(m map[string]string) map[string]string {
+ n := map[string]string{}
+ for k, v := range m {
+ n[k] = v
+ }
+ return n
+}
+
+// GetPolicyContext creates a signature policy context for the given signature policy path
+func GetPolicyContext(path string) (*signature.PolicyContext, error) {
+ policy, err := signature.DefaultPolicy(&types.SystemContext{SignaturePolicyPath: path})
+ if err != nil {
+ return nil, err
+ }
+ return signature.NewPolicyContext(policy)
+}