Describe the issue
Currently, when the OCI provider fetches artifact versions (GetArtifactVersions), it relies on the org.opencontainers.image.created annotation in the image manifest to determine the artifact's creation date.
However, many container images are not built with this specific annotation. When it is missing, Minder falls back to assigning time.Now() as the creation date (explicitly marked as a // FIXME: This is a hack in internal/providers/oci/oci.go).
Impact:
If a container image is missing the creation annotation, Minder reports it as being created at the exact moment the query was executed. This creates unreliable data and breaks age-based artifact filtering logic, lifecycle policies, and analytics metrics regarding artifact creation.
Proposed Solution:
Instead of relying solely on the manifest annotations and falling back to a hack, the provider should fetch the actual image configuration blob (application/vnd.oci.image.config.v1+json). According to the OCI Image Format Specification, the config blob natively contains a created timestamp property. By fetching the config blob when the annotation is missing, we can reliably determine the true creation date of the artifact.
To Reproduce
- Register a container repository (OCI provider) in Minder.
- Push a container image to the registry that does not contain the
org.opencontainers.image.created annotation in its manifest.
- Have Minder fetch the artifact versions for that container.
- Observe that the
CreatedAt timestamp for the artifact is set to the exact time the fetch occurred (i.e. time.Now()), rather than the actual time the image was built.
What version are you using?
main
Describe the issue
Currently, when the OCI provider fetches artifact versions (
GetArtifactVersions), it relies on theorg.opencontainers.image.createdannotation in the image manifest to determine the artifact's creation date.However, many container images are not built with this specific annotation. When it is missing, Minder falls back to assigning
time.Now()as the creation date (explicitly marked as a// FIXME: This is a hackininternal/providers/oci/oci.go).Impact:
If a container image is missing the creation annotation, Minder reports it as being created at the exact moment the query was executed. This creates unreliable data and breaks age-based artifact filtering logic, lifecycle policies, and analytics metrics regarding artifact creation.
Proposed Solution:
Instead of relying solely on the manifest annotations and falling back to a hack, the provider should fetch the actual image configuration blob (
application/vnd.oci.image.config.v1+json). According to the OCI Image Format Specification, the config blob natively contains acreatedtimestamp property. By fetching the config blob when the annotation is missing, we can reliably determine the true creation date of the artifact.To Reproduce
org.opencontainers.image.createdannotation in its manifest.CreatedAttimestamp for the artifact is set to the exact time the fetch occurred (i.e.time.Now()), rather than the actual time the image was built.What version are you using?
main