Skip to content

Commit

Permalink
Add debug
Browse files Browse the repository at this point in the history
  • Loading branch information
oxpa committed Sep 5, 2024
1 parent ce8efa7 commit 9a633e5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions experimental/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func (m *manifestData) path() string {
}

func (m *manifestData) load(blobs blobsData) error {
logrus.Println("MANIFEST:", m.path(), ": loading...")
logrus.Infoln("MANIFEST:", m.path(), ": loading...")

data, err := currentStorage.Read(m.path(), blobs.etag(m.digest))
if err != nil {
Expand All @@ -88,7 +88,7 @@ func (m *manifestData) load(blobs blobsData) error {
if err != nil {
return err
}
logrus.Println("MANIFEST: list", m.path(), " references ", digest)
logrus.Infoln("MANIFEST: list", m.path(), " references ", digest)
m.manifests = append(m.manifests, digest)

path := filepath.Join("blobs", digest.scopedPath(), "data")
Expand Down
2 changes: 2 additions & 0 deletions experimental/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ func (r *repositoryData) markManifest(revision digest) error {
r.lock.Lock()
defer r.lock.Unlock()

logrus.Debugln("MANIFEST: marking ", revision)
r.manifests[revision]++
return nil
}
Expand Down Expand Up @@ -182,6 +183,7 @@ func (r *repositoryData) mark(blobs blobsData) error {
}

func (r *repositoryData) sweep() error {
logrus.Debug("SWEEP: list of manifests", r.manifests)
for name, t := range r.tags {
err := t.sweep()
if err != nil {
Expand Down
3 changes: 3 additions & 0 deletions experimental/tag.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ func (t *tagData) mark(blobs blobsData) error {

func (t *tagData) sweep() error {
if !t.current.valid() {
logrus.Trace("TAG: deleting invalid current ", t.currentLinkPath())
err := deleteFile(t.currentLinkPath(), digestReferenceSize)
if err != nil {
return err
Expand All @@ -55,11 +56,13 @@ func (t *tagData) sweep() error {
if version == t.current {
continue
}

if t.repository.manifests[version] > 0 {
continue
}

if *deleteOldTagVersions {
logrus.Trace("TAG: deleting old version", version)
err := deleteFile(t.versionLinkPath(version), digestReferenceSize)
if err != nil {
return err
Expand Down

0 comments on commit 9a633e5

Please sign in to comment.