summaryrefslogtreecommitdiff
path: root/libpod/adapter
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-02-12 16:59:45 +0100
committerGitHub <noreply@github.com>2019-02-12 16:59:45 +0100
commitee27c39f85507993c0a3dfe3c4dfab4c7b7e5e00 (patch)
tree6e02056b44d75afb4cdb032c7772dab30bc1c26c /libpod/adapter
parentbdf537f4fc983c30c945297d9ee33891a127f9bd (diff)
parent2448129e4d27b95ce172f0ab5ac32c891aae7519 (diff)
downloadpodman-ee27c39f85507993c0a3dfe3c4dfab4c7b7e5e00.tar.gz
podman-ee27c39f85507993c0a3dfe3c4dfab4c7b7e5e00.tar.bz2
podman-ee27c39f85507993c0a3dfe3c4dfab4c7b7e5e00.zip
Merge pull request #2264 from larskarlitski/varlink-api
Make varlink API more idiomatic
Diffstat (limited to 'libpod/adapter')
-rw-r--r--libpod/adapter/runtime_remote.go13
1 files changed, 3 insertions, 10 deletions
diff --git a/libpod/adapter/runtime_remote.go b/libpod/adapter/runtime_remote.go
index 4dfae34e1..14a7d5652 100644
--- a/libpod/adapter/runtime_remote.go
+++ b/libpod/adapter/runtime_remote.go
@@ -6,7 +6,6 @@ import (
"bufio"
"context"
"encoding/json"
- "fmt"
"github.com/pkg/errors"
"io"
"os"
@@ -112,8 +111,8 @@ func (r *LocalRuntime) GetImages() ([]*ContainerImage, error) {
return newImages, nil
}
-func imageInListToContainerImage(i iopodman.ImageInList, name string, runtime *LocalRuntime) (*ContainerImage, error) {
- created, err := splitStringDate(i.Created)
+func imageInListToContainerImage(i iopodman.Image, name string, runtime *LocalRuntime) (*ContainerImage, error) {
+ created, err := time.ParseInLocation(time.RFC3339, i.Created, time.UTC)
if err != nil {
return nil, err
}
@@ -182,12 +181,6 @@ func (r *LocalRuntime) New(ctx context.Context, name, signaturePolicyPath, authf
return newImage, nil
}
-func splitStringDate(d string) (time.Time, error) {
- fields := strings.Fields(d)
- t := fmt.Sprintf("%sT%sZ", fields[0], fields[1])
- return time.ParseInLocation(time.RFC3339Nano, t, time.UTC)
-}
-
// IsParent goes through the layers in the store and checks if i.TopLayer is
// the parent of any other layer in store. Double check that image with that
// layer exists as well.
@@ -251,7 +244,7 @@ func (ci *ContainerImage) History(ctx context.Context) ([]*image.History, error)
return nil, err
}
for _, h := range reply {
- created, err := splitStringDate(h.Created)
+ created, err := time.ParseInLocation(time.RFC3339, h.Created, time.UTC)
if err != nil {
return nil, err
}