From d522bcfc7ed3c4ea3e38a2d5600fcd410114e8fd Mon Sep 17 00:00:00 2001 From: Jordan Olshevski Date: Tue, 21 Nov 2023 13:10:57 -0600 Subject: [PATCH] Add missing logs --- internal/controllers/reconciliation/controller.go | 1 - internal/controllers/reconciliation/discoverycache.go | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/internal/controllers/reconciliation/controller.go b/internal/controllers/reconciliation/controller.go index f99026e0..b111119f 100644 --- a/internal/controllers/reconciliation/controller.go +++ b/internal/controllers/reconciliation/controller.go @@ -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) } diff --git a/internal/controllers/reconciliation/discoverycache.go b/internal/controllers/reconciliation/discoverycache.go index 70d8b4ad..bd00a6ac 100644 --- a/internal/controllers/reconciliation/discoverycache.go +++ b/internal/controllers/reconciliation/discoverycache.go @@ -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() @@ -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 }