@@ -7,7 +7,6 @@ package local
77import (
88 "context"
99 "fmt"
10- "os"
1110 "sync"
1211 "time"
1312
@@ -97,7 +96,7 @@ func (c *client) PlanBuild(ctx context.Context) error {
9796 }
9897
9998 // output init progress to stdout
100- fmt .Fprintln (os . Stdout , _pattern , "> Inspecting runtime network..." )
99+ fmt .Fprintln (c . stdout , _pattern , "> Inspecting runtime network..." )
101100
102101 // inspect the runtime network for the pipeline
103102 network , err := c .Runtime .InspectNetwork (ctx , c .pipeline )
@@ -107,7 +106,7 @@ func (c *client) PlanBuild(ctx context.Context) error {
107106 }
108107
109108 // output the network information to stdout
110- fmt .Fprintln (os . Stdout , _pattern , string (network ))
109+ fmt .Fprintln (c . stdout , _pattern , string (network ))
111110
112111 // create the runtime volume for the pipeline
113112 err = c .Runtime .CreateVolume (ctx , c .pipeline )
@@ -117,7 +116,7 @@ func (c *client) PlanBuild(ctx context.Context) error {
117116 }
118117
119118 // output init progress to stdout
120- fmt .Fprintln (os . Stdout , _pattern , "> Inspecting runtime volume..." )
119+ fmt .Fprintln (c . stdout , _pattern , "> Inspecting runtime volume..." )
121120
122121 // inspect the runtime volume for the pipeline
123122 volume , err := c .Runtime .InspectVolume (ctx , c .pipeline )
@@ -127,7 +126,7 @@ func (c *client) PlanBuild(ctx context.Context) error {
127126 }
128127
129128 // output the volume information to stdout
130- fmt .Fprintln (os . Stdout , _pattern , string (volume ))
129+ fmt .Fprintln (c . stdout , _pattern , string (volume ))
131130
132131 return c .err
133132}
@@ -162,7 +161,7 @@ func (c *client) AssembleBuild(ctx context.Context) error {
162161 }
163162
164163 // output init progress to stdout
165- fmt .Fprintln (os . Stdout , _pattern , "> Preparing service images..." )
164+ fmt .Fprintln (c . stdout , _pattern , "> Preparing service images..." )
166165
167166 // create the services for the pipeline
168167 for _ , _service := range c .pipeline .Services {
@@ -183,11 +182,11 @@ func (c *client) AssembleBuild(ctx context.Context) error {
183182 }
184183
185184 // output the image information to stdout
186- fmt .Fprintln (os . Stdout , _pattern , string (image ))
185+ fmt .Fprintln (c . stdout , _pattern , string (image ))
187186 }
188187
189188 // output init progress to stdout
190- fmt .Fprintln (os . Stdout , _pattern , "> Preparing stage images..." )
189+ fmt .Fprintln (c . stdout , _pattern , "> Preparing stage images..." )
191190
192191 // create the stages for the pipeline
193192 for _ , _stage := range c .pipeline .Stages {
@@ -206,7 +205,7 @@ func (c *client) AssembleBuild(ctx context.Context) error {
206205 }
207206
208207 // output init progress to stdout
209- fmt .Fprintln (os . Stdout , _pattern , "> Preparing step images..." )
208+ fmt .Fprintln (c . stdout , _pattern , "> Preparing step images..." )
210209
211210 // create the steps for the pipeline
212211 for _ , _step := range c .pipeline .Steps {
@@ -229,11 +228,11 @@ func (c *client) AssembleBuild(ctx context.Context) error {
229228 }
230229
231230 // output the image information to stdout
232- fmt .Fprintln (os . Stdout , _pattern , string (image ))
231+ fmt .Fprintln (c . stdout , _pattern , string (image ))
233232 }
234233
235234 // output a new line for readability to stdout
236- fmt .Fprintln (os . Stdout , "" )
235+ fmt .Fprintln (c . stdout , "" )
237236
238237 // assemble runtime build just before any containers execute
239238 c .err = c .Runtime .AssembleBuild (ctx , c .pipeline )
@@ -353,14 +352,14 @@ func (c *client) StreamBuild(ctx context.Context) error {
353352 streams , streamCtx := errgroup .WithContext (ctx )
354353
355354 defer func () {
356- fmt .Fprintln (os . Stdout , "waiting for stream functions to return" )
355+ fmt .Fprintln (c . stdout , "waiting for stream functions to return" )
357356
358357 err := streams .Wait ()
359358 if err != nil {
360- fmt .Fprintln (os . Stdout , "error in a stream request:" , err )
359+ fmt .Fprintln (c . stdout , "error in a stream request:" , err )
361360 }
362361
363- fmt .Fprintln (os . Stdout , "all stream functions have returned" )
362+ fmt .Fprintln (c . stdout , "all stream functions have returned" )
364363 }()
365364
366365 // allow the runtime to do log/event streaming setup at build-level
@@ -374,11 +373,11 @@ func (c *client) StreamBuild(ctx context.Context) error {
374373 select {
375374 case req := <- c .streamRequests :
376375 streams .Go (func () error {
377- fmt .Fprintf (os . Stdout , "[%s: %s] > Streaming container '%s'...\n " , req .Key , req .Container .Name , req .Container .ID )
376+ fmt .Fprintf (c . stdout , "[%s: %s] > Streaming container '%s'...\n " , req .Key , req .Container .Name , req .Container .ID )
378377
379378 err := req .Stream (streamCtx , req .Container )
380379 if err != nil {
381- fmt .Fprintln (os . Stdout , "error streaming:" , err )
380+ fmt .Fprintln (c . stdout , "error streaming:" , err )
382381 }
383382
384383 return nil
@@ -399,7 +398,7 @@ func (c *client) DestroyBuild(ctx context.Context) error {
399398 err = c .Runtime .RemoveBuild (ctx , c .pipeline )
400399 if err != nil {
401400 // output the error information to stdout
402- fmt .Fprintln (os . Stdout , "unable to destroy runtime build:" , err )
401+ fmt .Fprintln (c . stdout , "unable to destroy runtime build:" , err )
403402 }
404403 }()
405404
@@ -414,7 +413,7 @@ func (c *client) DestroyBuild(ctx context.Context) error {
414413 err = c .DestroyStep (ctx , _step )
415414 if err != nil {
416415 // output the error information to stdout
417- fmt .Fprintln (os . Stdout , "unable to destroy step:" , err )
416+ fmt .Fprintln (c . stdout , "unable to destroy step:" , err )
418417 }
419418 }
420419
@@ -429,7 +428,7 @@ func (c *client) DestroyBuild(ctx context.Context) error {
429428 err = c .DestroyStage (ctx , _stage )
430429 if err != nil {
431430 // output the error information to stdout
432- fmt .Fprintln (os . Stdout , "unable to destroy stage:" , err )
431+ fmt .Fprintln (c . stdout , "unable to destroy stage:" , err )
433432 }
434433 }
435434
@@ -439,22 +438,22 @@ func (c *client) DestroyBuild(ctx context.Context) error {
439438 err = c .DestroyService (ctx , _service )
440439 if err != nil {
441440 // output the error information to stdout
442- fmt .Fprintln (os . Stdout , "unable to destroy service:" , err )
441+ fmt .Fprintln (c . stdout , "unable to destroy service:" , err )
443442 }
444443 }
445444
446445 // remove the runtime volume for the pipeline
447446 err = c .Runtime .RemoveVolume (ctx , c .pipeline )
448447 if err != nil {
449448 // output the error information to stdout
450- fmt .Fprintln (os . Stdout , "unable to destroy runtime volume:" , err )
449+ fmt .Fprintln (c . stdout , "unable to destroy runtime volume:" , err )
451450 }
452451
453452 // remove the runtime network for the pipeline
454453 err = c .Runtime .RemoveNetwork (ctx , c .pipeline )
455454 if err != nil {
456455 // output the error information to stdout
457- fmt .Fprintln (os . Stdout , "unable to destroy runtime network:" , err )
456+ fmt .Fprintln (c . stdout , "unable to destroy runtime network:" , err )
458457 }
459458
460459 return err
0 commit comments