Skip to content

Commit

Permalink
NDEV-19864: add correct packages
Browse files Browse the repository at this point in the history
Signed-off-by: Anushka Mittal <[email protected]>
  • Loading branch information
anushkamittal2001 committed Aug 27, 2024
1 parent 2dcc79a commit 6d3171c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
12 changes: 7 additions & 5 deletions pkg/engine/context/context.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package context

import (
cont "context"
"encoding/csv"
"fmt"
"regexp"
Expand All @@ -13,6 +14,7 @@ import (
"github.com/kyverno/kyverno/pkg/engine/jmespath"
"github.com/kyverno/kyverno/pkg/engine/jsonutils"
"github.com/kyverno/kyverno/pkg/logging"
"github.com/kyverno/kyverno/pkg/toggle"
apiutils "github.com/kyverno/kyverno/pkg/utils/api"
admissionv1 "k8s.io/api/admission/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
Expand Down Expand Up @@ -395,12 +397,12 @@ func (ctx *context) GenerateCustomImageInfo(resource *unstructured.Unstructured,
}

func (ctx *context) ImageInfo() map[string]map[string]apiutils.ImageInfo {
// force load of image info from deferred loader
if len(ctx.images) == 0 {
if err := ctx.loadDeferred("images"); err != nil {
return map[string]map[string]apiutils.ImageInfo{}
}
// force load of image info from deferred loader
if len(ctx.images) == 0 {
if err := ctx.loadDeferred("images"); err != nil {
return map[string]map[string]apiutils.ImageInfo{}
}
}
return ctx.images
}

Expand Down
3 changes: 2 additions & 1 deletion pkg/engine/context/context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import (
urkyverno "github.com/kyverno/kyverno/api/kyverno/v1beta1"
"github.com/kyverno/kyverno/pkg/config"
"github.com/kyverno/kyverno/pkg/engine/jmespath"
authenticationv1 "k8s.io/api/authentication/v1"
kubeutils "github.com/kyverno/kyverno/pkg/utils/kube"
"github.com/stretchr/testify/assert"
authenticationv1 "k8s.io/api/authentication/v1"
)

var (
Expand Down

0 comments on commit 6d3171c

Please sign in to comment.