mirror of
https://github.com/kairos-io/immucore.git
synced 2025-09-17 15:40:27 +00:00
Add version command and fix commit version
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"os"
|
||||
|
||||
"github.com/kairos-io/immucore/internal/utils"
|
||||
"github.com/kairos-io/immucore/internal/version"
|
||||
"github.com/kairos-io/immucore/pkg/mount"
|
||||
"github.com/rs/zerolog"
|
||||
"github.com/rs/zerolog/log"
|
||||
@@ -39,6 +40,9 @@ Sends a generic event payload with the configuration found in the scanned direct
|
||||
zerolog.SetGlobalLevel(zerolog.DebugLevel)
|
||||
}
|
||||
|
||||
v := version.Get()
|
||||
log.Logger.Info().Str("commit", v.GitCommit).Str("compiled with", v.GoVersion).Str("version", v.Version).Msg("Immucore")
|
||||
|
||||
g := herd.DAG(herd.EnableInit)
|
||||
|
||||
// You can pass rd.cos.disable in the cmdline to disable the whole immutable stuff
|
||||
@@ -86,4 +90,15 @@ Sends a generic event payload with the configuration found in the scanned direct
|
||||
return err
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "version",
|
||||
Usage: "version",
|
||||
Action: func(c *cli.Context) error {
|
||||
log.Logger = log.Output(zerolog.ConsoleWriter{Out: os.Stderr}).With().Logger()
|
||||
zerolog.SetGlobalLevel(zerolog.InfoLevel)
|
||||
v := version.Get()
|
||||
log.Logger.Info().Str("commit", v.GitCommit).Str("compiled with", v.GoVersion).Str("version", v.Version).Msg("Immucore")
|
||||
return nil
|
||||
},
|
||||
},
|
||||
}
|
||||
|
Reference in New Issue
Block a user