Skip to content

Bundle cache follow-ups: expose cache flags via Helm chart; keep registry-fetch metrics uncontaminated by cache hits #202

Description

@bdehamer

Follow-ups from the review of #192 (bundle cache + singleflight de-duplication). Two valid reviewer findings were deferred from that PR to keep it scoped to the cache/singleflight behavior and its correctness fixes.

A. Expose the bundle-cache flags via the Helm chart

The provider now supports -bundle-cache-ttl and -bundle-cache-max-entries, but the supported Helm deployment cannot set them: charts/artifact-attestations-opa-provider/templates/deployment.yaml renders a fixed argument list and values.yaml has no corresponding settings (nor an extraArgs escape hatch). Helm users therefore cannot tune or disable the cache despite the documented configuration surface.

  • Add values.yaml entries (e.g. bundleCache.ttl / bundleCache.maxEntries, or a general extraArgs).
  • Pass both arguments through the Deployment template.
  • Document the values in the chart / README.

E. Keep registry-fetch metrics uncontaminated by cache hits

aaop_attestations_retrieved_timer and aaop_attestations_retrieved_total are recorded in Provider.Validate around the fetch call and are documented as OCI-registry fetch latency / downloads. With the cache in place, a cache hit returns through the same path and is recorded as a ~0-latency "fetch"/"download"; once hits dominate, the latency distribution no longer reflects the registry and can mask the fetch-timeout signal the cache is meant to monitor.

  • Move the registry-fetch metrics into the upstream fetcher (DefaultBundleFetcher) so they only measure real registry calls — or otherwise propagate hit/upstream status so hits are excluded.
  • Update the metric Help text / README contract accordingly. (Cache hit/miss are already covered by aaop_bundle_cache_hits_total / aaop_bundle_cache_misses_total.)

Source

Raised by the automated reviewer on #192 (second review round). Deferred there; the correctness fixes from that round (negative-result caching, referrer-set staleness docs, cancelled-request fetch guard) are handled in #192 itself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions