mirror of
https://github.com/containers/podman.git
synced 2025-12-03 03:39:44 +08:00
fix --format {{json .}} output to match docker
`--format json` should not be the same as `--format {{json .}}`, the
later should actually run through the go template and thus create one
json object per entry instead of an json array.
Includes a vendor of c/common@main since it requires a fix from there as
well.
This matches docker compat.
Fixes #16436
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
8
vendor/github.com/containers/common/pkg/report/validate.go
generated
vendored
8
vendor/github.com/containers/common/pkg/report/validate.go
generated
vendored
@@ -1,8 +1,12 @@
|
||||
package report
|
||||
|
||||
import "regexp"
|
||||
import (
|
||||
"regexp"
|
||||
)
|
||||
|
||||
var jsonRegex = regexp.MustCompile(`^\s*(json|{{\s*json\s*(\.)?\s*}})\s*$`)
|
||||
// Check for json, {{json }} and {{ json. }} which are not valid go template,
|
||||
// {{json .}} is valid and thus not matched to let the template handle it like docker does.
|
||||
var jsonRegex = regexp.MustCompile(`^\s*(json|{{\s*json\.?\s*}})\s*$`)
|
||||
|
||||
// JSONFormat test CLI --format string to be a JSON request
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user