mirror of https://github.com/containers/podman.git
Add 'Os' to be queried via 'version' output
Signed-off-by: John Matthews <jwmatthews@gmail.com>
This commit is contained in:
parent
c319edaaf8
commit
1ffcc4a888
|
@ -27,6 +27,7 @@ type Version struct {
|
|||
BuiltTime string
|
||||
Built int64
|
||||
OsArch string
|
||||
Os string
|
||||
}
|
||||
|
||||
// GetVersion returns a VersionOutput struct for API and podman
|
||||
|
@ -49,5 +50,6 @@ func GetVersion() (Version, error) {
|
|||
BuiltTime: time.Unix(buildTime, 0).Format(time.ANSIC),
|
||||
Built: buildTime,
|
||||
OsArch: runtime.GOOS + "/" + runtime.GOARCH,
|
||||
Os: runtime.GOOS,
|
||||
}, nil
|
||||
}
|
||||
|
|
|
@ -120,6 +120,7 @@ func Version(ctx context.Context, options *VersionOptions) (*entities.SystemVers
|
|||
BuiltTime: time.Unix(b.Unix(), 0).Format(time.ANSIC),
|
||||
Built: b.Unix(),
|
||||
OsArch: fmt.Sprintf("%s/%s", component.Os, component.Arch),
|
||||
Os: component.Os,
|
||||
}
|
||||
|
||||
for _, c := range component.Components {
|
||||
|
|
|
@ -87,10 +87,18 @@ var _ = Describe("Podman version", func() {
|
|||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
|
||||
session = podmanTest.Podman([]string{"version", "--format", "{{ .Client.Os }}"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
|
||||
session = podmanTest.Podman([]string{"version", "--format", "{{ .Server.Version }}"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
|
||||
session = podmanTest.Podman([]string{"version", "--format", "{{ .Server.Os }}"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
|
||||
session = podmanTest.Podman([]string{"version", "--format", "{{ .Version }}"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
|
|
Loading…
Reference in New Issue