summaryrefslogtreecommitdiff
path: root/libpod/define
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-05-22 01:38:16 +0200
committerGitHub <noreply@github.com>2020-05-22 01:38:16 +0200
commit99fcb90f28a041c85fee7e2550027fb91f996f4a (patch)
tree6fe613171d3d42a3d01afd2571768e36bf7a7942 /libpod/define
parentb023d6d541f7feb16f64ee0ca1ac10e442d33241 (diff)
parent7b188f7b5b28ea04bcda1747f1869a50ac4b6f4a (diff)
downloadpodman-99fcb90f28a041c85fee7e2550027fb91f996f4a.tar.gz
podman-99fcb90f28a041c85fee7e2550027fb91f996f4a.tar.bz2
podman-99fcb90f28a041c85fee7e2550027fb91f996f4a.zip
Merge pull request #6275 from rhatdan/VERSION
Display human build date in podman info
Diffstat (limited to 'libpod/define')
-rw-r--r--libpod/define/version.go27
1 files changed, 15 insertions, 12 deletions
diff --git a/libpod/define/version.go b/libpod/define/version.go
index 954cd00f1..3eb016264 100644
--- a/libpod/define/version.go
+++ b/libpod/define/version.go
@@ -3,6 +3,7 @@ package define
import (
"runtime"
"strconv"
+ "time"
podmanVersion "github.com/containers/libpod/version"
)
@@ -19,12 +20,13 @@ var (
// Version is an output struct for varlink
type Version struct {
- RemoteAPIVersion int64
- Version string
- GoVersion string
- GitCommit string
- Built int64
- OsArch string
+ APIVersion int64
+ Version string
+ GoVersion string
+ GitCommit string
+ BuiltTime string
+ Built int64
+ OsArch string
}
// GetVersion returns a VersionOutput struct for varlink and podman
@@ -40,11 +42,12 @@ func GetVersion() (Version, error) {
}
}
return Version{
- RemoteAPIVersion: podmanVersion.RemoteAPIVersion,
- Version: podmanVersion.Version,
- GoVersion: runtime.Version(),
- GitCommit: gitCommit,
- Built: buildTime,
- OsArch: runtime.GOOS + "/" + runtime.GOARCH,
+ APIVersion: podmanVersion.APIVersion,
+ Version: podmanVersion.Version,
+ GoVersion: runtime.Version(),
+ GitCommit: gitCommit,
+ BuiltTime: time.Unix(buildTime, 0).Format(time.ANSIC),
+ Built: buildTime,
+ OsArch: runtime.GOOS + "/" + runtime.GOARCH,
}, nil
}