Skip to content

Commit

Permalink
fix: cleanup code
Browse files Browse the repository at this point in the history
Signed-off-by: anushkamittal20 <anumittal4641@gmail.com>
  • Loading branch information
anushkamittal20 committed Aug 13, 2024
1 parent ce3ec90 commit 2f9f479
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 31 deletions.
4 changes: 0 additions & 4 deletions pkg/engine/context/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,10 +315,6 @@ func (ctx *context) AddImageInfos(resource *unstructured.Unstructured, cfg confi
if err != nil {
return err
}
err = ctx.AddDeferredLoader(dl)
if err != nil {
return err
}
if toggle.FromContext(cont.Background()).EnableDeferredLoading() {
if err := ctx.AddDeferredLoader(dl); err != nil {
return err
Expand Down
27 changes: 0 additions & 27 deletions pkg/engine/policycontext/policy_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,33 +236,6 @@ func NewPolicyContext(
return policyContext, nil
}

type ImageInfoLoader struct {
resource *unstructured.Unstructured
configuration config.Configuration
hasLoaded bool
eCtx enginectx.Interface
}

func (l *ImageInfoLoader) Name() string {
return "ImageInfoLoader"
}

func (l *ImageInfoLoader) Matches(query string) bool {
return query == "imageinfo"
}

func (l *ImageInfoLoader) HasLoaded() bool {
return l.hasLoaded
}

func (l *ImageInfoLoader) LoadData() error {
if err := l.eCtx.AddImageInfos(l.resource, l.configuration); err != nil {
return err
}
l.hasLoaded = true
return nil
}

func NewPolicyContextFromAdmissionRequest(
jp jmespath.Interface,
request admissionv1.AdmissionRequest,
Expand Down

0 comments on commit 2f9f479

Please sign in to comment.