fix(dashboard): periodic OCI repo discovery from k8s for late-arriving CRDs#130
Merged
fix(dashboard): periodic OCI repo discovery from k8s for late-arriving CRDs#130
Conversation
Add UnmarshalYAML migration on Contract to transparently handle the pre-#127 format: singular `configuration` field, dependencies and policies without required `name`. OCI bundles published before the breaking change fail to parse with `field configuration not found`, which prevents caching and breaks dashboard service details, diffs, and version tracking. Migration rules: - `configuration:` (object) → `configurations:` (array, name="default") - `configuration: {configs: [...]}` → `configurations: [...]` (unwrap) - Dependencies without name → derived from ref (last path segment) - Policies without name → name="default" New-format contracts are unaffected.
…g CRDs When the dashboard starts before all CRDs are deployed (e.g. ArgoCD hasn't synced yet), EnrichFromK8s only discovers repos that exist at startup. CRDs that appear later never get their OCI repos scanned. Add a repoProvider callback to OCISource that's called during each background discovery cycle (every 60s). The dashboard wires this to query k8s for resolvedRefs, so late-arriving CRDs automatically feed into OCI scanning. Also clear failedRepos on each cycle so previously failed repos are retried (e.g. after the v1 format compat fix is deployed). Root cause: dashboard pod started at 10:04:14Z, but pacto-demo CRDs were created at 10:06:14Z by ArgoCD — 2 minutes after enrichment ran.
…rce_oci - Remove v1 contract format migration (migrate.go) — bundles must use current format - Extract RepoProviderFromSource to eliminate duplicated wiring lambdas - Move discoverOCIReposFromSource to source_oci.go where it belongs - Add tests for RepoProvider, discoverOCIReposFromSource, nil K8s guard
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When the dashboard starts before all CRDs are deployed (e.g. ArgoCD hasn't synced yet), EnrichFromK8s only discovers repos that exist at startup. CRDs that appear later never get their OCI repos scanned, leaving those services with k8s-only data — no diffs, no full bundle details, no version enrichment.
Root cause: dashboard pod started at 10:04:14Z, but pacto-demo CRDs were created at 10:06:14Z by ArgoCD.
Changes
repoProvidercallback toOCISource, called each background discovery cycle (60s)RepoProviderFromSourcefactory that queries aDataSourcefor resolvedRef/imageRef fieldsdiscoverOCIReposFromSourcetosource_oci.go(was in detect.go)Test plan