Skip to content

Commit

Permalink
Add annotation for creation date when pushing
Browse files Browse the repository at this point in the history
  • Loading branch information
viovanov committed Oct 20, 2021
1 parent 72fb506 commit ff4d522
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/app/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package app

import (
"net/http"
"time"

"github.com/containerd/containerd/remotes/docker"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
Expand Down Expand Up @@ -66,6 +67,7 @@ func (c *PolicyApp) Push(userRef string) error {
})

refDescriptor.Annotations[ocispec.AnnotationTitle] = ref
refDescriptor.Annotations[ocispec.AnnotationCreated] = time.Now().UTC().Format(time.RFC3339)

pushDescriptor, err := oras.Push(c.Context,
resolver,
Expand Down

0 comments on commit ff4d522

Please sign in to comment.