mirror of
https://github.com/kyverno/kyverno.git
synced 2025-04-18 02:06:52 +00:00
Fix kyverno panic with PodSpec.containers
JSON merge patch w/o image (#3143)
Signed-off-by: Abhinav Sinha <abhinav@nirmata.com>
This commit is contained in:
parent
98284114f5
commit
25641abeb9
1 changed files with 7 additions and 2 deletions
|
@ -134,8 +134,13 @@ func convertToImageInfo(containers []interface{}, jsonPath string) (images []*Co
|
|||
var index = 0
|
||||
for _, ctr := range containers {
|
||||
if container, ok := ctr.(map[string]interface{}); ok {
|
||||
name := container["name"].(string)
|
||||
image := container["image"].(string)
|
||||
var name, image string
|
||||
|
||||
name = container["name"].(string)
|
||||
if _, ok := container["image"]; ok {
|
||||
image = container["image"].(string)
|
||||
}
|
||||
|
||||
jp := strings.Join([]string{jsonPath, strconv.Itoa(index), "image"}, "/")
|
||||
imageInfo, err := newImageInfo(image, jp)
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Reference in a new issue