Add unpack opts
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
@@ -65,7 +65,7 @@ func (s *fsApplier) Apply(ctx context.Context, desc ocispec.Descriptor, mounts [
|
||||
|
||||
var config diff.ApplyConfig
|
||||
for _, o := range opts {
|
||||
if err := o(&config); err != nil {
|
||||
if err := o(ctx, desc, &config); err != nil {
|
||||
return emptyDesc, errors.Wrap(err, "failed to apply config opt")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ type ApplyConfig struct {
|
||||
}
|
||||
|
||||
// ApplyOpt is used to configure an Apply operation
|
||||
type ApplyOpt func(*ApplyConfig) error
|
||||
type ApplyOpt func(context.Context, ocispec.Descriptor, *ApplyConfig) error
|
||||
|
||||
// Applier allows applying diffs between mounts
|
||||
type Applier interface {
|
||||
@@ -100,7 +100,7 @@ func WithLabels(labels map[string]string) Opt {
|
||||
|
||||
// WithPayloads sets the apply processor payloads to the config
|
||||
func WithPayloads(payloads map[string]*types.Any) ApplyOpt {
|
||||
return func(c *ApplyConfig) error {
|
||||
return func(_ context.Context, _ ocispec.Descriptor, c *ApplyConfig) error {
|
||||
c.ProcessorPayloads = payloads
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ func (s windowsLcowDiff) Apply(ctx context.Context, desc ocispec.Descriptor, mou
|
||||
|
||||
var config diff.ApplyConfig
|
||||
for _, o := range opts {
|
||||
if err := o(&config); err != nil {
|
||||
if err := o(ctx, desc, &config); err != nil {
|
||||
return emptyDesc, errors.Wrap(err, "failed to apply config opt")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ func (s windowsDiff) Apply(ctx context.Context, desc ocispec.Descriptor, mounts
|
||||
|
||||
var config diff.ApplyConfig
|
||||
for _, o := range opts {
|
||||
if err := o(&config); err != nil {
|
||||
if err := o(ctx, desc, &config); err != nil {
|
||||
return emptyDesc, errors.Wrap(err, "failed to apply config opt")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user