Skip to content

Commit 2baa686

Browse files
committed
Better error message for s2i calls
picking knative#3185 Signed-off-by: Matej Vašek <[email protected]>
1 parent 13aeaba commit 2baa686

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/builders/s2i/builder.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
"github.com/openshift/source-to-image/pkg/build"
1717
"github.com/openshift/source-to-image/pkg/build/strategies"
1818
s2idocker "github.com/openshift/source-to-image/pkg/docker"
19+
s2iError "github.com/openshift/source-to-image/pkg/errors"
1920
"github.com/openshift/source-to-image/pkg/scm/git"
2021

2122
"knative.dev/func/pkg/builders"
@@ -206,6 +207,10 @@ func (b *Builder) Build(ctx context.Context, f fn.Function, platforms []fn.Platf
206207
if impl == nil {
207208
impl, _, err = strategies.Strategy(client, cfg, build.Overrides{})
208209
if err != nil {
210+
var s2iErr s2iError.Error
211+
if errors.As(err, &s2iErr) {
212+
err = fmt.Errorf("%s: %w", s2iErr.Error(), s2iErr.Details)
213+
}
209214
return fmt.Errorf("cannot create s2i builder: %w", err)
210215
}
211216
}

0 commit comments

Comments
 (0)