mirror of
https://github.com/containers/podman.git
synced 2025-12-05 12:52:12 +08:00
Merge pull request #3401 from mheon/templating_is_dumb
Fix inspect --format '{{.Mounts}}.
This commit is contained in:
@@ -98,6 +98,14 @@ func inspectCmd(c *cliconfig.InspectValues) error {
|
||||
if strings.Contains(outputFormat, "{{.Id}}") {
|
||||
outputFormat = strings.Replace(outputFormat, "{{.Id}}", formats.IDString, -1)
|
||||
}
|
||||
// These fields were renamed, so we need to provide backward compat for
|
||||
// the old names.
|
||||
if strings.Contains(outputFormat, ".Src") {
|
||||
outputFormat = strings.Replace(outputFormat, ".Src", ".Source", -1)
|
||||
}
|
||||
if strings.Contains(outputFormat, ".Dst") {
|
||||
outputFormat = strings.Replace(outputFormat, ".Dst", ".Destination", -1)
|
||||
}
|
||||
if latestContainer {
|
||||
lc, err := runtime.GetLatestContainer()
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user