Skip to content

Commit

Permalink
fix inkctl exec log output
Browse files Browse the repository at this point in the history
  • Loading branch information
zc2638 committed Mar 11, 2024
1 parent 8f9535b commit 79a22fa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
10 changes: 7 additions & 3 deletions core/clients/client_direct.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,20 @@ func (c *clientDirect) Info(_ context.Context, stageID uint64) (*v1.Data, error)
return data, nil
}

func (c *clientDirect) StageBegin(_ context.Context, _ *v1.Stage) error {
func (c *clientDirect) StageBegin(_ context.Context, stage *v1.Stage) error {
fmt.Printf("\x1b[1m[STAGE:%s] %s\x1b[0m\n", stage.Worker.Kind, stage.Name)
return nil
}

func (c *clientDirect) StageEnd(_ context.Context, _ *v1.Stage) error {
func (c *clientDirect) StageEnd(_ context.Context, stage *v1.Stage) error {
if stage.Phase == v1.PhaseSkipped {
fmt.Printf("\x1b[1m[STAGE:%s](SKIPPED) %s\x1b[0m\n", stage.Worker.Kind, stage.Name)
}
return nil
}

func (c *clientDirect) StepBegin(_ context.Context, step *v1.Step) error {
fmt.Printf("\x1b[1m%s\x1b[0m\n", "[STEP] "+step.Name)
fmt.Printf("\x1b[1m[STEP] %s\x1b[0m\n", step.Name)
return nil
}

Expand Down
9 changes: 0 additions & 9 deletions core/command/ctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import (

"github.com/99nil/gopkg/printer"
"github.com/spf13/cobra"
"github.com/zc2638/wslog"
"golang.org/x/sync/errgroup"
"gopkg.in/yaml.v3"

Expand Down Expand Up @@ -627,13 +626,6 @@ func execBuild(
data.Status.Steps = append(data.Status.Steps, step)
}

log := wslog.With(
"name", workflow.GetName(),
"namespace", workflow.GetNamespace(),
"worker_kind", workerObj.Kind.String(),
)
log.Info("Begin workflow")

eg, ctx := errgroup.WithContext(context.Background())
eg.Go(func() error { return worker.Run(ctx, wc, hook) })
eg.Go(func() error {
Expand All @@ -646,7 +638,6 @@ func execBuild(
if err := eg.Wait(); err != nil {
return err
}
log.Info("End workflow")
}
return nil
}

0 comments on commit 79a22fa

Please sign in to comment.