summaryrefslogtreecommitdiff
path: root/libpod/options.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@gmail.com>2017-12-13 16:58:14 -0500
committerAtomic Bot <atomic-devel@projectatomic.io>2017-12-14 18:18:16 +0000
commit6d297688644a73c23fce7fbbaa5b402eca4d85d8 (patch)
tree8219e44ba61f50a913031d85b68fdaa23ee09606 /libpod/options.go
parentd8f099bb5a38b85bdea2bf6d99e0dbd0457ab666 (diff)
downloadpodman-6d297688644a73c23fce7fbbaa5b402eca4d85d8.tar.gz
podman-6d297688644a73c23fce7fbbaa5b402eca4d85d8.tar.bz2
podman-6d297688644a73c23fce7fbbaa5b402eca4d85d8.zip
Update pods to use file locks
Also includes misc other fixes - adding labels, fixing pod names Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #138 Approved by: rhatdan
Diffstat (limited to 'libpod/options.go')
-rw-r--r--libpod/options.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/libpod/options.go b/libpod/options.go
index 07c25faf9..8a12c61e4 100644
--- a/libpod/options.go
+++ b/libpod/options.go
@@ -401,3 +401,19 @@ func WithPodName(name string) PodCreateOption {
return nil
}
}
+
+// WithPodLabels sets the labels of a pod
+func WithPodLabels(labels map[string]string) PodCreateOption {
+ return func(pod *Pod) error {
+ if pod.valid {
+ return ErrPodFinalized
+ }
+
+ pod.labels = make(map[string]string)
+ for key, value := range labels {
+ pod.labels[key] = value
+ }
+
+ return nil
+ }
+}