Set logger before running the version command (#125)

This commit is contained in:
Itxaka 2023-05-08 16:13:31 +02:00 committed by GitHub
parent 77d0879ff1
commit d59fa6789c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 4 deletions

View File

@ -4,11 +4,15 @@ VERSION 0.6
# Framework images should use our initrd
ARG FLAVOR=core-opensuse-leap
ARG BASE_IMAGE=quay.io/kairos/$FLAVOR
ARG OSBUILDER_IMAGE=quay.io/kairos/osbuilder-tools
# renovate: datasource=docker depName=quay.io/kairos/osbuilder-tools versioning=semver-coerced
ARG OSBUILDER_VERSION=v0.6.4
ARG OSBUILDER_IMAGE=quay.io/kairos/osbuilder-tools:$OSBUILDER_VERSION
ARG ISO_NAME=$FLAVOR-immucore
ARG GO_VERSION=1.18
ARG GOLINT_VERSION=v1.47.3
# renovate: datasource=docker depName=golang
ARG GO_VERSION=1.20
# renovate: datasource=docker depName=golangci/golangci-lint
ARG GOLINT_VERSION=v1.52.2
version:
FROM alpine

View File

@ -15,7 +15,7 @@ import (
// YipLayoutPlugin is the immucore implementation of Layout yip's plugin based
// on partitioner package.
func YipLayoutPlugin(l logger.Interface, s schema.Stage, fs vfs.FS, console plugins.Console) (err error) {
func YipLayoutPlugin(l logger.Interface, s schema.Stage, _ vfs.FS, _ plugins.Console) (err error) {
if s.Layout.Device == nil {
return nil
}

View File

@ -82,6 +82,7 @@ func main() {
Name: "version",
Usage: "version",
Action: func(c *cli.Context) error {
utils.SetLogger()
v := version.Get()
utils.Log.Info().Str("commit", v.GitCommit).Str("compiled with", v.GoVersion).Str("version", v.Version).Msg("Immucore")
return nil