mirror of
https://github.com/containers/podman.git
synced 2025-06-06 06:44:53 +08:00
Restore json format for fields as well as whole structs
* Add template func to inspect template processing * Added test using repro from #8444 Fixes #8444 Signed-off-by: Jhon Honce <jhonce@redhat.com>
This commit is contained in:
@ -5,6 +5,7 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"math/rand"
|
||||
"os"
|
||||
"os/exec"
|
||||
"runtime"
|
||||
@ -465,3 +466,16 @@ func Containerized() bool {
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
var randomLetters = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
|
||||
|
||||
// RandomString returns a string of given length composed of random characters
|
||||
func RandomString(n int) string {
|
||||
rand.Seed(GinkgoRandomSeed())
|
||||
|
||||
b := make([]rune, n)
|
||||
for i := range b {
|
||||
b[i] = randomLetters[rand.Intn(len(randomLetters))]
|
||||
}
|
||||
return string(b)
|
||||
}
|
||||
|
Reference in New Issue
Block a user