mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-14 11:57:48 +00:00
enhance jmespath random-filter (#4591)
Signed-off-by: Anurag <contact.anurag7@gmail.com> Signed-off-by: Anurag <contact.anurag7@gmail.com>
This commit is contained in:
parent
e516fb868e
commit
cadf577e4b
1 changed files with 2 additions and 2 deletions
|
@ -5,7 +5,7 @@ import (
|
|||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"log"
|
||||
"math/rand"
|
||||
"path/filepath"
|
||||
"reflect"
|
||||
"regexp"
|
||||
|
@ -958,10 +958,10 @@ func jpRandom(arguments []interface{}) (interface{}, error) {
|
|||
if pattern == "" {
|
||||
return "", errors.New("no pattern provided")
|
||||
}
|
||||
rand.Seed(time.Now().UnixNano())
|
||||
ans, err := regen.Generate(pattern)
|
||||
if err != nil {
|
||||
fmt.Println("Invalid Pattern: ", err)
|
||||
}
|
||||
log.Println()
|
||||
return ans, nil
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue