Skip to content

Commit 92e85bb

Browse files
committed
fix: Set org.opencontainers.image.created annotation on ModelKit manifests
Add the standard OCI annotation `org.opencontainers.image.created` with the current time in RFC 3339 format to ModelKit manifests during the pack operation, alongside the existing `ml.kitops.modelkit.cli-version` annotation. Fixes #1138 Signed-off-by: itniuma <itniuma@proton.me>
1 parent 85bf690 commit 92e85bb

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

pkg/lib/filesystem/local-storage.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"errors"
2424
"fmt"
2525
"os"
26+
"time"
2627

2728
"github.com/kitops-ml/kitops/pkg/artifact"
2829
"github.com/kitops-ml/kitops/pkg/lib/constants"
@@ -64,6 +65,11 @@ func SaveModel(ctx context.Context, localRepo local.LocalRepo, kitfile *artifact
6465
return nil, fmt.Errorf("error creating manifest: %w", err)
6566
}
6667

68+
if manifest.Annotations == nil {
69+
manifest.Annotations = map[string]string{}
70+
}
71+
manifest.Annotations[ocispec.AnnotationCreated] = time.Now().UTC().Format(time.RFC3339)
72+
6773
// If not storing a Kitfile, save the Kitfile to an annotation since it will be lost otherwise
6874
if opts.ModelFormat == mediatype.ModelPackFormat {
6975
kitfileBytes, err := kitfile.MarshalToJSON()

0 commit comments

Comments
 (0)