Skip to content

Commit

Permalink
Show detect Termui screen during detect phase
Browse files Browse the repository at this point in the history
Signed-off-by: Anthony Emengo <aemengo@vmware.com>
  • Loading branch information
Anthony Emengo committed Aug 18, 2021
1 parent 9352ef6 commit c59923c
Show file tree
Hide file tree
Showing 21 changed files with 545 additions and 44 deletions.
6 changes: 6 additions & 0 deletions build.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import (
"github.com/buildpacks/pack/internal/stack"
"github.com/buildpacks/pack/internal/stringset"
"github.com/buildpacks/pack/internal/style"
"github.com/buildpacks/pack/internal/termui"
"github.com/buildpacks/pack/logging"
"github.com/buildpacks/pack/pkg/archive"
"github.com/buildpacks/pack/project"
Expand Down Expand Up @@ -125,6 +126,9 @@ type BuildOptions struct {
// Only trust builders from reputable sources.
TrustBuilder bool

// Launch a terminal UI to depict the build process
Interactive bool

// List of buildpack images or archives to add to a builder.
// These buildpacks may overwrite those on the builder if they
// share both an ID and Version with a buildpack on the builder.
Expand Down Expand Up @@ -329,6 +333,8 @@ func (c *Client) Build(ctx context.Context, opts BuildOptions) error {
Workspace: opts.Workspace,
GID: opts.GroupID,
PreviousImage: opts.PreviousImage,
Interactive: opts.Interactive,
Termui: termui.NewTermui(),
}

lifecycleVersion := ephemeralBuilder.LifecycleDescriptor().Info.Version
Expand Down
11 changes: 11 additions & 0 deletions build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2394,6 +2394,17 @@ func testBuild(t *testing.T, when spec.G, it spec.S) {
h.AssertEq(t, fakeLifecycle.Opts.PreviousImage, "example.com/some/new:tag")
})
})

when("interactive option", func() {
it("passthroughs to lifecycle", func() {
h.AssertNil(t, subject.Build(context.TODO(), BuildOptions{
Builder: defaultBuilderName,
Image: "example.com/some/repo:tag",
Interactive: true,
}))
h.AssertEq(t, fakeLifecycle.Opts.Interactive, true)
})
})
})
}

Expand Down
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ require (
github.com/containerd/continuity v0.0.0-20200107194136-26c1120b8d41 // indirect
github.com/docker/docker v20.10.8+incompatible
github.com/docker/go-connections v0.4.0
github.com/gdamore/tcell/v2 v2.3.3 // indirect
github.com/ghodss/yaml v1.0.0
github.com/golang/mock v1.6.0
github.com/google/go-cmp v0.5.6
Expand All @@ -27,6 +28,7 @@ require (
github.com/opencontainers/selinux v1.6.0 // indirect
github.com/pelletier/go-toml v1.9.3
github.com/pkg/errors v0.9.1
github.com/rivo/tview v0.0.0-20210624165335-29d673af0ce2 // indirect
github.com/sabhiram/go-gitignore v0.0.0-20201211074657-223ce5d391b0
github.com/sclevine/spec v1.4.0
github.com/sergi/go-diff v1.1.0 // indirect
Expand Down
18 changes: 18 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,10 @@ github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/gdamore/encoding v1.0.0 h1:+7OoQ1Bc6eTm5niUzBa0Ctsh6JbMW6Ra+YNuAtDBdko=
github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg=
github.com/gdamore/tcell/v2 v2.3.3 h1:RKoI6OcqYrr/Do8yHZklecdGzDTJH9ACKdfECbRdw3M=
github.com/gdamore/tcell/v2 v2.3.3/go.mod h1:cTTuF84Dlj/RqmaCIV5p4w8uG1zWdk0SF6oBpwHp4fU=
github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
Expand Down Expand Up @@ -342,6 +346,9 @@ github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/lucasb-eyer/go-colorful v1.0.3/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY=
github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60=
github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
Expand All @@ -358,6 +365,8 @@ github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hd
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/mattn/go-runewidth v0.0.10 h1:CoZ3S2P7pvtP45xOtBw+/mDL2z0RKI576gSkzRRpdGg=
github.com/mattn/go-runewidth v0.0.10/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2/go.mod h1:eD9eIE7cdwcMi9rYluz88Jz2VyhSmden33/aXg4oVIY=
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE=
Expand Down Expand Up @@ -447,6 +456,11 @@ github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
github.com/rivo/tview v0.0.0-20210624165335-29d673af0ce2 h1:I5N0WNMgPSq5NKUFspB4jMJ6n2P0ipz5FlOlB4BXviQ=
github.com/rivo/tview v0.0.0-20210624165335-29d673af0ce2/go.mod h1:IxQujbYMAh4trWr0Dwa8jfciForjVmxyHpskZX6aydQ=
github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/rogpeppe/fastuuid v1.1.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
Expand Down Expand Up @@ -727,6 +741,7 @@ golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210309074719-68d13333faf2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
Expand All @@ -735,6 +750,9 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20210510120138-977fb7262007 h1:gG67DSER+11cZvqIMb8S8bt0vZtiN6xWYARwirrOSfE=
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d h1:SZxvLBoTP5yHO3Frd4z4vrF+DBX9vMVanchswa69toE=
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand Down
16 changes: 10 additions & 6 deletions internal/build/container_ops.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,14 @@ func copyDirWindows(ctx context.Context, ctrClient client.CommonAPIClient, conta
return errors.Wrap(err, "copy app to container")
}

return container.Run(
return container.RunWithHandler(
ctx,
ctrClient,
ctr.ID,
ioutil.Discard, // Suppress xcopy output
stderr,
container.DefaultHandler(
ioutil.Discard, // Suppress xcopy output
stderr,
),
)
}

Expand Down Expand Up @@ -268,12 +270,14 @@ func EnsureVolumeAccess(uid, gid int, os string, volumeNames ...string) Containe
}
defer ctrClient.ContainerRemove(context.Background(), ctr.ID, types.ContainerRemoveOptions{Force: true})

return container.Run(
return container.RunWithHandler(
ctx,
ctrClient,
ctr.ID,
ioutil.Discard, // Suppress icacls output
stderr,
container.DefaultHandler(
ioutil.Discard, // Suppress icacls output
stderr,
),
)
}
}
18 changes: 9 additions & 9 deletions internal/build/container_ops_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func testContainerOps(t *testing.T, when spec.G, it spec.S) {
err = copyDirOp(ctrClient, ctx, ctr.ID, &outBuf, &errBuf)
h.AssertNil(t, err)

err = container.Run(ctx, ctrClient, ctr.ID, &outBuf, &errBuf)
err = container.RunWithHandler(ctx, ctrClient, ctr.ID, container.DefaultHandler(&outBuf, &errBuf))
h.AssertNil(t, err)

h.AssertEq(t, errBuf.String(), "")
Expand Down Expand Up @@ -147,7 +147,7 @@ lrwxrwxrwx 1 123 456 (.*) fake-app-symlink -> fake-app-file
err = copyDirOp(ctrClient, ctx, ctr.ID, &outBuf, &errBuf)
h.AssertNil(t, err)

err = container.Run(ctx, ctrClient, ctr.ID, &outBuf, &errBuf)
err = container.RunWithHandler(ctx, ctrClient, ctr.ID, container.DefaultHandler(&outBuf, &errBuf))
h.AssertNil(t, err)

h.AssertEq(t, errBuf.String(), "")
Expand Down Expand Up @@ -196,7 +196,7 @@ drwsrwsrwt 2 123 456 (.*) some-vol
err = copyDirOp(ctrClient, ctx, ctr.ID, &outBuf, &errBuf)
h.AssertNil(t, err)

err = container.Run(ctx, ctrClient, ctr.ID, &outBuf, &errBuf)
err = container.RunWithHandler(ctx, ctrClient, ctr.ID, container.DefaultHandler(&outBuf, &errBuf))
h.AssertNil(t, err)

h.AssertEq(t, errBuf.String(), "")
Expand Down Expand Up @@ -226,7 +226,7 @@ drwsrwsrwt 2 123 456 (.*) some-vol
err = copyDirOp(ctrClient, ctx, ctr.ID, &outBuf, &errBuf)
h.AssertNil(t, err)

err = container.Run(ctx, ctrClient, ctr.ID, &outBuf, &errBuf)
err = container.RunWithHandler(ctx, ctrClient, ctr.ID, container.DefaultHandler(&outBuf, &errBuf))
h.AssertNil(t, err)

h.AssertEq(t, errBuf.String(), "")
Expand Down Expand Up @@ -276,7 +276,7 @@ drwsrwsrwt 2 123 456 (.*) some-vol
err = writeOp(ctrClient, ctx, ctr.ID, &outBuf, &errBuf)
h.AssertNil(t, err)

err = container.Run(ctx, ctrClient, ctr.ID, &outBuf, &errBuf)
err = container.RunWithHandler(ctx, ctrClient, ctr.ID, container.DefaultHandler(&outBuf, &errBuf))
h.AssertNil(t, err)

h.AssertEq(t, errBuf.String(), "")
Expand Down Expand Up @@ -319,7 +319,7 @@ drwsrwsrwt 2 123 456 (.*) some-vol
err = writeOp(ctrClient, ctx, ctr.ID, &outBuf, &errBuf)
h.AssertNil(t, err)

err = container.Run(ctx, ctrClient, ctr.ID, &outBuf, &errBuf)
err = container.RunWithHandler(ctx, ctrClient, ctr.ID, container.DefaultHandler(&outBuf, &errBuf))
h.AssertNil(t, err)

h.AssertEq(t, errBuf.String(), "")
Expand Down Expand Up @@ -364,7 +364,7 @@ drwsrwsrwt 2 123 456 (.*) some-vol
err = writeOp(ctrClient, ctx, ctr.ID, &outBuf, &errBuf)
h.AssertNil(t, err)

err = container.Run(ctx, ctrClient, ctr.ID, &outBuf, &errBuf)
err = container.RunWithHandler(ctx, ctrClient, ctr.ID, container.DefaultHandler(&outBuf, &errBuf))
h.AssertNil(t, err)

h.AssertEq(t, errBuf.String(), "")
Expand Down Expand Up @@ -409,7 +409,7 @@ drwsrwsrwt 2 123 456 (.*) some-vol
err = writeOp(ctrClient, ctx, ctr.ID, &outBuf, &errBuf)
h.AssertNil(t, err)

err = container.Run(ctx, ctrClient, ctr.ID, &outBuf, &errBuf)
err = container.RunWithHandler(ctx, ctrClient, ctr.ID, container.DefaultHandler(&outBuf, &errBuf))
h.AssertEq(t, errBuf.String(), "")
h.AssertNil(t, err)

Expand Down Expand Up @@ -458,7 +458,7 @@ drwsrwsrwt 2 123 456 (.*) some-vol
initVolumeOp := build.EnsureVolumeAccess(123, 456, osType, ctrVolumes[0], ctrVolumes[0])
err = initVolumeOp(ctrClient, ctx, ctr.ID, &outBuf, &errBuf)
h.AssertNil(t, err)
err = container.Run(ctx, ctrClient, ctr.ID, &outBuf, &errBuf)
err = container.RunWithHandler(ctx, ctrClient, ctr.ID, container.DefaultHandler(&outBuf, &errBuf))
h.AssertNil(t, err)

h.AssertEq(t, errBuf.String(), "")
Expand Down
31 changes: 31 additions & 0 deletions internal/build/fakes/fake_termui.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package fakes

import (
"github.com/buildpacks/pack/internal/build"
"github.com/buildpacks/pack/internal/container"
)

type FakeTermui struct {
handler container.Handler
}

func NewFakeTermui(handler container.Handler) *FakeTermui {
return &FakeTermui{
handler: handler,
}
}

func (f *FakeTermui) Run(funk func()) error {
return nil
}

func (f *FakeTermui) Handler() container.Handler {
return f.handler
}

func WithTermui(screen build.Termui) func(*build.LifecycleOptions) {
return func(opts *build.LifecycleOptions) {
opts.Interactive = true
opts.Termui = screen
}
}
23 changes: 19 additions & 4 deletions internal/build/lifecycle_executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import (
"math/rand"
"time"

"github.com/buildpacks/pack/internal/cache"

"github.com/buildpacks/imgutil"
"github.com/buildpacks/lifecycle/api"
"github.com/buildpacks/lifecycle/platform"
"github.com/docker/docker/client"
"github.com/google/go-containerregistry/pkg/name"

"github.com/buildpacks/pack/internal/builder"
"github.com/buildpacks/pack/internal/cache"
"github.com/buildpacks/pack/internal/container"
"github.com/buildpacks/pack/logging"
)

Expand Down Expand Up @@ -47,6 +47,11 @@ type Cache interface {
Type() cache.Type
}

type Termui interface {
Run(funk func()) error
Handler() container.Handler
}

func init() {
rand.Seed(time.Now().UTC().UnixNano())
}
Expand All @@ -63,6 +68,8 @@ type LifecycleOptions struct {
Publish bool
TrustBuilder bool
UseCreator bool
Interactive bool
Termui Termui
DockerHost string
CacheImage string
HTTPProxy string
Expand All @@ -87,6 +94,14 @@ func (l *LifecycleExecutor) Execute(ctx context.Context, opts LifecycleOptions)
if err != nil {
return err
}
defer lifecycleExec.Cleanup()
return lifecycleExec.Run(ctx, NewDefaultPhaseFactory)

if !opts.Interactive {
defer lifecycleExec.Cleanup()
return lifecycleExec.Run(ctx, NewDefaultPhaseFactory)
}

return opts.Termui.Run(func() {
defer lifecycleExec.Cleanup()
lifecycleExec.Run(ctx, NewDefaultPhaseFactory)
})
}
11 changes: 8 additions & 3 deletions internal/build/phase.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ type Phase struct {
infoWriter io.Writer
errorWriter io.Writer
docker client.CommonAPIClient
handler container.Handler
ctrConf *dcontainer.Config
hostConf *dcontainer.HostConfig
ctr dcontainer.ContainerCreateCreatedBody
Expand All @@ -39,12 +40,16 @@ func (p *Phase) Run(ctx context.Context) error {
}
}

return container.Run(
handler := container.DefaultHandler(p.infoWriter, p.errorWriter)
if p.handler != nil {
handler = p.handler
}

return container.RunWithHandler(
ctx,
p.docker,
p.ctr.ID,
p.infoWriter,
p.errorWriter,
handler,
)
}

Expand Down
11 changes: 11 additions & 0 deletions internal/build/phase_config_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (

"github.com/docker/docker/api/types/container"

pcontainer "github.com/buildpacks/pack/internal/container"
"github.com/buildpacks/pack/internal/style"
"github.com/buildpacks/pack/logging"
)
Expand All @@ -28,6 +29,7 @@ type PhaseConfigProvider struct {
containerOps []ContainerOperation
infoWriter io.Writer
errorWriter io.Writer
handler pcontainer.Handler
}

func NewPhaseConfigProvider(name string, lifecycleExec *LifecycleExecution, ops ...PhaseConfigProviderOperation) *PhaseConfigProvider {
Expand Down Expand Up @@ -73,6 +75,11 @@ func NewPhaseConfigProvider(name string, lifecycleExec *LifecycleExecution, ops
lifecycleExec.logger.Debug("Host Settings:")
lifecycleExec.logger.Debugf(" Binds: %s", style.Symbol(strings.Join(provider.hostConf.Binds, " ")))
lifecycleExec.logger.Debugf(" Network Mode: %s", style.Symbol(string(provider.hostConf.NetworkMode)))

if lifecycleExec.opts.Interactive {
provider.handler = lifecycleExec.opts.Termui.Handler()
}

return provider
}

Expand All @@ -88,6 +95,10 @@ func (p *PhaseConfigProvider) HostConfig() *container.HostConfig {
return p.hostConf
}

func (p *PhaseConfigProvider) Handler() pcontainer.Handler {
return p.handler
}

func (p *PhaseConfigProvider) Name() string {
return p.name
}
Expand Down
Loading

0 comments on commit c59923c

Please sign in to comment.