Update pusher to use content writer
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
This commit is contained in:
17
client.go
17
client.go
@@ -209,10 +209,6 @@ type RemoteContext struct {
|
||||
// afterwards. Unpacking is required to run an image.
|
||||
Unpack bool
|
||||
|
||||
// PushWrapper allows hooking into the push method. This can be used
|
||||
// track content that is being sent to the remote.
|
||||
PushWrapper func(remotes.Pusher) remotes.Pusher
|
||||
|
||||
// BaseHandlers are a set of handlers which get are called on dispatch.
|
||||
// These handlers always get called before any operation specific
|
||||
// handlers.
|
||||
@@ -251,15 +247,6 @@ func WithImageHandler(h images.Handler) RemoteOpts {
|
||||
}
|
||||
}
|
||||
|
||||
// WithPushWrapper is used to wrap a pusher to hook into
|
||||
// the push content as it is sent to a remote.
|
||||
func WithPushWrapper(w func(remotes.Pusher) remotes.Pusher) RemoteOpts {
|
||||
return func(client *Client, c *RemoteContext) error {
|
||||
c.PushWrapper = w
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Client) Pull(ctx context.Context, ref string, opts ...RemoteOpts) (Image, error) {
|
||||
pullCtx := defaultRemoteContext()
|
||||
for _, o := range opts {
|
||||
@@ -318,10 +305,6 @@ func (c *Client) Push(ctx context.Context, ref string, desc ocispec.Descriptor,
|
||||
return err
|
||||
}
|
||||
|
||||
if pushCtx.PushWrapper != nil {
|
||||
pusher = pushCtx.PushWrapper(pusher)
|
||||
}
|
||||
|
||||
var m sync.Mutex
|
||||
manifestStack := []ocispec.Descriptor{}
|
||||
|
||||
|
Reference in New Issue
Block a user