From acf42e2e70493cebbca3351018b013ee6f37751a Mon Sep 17 00:00:00 2001 From: Win San Date: Mon, 13 May 2024 14:18:45 -0500 Subject: [PATCH] Add image prep info log (#579) --- executor/linux/build.go | 5 +++++ executor/linux/stage.go | 2 ++ executor/local/build.go | 4 ++++ executor/local/stage.go | 2 ++ 4 files changed, 13 insertions(+) diff --git a/executor/linux/build.go b/executor/linux/build.go index 51f1a56a..ed87ed95 100644 --- a/executor/linux/build.go +++ b/executor/linux/build.go @@ -271,6 +271,9 @@ func (c *client) AssembleBuild(ctx context.Context) error { s.Detach = true c.Logger.Infof("creating %s service", s.Name) + + _log.AppendData([]byte(fmt.Sprintf("> Preparing service image %s...\n", s.Image))) + // create the service c.err = c.CreateService(ctx, s) if c.err != nil { @@ -326,6 +329,8 @@ func (c *client) AssembleBuild(ctx context.Context) error { continue } + _log.AppendData([]byte(fmt.Sprintf("> Preparing step image %s...\n", s.Image))) + c.Logger.Infof("creating %s step", s.Name) // create the step c.err = c.CreateStep(ctx, s) diff --git a/executor/linux/stage.go b/executor/linux/stage.go index 044c5c2d..83dacf0c 100644 --- a/executor/linux/stage.go +++ b/executor/linux/stage.go @@ -37,6 +37,8 @@ func (c *client) CreateStage(ctx context.Context, s *pipeline.Stage) error { // update the container environment with stage name _step.Environment["VELA_STEP_STAGE"] = s.Name + _log.AppendData([]byte(fmt.Sprintf("> Preparing step image %s...\n", _step.Image))) + logger.Debugf("creating %s step", _step.Name) // create the step err := c.CreateStep(ctx, _step) diff --git a/executor/local/build.go b/executor/local/build.go index 9eb13db2..c3d9e196 100644 --- a/executor/local/build.go +++ b/executor/local/build.go @@ -167,6 +167,8 @@ func (c *client) AssembleBuild(ctx context.Context) error { // TODO: remove this; but we need it for tests _service.Detach = true + fmt.Fprintln(c.stdout, _pattern, fmt.Sprintf("> Preparing service image %s...", _service.Image)) + // create the service c.err = c.CreateService(ctx, _service) if c.err != nil { @@ -213,6 +215,8 @@ func (c *client) AssembleBuild(ctx context.Context) error { continue } + fmt.Fprintln(c.stdout, _pattern, fmt.Sprintf("> Preparing step image %s...", _step.Image)) + // create the step c.err = c.CreateStep(ctx, _step) if c.err != nil { diff --git a/executor/local/stage.go b/executor/local/stage.go index c8edfdce..7a4edab1 100644 --- a/executor/local/stage.go +++ b/executor/local/stage.go @@ -29,6 +29,8 @@ func (c *client) CreateStage(ctx context.Context, s *pipeline.Stage) error { // update the container environment with stage name _step.Environment["VELA_STEP_STAGE"] = s.Name + fmt.Fprintln(c.stdout, _pattern, fmt.Sprintf("> Preparing step image %s...", _step.Image)) + // create the step err := c.CreateStep(ctx, _step) if err != nil {