@@ -2,7 +2,6 @@ package build // nolint:revive
22
33import (
44 "fmt"
5- "log"
65 "os"
76 "path"
87 "time"
@@ -38,8 +37,9 @@ type UploadCommand struct {
3837
3938 sourceBundleImage string // image to be used as the source bundle
4039
41- pw * reactor.PodWatcher // pod-watcher instance
42- follower * follower.Follower // follower instance
40+ ioStreams * genericclioptions.IOStreams // io streams for user-facing output
41+ pw * reactor.PodWatcher // pod-watcher instance
42+ follower * follower.Follower // follower instance
4343}
4444
4545const (
@@ -186,7 +186,7 @@ func (u *UploadCommand) createBuildRun(p *params.Params) (*buildv1beta1.BuildRun
186186 flags .SanitizeBuildRunSpec (& br .Spec )
187187
188188 ns := p .Namespace ()
189- log . Printf ( "Creating a BuildRun for '%s/%s' Build..." , ns , u .buildRefName )
189+ fmt . Fprintf ( u . ioStreams . Out , "Creating a BuildRun for '%s/%s' Build...\n " , ns , u .buildRefName )
190190 clientset , err := p .ShipwrightClientSet ()
191191 if err != nil {
192192 return nil , err
@@ -197,7 +197,7 @@ func (u *UploadCommand) createBuildRun(p *params.Params) (*buildv1beta1.BuildRun
197197 if err != nil {
198198 return nil , err
199199 }
200- log . Printf ( "BuildRun '%s' created!" , br .GetName ())
200+ fmt . Fprintf ( u . ioStreams . Out , "BuildRun '%s' created!\n " , br .GetName ())
201201 return br , nil
202202}
203203
@@ -207,7 +207,7 @@ func (u *UploadCommand) performDataStreaming(target *streamer.Target) error {
207207 return nil
208208 }
209209
210- fmt .Fprintf (os . Stdout , "Streaming %q to the Build POD %q ...\n " , u .sourceDir , target .Pod )
210+ fmt .Fprintf (u . ioStreams . Out , "Streaming %q to the Build POD %q ...\n " , u .sourceDir , target .Pod )
211211 // creates an in-memory tarball with source directory data, and ready to start data streaming
212212 tarball , err := streamer .NewTar (u .sourceDir )
213213 if err != nil {
@@ -280,6 +280,7 @@ func (u *UploadCommand) onPodModifiedEventBundling(pod *corev1.Pod) error {
280280// Run executes the primary business logic of this subcommand, by starting to watch over the build
281281// pod status and react accordingly.
282282func (u * UploadCommand ) Run (p * params.Params , ioStreams * genericclioptions.IOStreams ) error {
283+ u .ioStreams = ioStreams
283284 // creating a BuildRun with settings for the local source upload
284285 br , err := u .createBuildRun (p )
285286 if err != nil {
0 commit comments