diff --git a/go.mod b/go.mod index 5620c7cd3..60711dbe6 100644 --- a/go.mod +++ b/go.mod @@ -252,4 +252,4 @@ require ( sigs.k8s.io/yaml v1.3.0 // indirect ) -//replace get.porter.sh/magefiles v0.3.3 => ../magefiles +replace github.com/cnabio/cnab-go v0.25.1 => ../cnabio-cnab-go diff --git a/pkg/cnab/provider/action.go b/pkg/cnab/provider/action.go index 5124ab065..3aeb43923 100644 --- a/pkg/cnab/provider/action.go +++ b/pkg/cnab/provider/action.go @@ -61,6 +61,14 @@ func (r *Runtime) ApplyConfig(ctx context.Context, args ActionArguments) cnabact r.AddFiles(ctx, args), r.AddEnvironment(args), r.AddRelocation(args), + r.SetContext(ctx), + } +} + +func (r *Runtime) SetContext(ctx context.Context) cnabaction.OperationConfigFunc { + return func(op *driver.Operation) error { + op.CTX = ctx + return nil } } @@ -202,6 +210,11 @@ func (r *Runtime) Execute(ctx context.Context, args ActionArguments) error { tracing.ObjectAttribute("cnab-credentials", cnabCreds)) opResult, result, err := a.Run(cnabClaim, cnabCreds, r.ApplyConfig(ctx, args)...) + // if the error was due to context, just stop and return the context error + if ctx.Err() != nil { + return ctx.Err() + } + if currentRun.ShouldRecord() { if err != nil { err = r.appendFailedResult(ctx, err, currentRun)