@@ -17,6 +17,7 @@ import (
17
17
"sync"
18
18
"time"
19
19
20
+ "github.com/docker/distribution/reference"
20
21
"github.com/google/uuid"
21
22
"github.com/opentracing/opentracing-go"
22
23
"github.com/sirupsen/logrus"
@@ -306,6 +307,17 @@ func (o *Orchestrator) Build(req *protocol.BuildRequest, resp protocol.ImageBuil
306
307
return false
307
308
}
308
309
310
+ pbaseref , err := reference .Parse (baseref )
311
+ if err != nil {
312
+ return xerrors .Errorf ("cannot parse baseref: %v" , err )
313
+ }
314
+ bobBaseref := "localhost:8080/base"
315
+ if r , ok := pbaseref .(reference.Digested ); ok {
316
+ bobBaseref += "@" + r .Digest ().String ()
317
+ } else {
318
+ bobBaseref += ":latest"
319
+ }
320
+
309
321
var swr * wsmanapi.StartWorkspaceResponse
310
322
err = retry (ctx , func (ctx context.Context ) (err error ) {
311
323
swr , err = o .wsman .StartWorkspace (ctx , & wsmanapi.StartWorkspaceRequest {
@@ -333,7 +345,7 @@ func (o *Orchestrator) Build(req *protocol.BuildRequest, resp protocol.ImageBuil
333
345
WorkspaceLocation : contextPath ,
334
346
Envvars : []* wsmanapi.EnvironmentVariable {
335
347
{Name : "BOB_TARGET_REF" , Value : "localhost:8080/target:latest" },
336
- {Name : "BOB_BASE_REF" , Value : "localhost:8080/base:latest" },
348
+ {Name : "BOB_BASE_REF" , Value : bobBaseref },
337
349
{Name : "BOB_BUILD_BASE" , Value : buildBase },
338
350
{Name : "BOB_DOCKERFILE_PATH" , Value : dockerfilePath },
339
351
{Name : "BOB_CONTEXT_DIR" , Value : contextPath },
0 commit comments