Skip to content

Commit

Permalink
planner/run: Add information about build commit sha
Browse files Browse the repository at this point in the history
Show git sha in logs at startup.

Signed-off-by: Cosmin Tupangiu <cosmin@redhat.com>
  • Loading branch information
tupyy authored and machacekondra committed Jan 20, 2025
1 parent afe9fb6 commit ab4bce4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/planner-api/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"github.com/kubev2v/migration-planner/internal/events"
"github.com/kubev2v/migration-planner/internal/store"
"github.com/kubev2v/migration-planner/pkg/log"
"github.com/kubev2v/migration-planner/pkg/version"
"github.com/spf13/cobra"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
Expand All @@ -24,7 +25,6 @@ var runCmd = &cobra.Command{
Use: "run",
Short: "Run the planner api",
RunE: func(cmd *cobra.Command, args []string) error {
zap.S().Info("Starting API service")
defer zap.S().Info("API service stopped")

if configFile == "" {
Expand All @@ -46,6 +46,8 @@ var runCmd = &cobra.Command{
undo := zap.ReplaceGlobals(logger)
defer undo()

zap.S().Info("Starting API service...")
zap.S().Infof("Build from git commit: %s", version.Get().GitCommit)
zap.S().Info("Initializing data store")
db, err := store.InitDB(cfg)
if err != nil {
Expand Down

0 comments on commit ab4bce4

Please sign in to comment.