Merge pull request #46405 from rumpl/image-events
This commit is contained in:
commit
2c95ddf4f3
3 changed files with 10 additions and 0 deletions
|
@ -113,6 +113,8 @@ func (i *ImageService) ExportImage(ctx context.Context, names []string, outStrea
|
|||
"target": target,
|
||||
}).Debug("export image without name")
|
||||
}
|
||||
|
||||
i.LogImageEvent(target.Digest.String(), target.Digest.String(), events.ActionSave)
|
||||
}
|
||||
|
||||
return i.client.Export(ctx, outStream, opts...)
|
||||
|
|
|
@ -11,6 +11,7 @@ import (
|
|||
"github.com/containerd/containerd/pkg/snapshotters"
|
||||
"github.com/containerd/containerd/platforms"
|
||||
"github.com/distribution/reference"
|
||||
"github.com/docker/docker/api/types/events"
|
||||
"github.com/docker/docker/api/types/registry"
|
||||
"github.com/docker/docker/errdefs"
|
||||
"github.com/docker/docker/pkg/streamformatter"
|
||||
|
@ -88,5 +89,8 @@ func (i *ImageService) PullImage(ctx context.Context, image, tagOrDigest string,
|
|||
// error to not mark the pull as failed.
|
||||
logger.WithError(err).Warn("unexpected error while removing outdated dangling image reference")
|
||||
}
|
||||
|
||||
i.LogImageEvent(reference.FamiliarString(ref), reference.FamiliarName(ref), events.ActionPull)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@ import (
|
|||
"github.com/containerd/containerd/remotes"
|
||||
"github.com/containerd/containerd/remotes/docker"
|
||||
"github.com/distribution/reference"
|
||||
"github.com/docker/docker/api/types/events"
|
||||
"github.com/docker/docker/api/types/registry"
|
||||
"github.com/docker/docker/errdefs"
|
||||
"github.com/docker/docker/pkg/progress"
|
||||
|
@ -147,6 +148,9 @@ func (i *ImageService) PushImage(ctx context.Context, targetRef reference.Named,
|
|||
}
|
||||
}
|
||||
|
||||
if err == nil {
|
||||
i.LogImageEvent(reference.FamiliarString(targetRef), reference.FamiliarName(targetRef), events.ActionPush)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue