Skip to content

Commit

Permalink
Add missing logs
Browse files Browse the repository at this point in the history
  • Loading branch information
jveski committed Nov 21, 2023
1 parent b88e716 commit d522bcf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion internal/controllers/reconciliation/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ func (c *Controller) buildPatch(ctx context.Context, prev, resource *reconstitut
return nil, fmt.Errorf("getting merge metadata: %w", err)
}
if model == nil {
logr.FromContextOrDiscard(ctx).V(1).Info("falling back to non-stategic patch because no patch metadata was found for this type in the openapi spec")
return jsonmergepatch.CreateThreeWayJSONMergePatch([]byte(prevManifest), []byte(resource.Manifest), desiredJS)
}

Expand Down
4 changes: 2 additions & 2 deletions internal/controllers/reconciliation/discoverycache.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ func newDicoveryCache(rc *rest.Config, qps float32, fillWhenNotFound bool) (*dis
}

func (d *discoveryCache) Get(ctx context.Context, gvk schema.GroupVersionKind) (proto.Schema, error) {
logger := logr.FromContextOrDiscard(ctx)
d.mut.Lock()
defer d.mut.Unlock()

Expand All @@ -52,12 +53,11 @@ func (d *discoveryCache) Get(ctx context.Context, gvk schema.GroupVersionKind) (
return d.checkSupportUnlocked(ctx, gvk, model)
}

// Don't invalidate the cache when configured not to
if !d.fillWhenNotFound {
logger.V(1).Info("type not found in openapi schema")
return nil, nil
}

// Get fresh schema and try again
if err := d.fillUnlocked(ctx); err != nil {
return nil, err
}
Expand Down

0 comments on commit d522bcf

Please sign in to comment.